Create A Bank Database Schema With The Following Relations And #526
This subjective question is related to the book/course gs gs114 Relational Database Management System. It can also be found in gs gs114 Practical Questions Solved Past Paper No. 1.
account(account_number, branch_name, balance)
branch (branch_name, branch_city, assets)
customer (customer_name customer_street, customer_city)
loan (loan_number, branch_name, amount)
depositor((customer_name, account_number)
borrower(customer_name, loan_number)
branch_name varchar(15) not null,
balance number not null,
primary key(account_number));
create table branch
(branch_name varchar(15) not null unique,
branch_city varchar(15) not null,
assets number not null,
primary key(branch_name));
create table customer
(customer_name varchar(15) not null unique,
customer_street varchar(12) not null,
customer_city varchar(15) not null,
primary key(customer_name));
create table loan
(loan_number varchar(15) not null unique,
branch_name varchar(15) not null,
amount number not null,
primary key(loan_number));
create table depositor
(customer_name varchar(15) not null,
account_number varchar(15) not null,
primary key(customer_name, account_number),
foreign key(account_number) references account(account_number),
foreign key(customer_name) references customer(customer_name));
create table borrower
(customer_name varchar(15) not null,
loan_number varchar(15) not null,
primary key(customer_name, loan_number),
foreign key(customer_name) references customer(customer_name),
foreign key(loan_number) references loan(loan_number));