0% found this document useful (0 votes)
708 views4 pages

Experiment 9: Bank Database Objective

The document describes an experiment involving a database for a bank. It outlines the tables that would be needed for the database including tables for customers, branches, accounts, loans, depositors, and borrowers. It provides examples of what data would be stored in each table. The objective is to design a schema for the bank database and provide sample data to track customers, accounts, loans, and the relationships between them.

Uploaded by

prudhvi chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
708 views4 pages

Experiment 9: Bank Database Objective

The document describes an experiment involving a database for a bank. It outlines the tables that would be needed for the database including tables for customers, branches, accounts, loans, depositors, and borrowers. It provides examples of what data would be stored in each table. The objective is to design a schema for the bank database and provide sample data to track customers, accounts, loans, and the relationships between them.

Uploaded by

prudhvi chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

EXPERIMENT 9: BANK DATABASE

OBJECTIVE

CASE STUDY: BANK DATABASE


A bank has many branches and a large number of customers. A customer can open different kinds of
accounts with the bank. The bank keeps track of a customer by his SSN, name, address, and phone
number. Age is used as a factor to check whether he is a major. There are different types of loans, each
identified by a loan number. A customer can take out more than one type of loan, and all branches can
give loans. Loans have a duration and interest rate. The account holder can enquire about the balance in
his account, answer for the following queries

9.3 DESCRIPTION/PROGRAM LOGIC

SCHEMA OF BANK DATABASE

1. create table customer(cust_name varchar2(15) primary key, cust_street varchar2(15) nonull,


cust_city varchar2(15) not null);

2. create table branch(branch_name varchar2(15) primary key, branch_city varchar2(15) not


null, asserts number(8) not null);

3. create table account(acc_number varchar2(15) primary key, branch_name varchar2(20) not


null, balance number(8), foreign key(branch_name) references branch(branch_name));

4. create table loan( loan_number varchar2(15) primary key, branch_name varchar2(15) not null,
amount number(8) not null, foreign key(branch_name) references branch(branch_name));

5. create table depositor(cust_name varchar2(15) not null, acc_number varchar2(15) not null,
primary key(cust_name, acc_numer), foreign key(cust_name) references
customer(cust_name),foreign key(acc_number) references account (acc_number));

6. create table borrower (cust_name varchar2(15) not null, loan_number varchar2(15) not null,
primary key(cust_name, loan_number), foreign key(cust_name)
references customer(cust_name), foreign key(loan_number) referencesloan(loan_number));

9.4 PROCEDURE

CustomerTable

CUST_NAME CUST_STREET CUST_CITY


--------------- --------------- ---------------
Jones Main Harrison
Smith Main Rye
Hayes Main Harrison
Curry north Rye
Lindsay Park Pittsfield
Turner putnam Stamford
Williams Nassau Princeton
Adams spring Pittsfield
Johnson Alma palo Alto
Glenn Sandhill Woodside
Brooks Senator Brooklyn

Branch Table

BRANCH_NAME BRANCH_CITY ASSERTS


--------------- --------------- ---------------------------------------------
Downtown Brooklyn 900000
Redwood Palo Alto 2100000
Perryridge Horseneck 1700000
Mianus Horseneck 400200
Round Hill Horseneck 8000000
Pownal Bennington 400000
North Town Rye 3700000
Brighton Brooklyn 7000000
Central Rye 400280

Account Table

OUTPUT:
ACC_NUMBER BRANCH_NAME BALANCE
--------------- -------------------- --------------------------------------
A-101 Downtown 500
A-215 Mianus 700
A-102 Perryridge 400
A-305 Round Hill 350
A-201 Perryridge 900
A-333 Central 850
A-444 North Town 625
A-217 Brighton 750
A-222 Redwood 700

Loan table

LOAN_NUMBER BRANCH_NAME AMOUNT


L-17 Downtown 1000
L-15 Perryridge 1500
L-14 Downtown 1500
L-93 Mianus 500
L-11 Round Hill 900
L-16 Perryridge 1300
L-20 North Town 7500
L-21 Central 570
L-23 Redwood 2000

Depositor table

CUST_NAME ACC_NUMBER
Johnson A-101
Smith A-215
Hayes A-102
Hayes A-101
Turner A-305
Johnson A-201
Jones A-217
Lindsay A-222
Majeris A-333
Smith A-444

Borrower table
CUST_NAME LOAN_NUMBER
--------------- -------------------------------
Jones L-17
Smith L-23
Hayes L-15
Jackson L-14
Curry L-93
Smith L-11
Williams L-17
Adams L-16
McBridge L-20
Smith L-21

You might also like