title: Bank transactions table - can this be done better?
body: <p>I am wondering what is the best way to make bank transaction table.</p>
  
  <p>I know that user can have many accounts so I add <code>AccountID</code> instead of <code>UserID</code>, but how do I name the other, foreign account. And how do I know if it is incoming or outgoing transaction. I have an example here but I think it can be done better so I ask for your advice.</p>
  
  <p>In my example I store all transactions in one table and add bool <code>isOutgoing</code>. So if it is set to <code>true</code> than I know that user sent money to <code>ForeignAccount</code> if it's <code>false</code> then I know that <code>ForeignAccount</code> sent money to user.</p>
  
  <p>My example</p>
  
  <p><img src="https://i.stack.imgur.com/iHyrV.png" alt="enter image description here"></p>
  
  <p><em>Please note that this is not for real bank, of course. I am just trying things out and figuring best practices.</em></p>