0% found this document useful (0 votes)
22 views

Sbi 1 500000 Boi 2 600000 Syndicate 3 800000: Branch - Name Assets Branch - City

This document discusses creating tables and inserting data for a bank scenario database with tables for branches, loans, borrowers, customers, and credit cards. It includes the SQL queries to create each table and insert sample data. The queries are then used to select and view the data inserted in each table.

Uploaded by

Aman Bekinal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Sbi 1 500000 Boi 2 600000 Syndicate 3 800000: Branch - Name Assets Branch - City

This document discusses creating tables and inserting data for a bank scenario database with tables for branches, loans, borrowers, customers, and credit cards. It includes the SQL queries to create each table and insert sample data. The queries are then used to select and view the data inserted in each table.

Uploaded by

Aman Bekinal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Draw E-R diagram and convert entities and relationships to relation table
for a given scenari.
Two assignment shall be carried out i.e consider two different scenarios
1. Bank
2. college

Querry1> create table Branch(branch_name varchar(20),assets


integer,branch_city varchar(20));

insert into Branch values('sbi',500000,'bijapur');

insert into Branch values('boi',600000,'belgaum');

insert into Branch values('syndicate',700000,'gulbarga');

select * from Branch;

BR ANCH_N AM E AS SET S BR ANCH_CITY

Sbi 500000 bijapur


Boi 600000 belgaum
Syndicate 700000 gulbarga

Querry2> Create table loan(branch_name varchar(20),loan_number


integer,amount integer);
insert into loan values('sbi',01,500000);
insert into loan values('boi',02,600000);
insert into loan values('syndicate',03,800000);
select * from loan;
BR ANCH_N AM E LO AN_NUM BER AM O UNT

sbi 1 500000
boi 2 600000
syndicate 3 800000
Querry3> create table borrower(customer_id integer,loan_number integer);

insert into borrower values(101,1);

insert into borrower values(102,2);

insert into borrower values(103,3);

select * from borrower;

CUSTOMER_ID LO AN_NUMBER
101 1
102 2
103 3

Querry4> create table customer(customer_id integer,customer_name


varchar(20),customer_street varchar(20),customer_city varchar(15));

insert into customer values(101,'jack','victoriya road','london');

insert into customer values(102,'vicky','oxford road','oman');

insert into customer values(103,'jhon','cambridge road','america');

select * from customer;

CUSTOME CUSTOMER_N CUSTOMER_ST CUSTOMER_


R_ID AME REET CITY
101 jack victoriya road london
102 vicky oxford road oman
103 jhon cambridge road america

Querry5> create table credit_cards(credit_cardno integer,limits


integer,expiry_date date);

insert into credit_cards values(011,5000,'1-jan-19');


insert into credit_cards values(012,8000,'1-feb-20');

insert into credit_cards values(013,9000,'1-jan-21');

select * from credit_cards;

CREDIT_CARDNO LIMITS EXPIRY_DATE


11 5000 01-JAN-19
12 8000 01-FEB-20
13 9000 01-JAN-21

You might also like