Assignment 1 603CS
Assignment 1 603CS
Consider a banking system where various entities interact with each other to manage
financial services and customer accounts. The bank has multiple Branches, and each Branch
employs several Employees. Customers can open Accounts, and each Customer may hold
multiple Accounts, while each Account is linked to only one Customer. Additionally,
Accounts can be associated with multiple Services (like loans, credit cards, insurance), and
each Service can be linked to Accounts. This structure helps the bank manage its personnel,
customer services, and operations efficiently.
Based on the above scenario you have to answer the following questions.
a) Construct a database design diagram that includes the Branches and Employees
tables only, clearly illustrating their relationship.
1. Branches Table:
o BranchID (Primary Key)
o BranchName
o Location
2. Employees Table:
o EmployeeID (Primary Key)
o Name
o Position
o BranchID (Foreign Key, references BranchID in Branches table)
Relationship:
The BranchID serves as a foreign key in the Employees table to establish a link
between employees and the branches they work in. This creates a one-to-many
relationship: One branch can have multiple employees, but each employee belongs to
only one branch.
b) Determine the type of relationship present between the Accounts and Services
tables. Additionally, create a database design diagram that includes only the
Accounts and Services tables to illustrate this relationship.
Type of Relationship:
Each account can subscribe to multiple services and each service can have multiple accounts
associated with it, the relationship between Accounts and Services is a many-to-many
relationship.
To represent this relationship, you'd need a junction table (e.g., AccountServices) to link the
two tables.
Database Design:
1. Accounts Table:
o AccountID (Primary Key)
o AccountName
o Email
2. Services Table:
o ServiceID (Primary Key)
o ServiceName
oDescription
3. AccountServices Table (Junction Table):
o AccountID (Foreign Key, references AccountID in Accounts table)
o ServiceID (Foreign Key, references ServiceID in Services table)
o (Composite Key: AccountID + ServiceID as the Primary Key)
c) Mention only the names of all the potential tables involved in the banking system
based on the given scenario.
Based on the given scenario, potential table names in the banking system could include:
1. Branches
2. Employees
3. Accounts
4. Services
5. AccountServices
6. Transactions
7. Customers
8. Loans
9. LoanRepayments
10. CreditCards
11. Insurance
d) Based on your analysis in questions (a) and (b), specifically list the required
column names for each table and also specify the corresponding keys.
Based on my analysis of questions (a) and (b), here are the required columns and
corresponding keys for each table:
Branches Table
Columns:
o BranchID (Primary Key)
o BranchName
o Location
Employees Table
Columns:
o EmployeeID (Primary Key)
o Name
o Position
o BranchID (Foreign Key, references BranchID in Branches table)
Accounts Table
Columns:
o AccountID (Primary Key)
o AccountName
o Email
o CustomerID (Foreign Key)
Services Table
Columns:
o ServiceID (Primary Key)
o ServiceName
o Description
Columns:
o AccountID (Foreign Key, references AccountID in Accounts table)
o ServiceID (Foreign Key, references ServiceID in Services table)
o (Composite Key: AccountID + ServiceID as the Primary Key)