Professional Documents
Culture Documents
DBMSPBL
DBMSPBL
DBMSPBL
INTRODUCTION
Existing Problem
Proposed Solution
Bank Entity : Attributes of Bank Entity are Bank Name, Code and Address.
Code is Primary Key for Bank Entity.
Customer Entity : Attributes of Customer Entity are Customer_id, Name,
Phone Number and Address.
Customer_id is Primary Key for Customer Entity.
Branch Entity : Attributes of Branch Entity are Branch_id, Name and
Address.
Branch_id is Primary Key for Branch Entity.
Account Entity : Attributes of Account Entity are Account_number,
Account_Type and Balance.
Account_number is Primary Key for Account Entity.
Loan Entity : Attributes of Loan Entity are Loan_id, Loan_Type and
Amount.
Loan_id is Primary Key for Loan Entity.
SOURCE CODE
sql
-- Create table for the relationship between Branch and Loan (Offer)
CREATE TABLE Offer (
branch_id INT,
loan_id INT,
PRIMARY KEY (branch_id, loan_id),
FOREIGN KEY (branch_id) REFERENCES Branch(branch_id),
FOREIGN KEY (loan_id) REFERENCES Loan(loan_id)
);
Relational Model
Entity/Relationship Attributes
Bank Code (PK), name, address
Branch branch_id (PK), name, address, bank_code (FK)
Customer customer_id (PK), name, address, phone
Account account_no (PK), account_type, balance
Loan loan_id (PK), loan_type, amount
Offer branch_id (PK, FK), loan_id (PK, FK)
Maintain branch_id (PK, FK), account_no (PK, FK)
Hold by customer_id (PK, FK), account_no (PK, FK)
Availed by customer_id (PK, FK), loan_id (PK, FK)
EXPLANATION OF RELATIONSHIPS
NORMALIZATION
The tables created above are already in Third Normal Form (3NF) because:
- All attributes are atomic.
- Each table has a primary key.
- There are no partial dependencies (every non-key attribute is fully
functionally dependent on the primary key).
- There are no transitive dependencies (non-key attributes are not
dependent on other non-key attributes).
CONCLUSION
FUTURE ENHANCEMENTS