title: Database Relationship Transaction and Reference Table
body: <p>Hi I have some questions regarding what i'll do with foreign data if deleted</p>
  
  <p>i have: a transaction table and it has foreign keys to user and branch</p>
  
  <p>so if a delete a user thats being referenced by the transaction table the transaction record</p>
  
  <p>will also be deleted what will I do?? can you guys please give me some advice?? thanks</p>
  
  <p>my tables are: Transaction, Branch and User</p>
  
  <p>1 Branch can have Many Transactions 
   1 User can have many Transactions</p>
  
  <p>Transaction 1-------* Branch
  Transaction 1-------* User</p>
  
  <p>so if i delete either a user or branch the transaction record referencing to it will also be deleted.. if i dont cascade the delete it will just be an orphan id in the transaction table with no user or branch to reference to. so what shall I do with this? please help..</p>