Uploaded by kh5320543

kamrul. [307] Database lab (4)

advertisement
Green University of Bangladesh
Department of Computer Science and Engineering (CSE)
Faculty of Sciences and Engineering
Semester: (Fall, Year: 2023), B.Sc. in CSE (Day)
LAB REPORT NO- 04
Course Title: Database System Lab
Course Code: CSE-210
Section: 213 D13
Lab Experiment Name: • 1. Create This following Bank Database.
branch (branch_name, branch_city, assets)
customer (customer_id,customer_name, customer_city)
account (account_number, branch_name, balance)
loan (loan_number, branch_name, amount)
depositor (customer_name, account_number)
borrower (customer_name, loan_number)
• Tables are placed according to parent and child relationship
• Create above table considering PRIMARY KEY and FOREIGN KEY.
• Data type for amount and balance are INTEGER otherwise VARCHAR(13).
• Insert records into your table.
• Add column Email in customer relation and Set the value.
• Change the name of column name customer_city and modify the data type of column assets
Student Details
Name
ID
Kamrul Hasan
221902307
Lab Date
Submission Date
Course Teacher’s Name
: 18/10/2023
: 26/10/2023
: Wahia Tasnim
[For Teachers use only: Don’t Write Anything inside this box]
Lab Report Status
Marks: …………………………………
Signature:.....................
Comments:..............................................
Date:..............................
Analysis Query:
Create Database Bank
1st table create branch :
2nd table create :
3rd table create :
4th table create :
5th table create :
6th table create
Showing all the Output of Table create:
Now inserting into the table :
1st table insert into the values
INSERT INTO branch (branch_name, branch_city, assets) VALUES ('Main Branch', 'New
York', 1000000);
INSERT INTO branch (branch_name, branch_city, assets) VALUES ('Downtown
Branch', 'New York', 500000);
2nd table :Customer
3rd table account :
4th table :
5th table depositor :
6th table borrower :
Adding the email column:
Modifying Column Name and Data Type:
Conclusion :
In this lab exercise, we successfully created a bank database with the specified tables, established primary
key and foreign key relationships, inserted sample records, added the "Email" column to the "customer"
table, and modified column names and data types as required. The database is now ready for use in a
banking application.
Download