Announcement

Announcement Module
Collapse
No announcement yet.

Help with simple banking database

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with simple banking database

    I have to create a simple bank database using MySQL, so i have to create tables and relationships between them (normalization).

    I have created those tables :

    Branch (BranchID, BranchPlace)

    Account (AccountID, AccountNumber, AccountType, Balance)

    Client (ClientID, ClientName, ClientSurname, ClientCity)

    Transaction (TransactionID, TransactionType, Amount)

    So i need defining primary keys and foreign keys, can anyone help me with this ?
    Thanks

  • #2
    You will first need to better understand the business case to determine what relationships need to exist, but my basic suggestions would be:

    1) Add ClientID to the 'Account' table with the foreign key constraint: Account.ClientID => Client.ClientID
    2) Add AccountID and BranchID to the 'Transaction' table with the foreign key constraints: Transaction.AccountID => Account.AccountID, Transaction.BranchID => Branch.BranchID

    With those changes you will know the applicable information for each transaction (account number, client, and branch).

    Hope that helps!
    Scott

    Comment

    Working...
    X