View Full Version : Simple Banking database
12-31-2011, 07:23 PM
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 ?
01-01-2012, 08:31 AM
show us what you've tried.
01-01-2012, 02:08 PM
I created those tables, but i think i should relate table Client with another table , what would u suggest .
create table Branch (
Primary key (BranchID)
create table Account (
Foreign key(BranchID) references Branch(BranchID)
create table Client(
primary key (ClientID)
create table transaction(
primary key (TransID),
foreign key (AccountID) references account (AccountID)
01-02-2012, 01:06 AM
You could relate client to branch, as most banks assign a client to a single branch, but from a database standpoint that's not needed.
If you do it, just add
Branch ID INT REFERENECES Branch(BranchID)
to the clients table.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.