0% found this document useful (0 votes)
18 views3 pages

Table Creation

The document outlines the creation of a database named 'Bankdata' with tables for banks, branches, accounts, loans, and customers. It includes SQL commands for creating these tables, inserting data into them, and selecting data for viewing. The structure establishes relationships between entities such as banks, branches, accounts, loans, and customers through foreign keys.

Uploaded by

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

Table Creation

The document outlines the creation of a database named 'Bankdata' with tables for banks, branches, accounts, loans, and customers. It includes SQL commands for creating these tables, inserting data into them, and selecting data for viewing. The structure establishes relationships between entities such as banks, branches, accounts, loans, and customers through foreign keys.

Uploaded by

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

Create Database Bankdata;

Use Bankdata;

Create table Bank(bank_id int primary key,


bank_name varchar(30) not null,
bank_address varchar(100));

Create table Branch(branch_id int primary key,


branch_name varchar(200) not null,
branch_Address varchar(50),
bank_id int,
foreign key(bank_id)
references Bank(bank_id));

Create table Account(account_no int primary key,


account_type varchar(20),
balance decimal(30,5),
branch_id int,
foreign key(branch_id)
references Branch(branch_id));

Create table Loan(loan_no int primary key,


loan_type varchar(40),
account_no int,
amount decimal(20,3),
branch_id int,
foreign key(account_no)
references Account(account_no),
foreign key(branch_id)
references Branch(branch_id));

Create table Customer(customer_id int primary key,


customer_name varchar(20),
customer_address varchar(100),
Gender varchar(10),
Phone_no int,
account_no int,
loan_no int,
branch_id int,
foreign key(account_no)
references Account(account_no),
foreign key(loan_no)
references Loan(loan_no),
foreign key(branch_id)
references Branch(branch_id));
Insert into Bank values (101,'STATE BANK OF INDIA', 'STATE BANK HOUSE, MADAMECANA
ROAD MUMBAI');

Insert into Bank values (102, 'HDFC BANK', 'HDFC BANK HOUSE,SENAPATHI MARG
,MUMBAI');

Insert into Bank values (103, 'AXIS BANK','AXIX BANK HOUSE, WADIA
INTERNATIONAL CENTER,MUMBAI');

Insert into Bank values (104, 'KARNATAKA BANK', 'KARNATAKA BANK HOUSE
LIMITED,KANAKANDY,MANGLORE');

Select * from Bank;

INSERT INTO Branch VALUES ('5943','SBI BRANCH,HIMALAYA


HOUSE,KASTURBA NEW DELHI','SBI KASTURBA NEW DELHI',101);

INSERT INTO Branch VALUES ('6421','SBI BRANCH AT 15,MALABAR HILLS NEW


DELHI','SBI MALABAR HILLS NEW DELHI',101);

INSERT INTO Branch VALUES ('2998', '17TH FLOOR ,CHRUCH STREET BANGLORE',
'HDFC CHRUCH STREET BANGLORE',102);

INSERT INTO Branch VALUES ('1751', 'GROUND FLOOR,SHUBH COMPLEX,


BANGLORE', 'HDFC SHUBH COMPLEX,BANGLORE',102);

INSERT INTO Branch VALUES ('2022', 'AXIS BRANCH AT 43,AMBEDKAR


CIRCLE,MUMBAI URBAN', 'UTIB MUMBAI',103);

INSERT INTO Branch VALUES ('9', 'SECOND FLOOR,NIRAMAN COMPLEX,DELHI',


'UTIB DELHI',103);

INSERT INTO Branch VALUES ('54', 'KARNATAKA BRANCH,GANDHI


SQUARE,HASSAN', 'KARB HASSAN',104);

INSERT INTO Branch VALUES ('5', 'KARNATAKA BRANCH, M G ROAD,CHICKMANGLORE',


'KARB CHICKMANGLORE',104);

Select * from Branch;

INSERT INTO Account VALUES ('965789012', 'SAVINGS', '500000','5943');


INSERT INTO Account VALUES ('178900345', 'CURRENT', '80000', '2998');
INSERT INTO Account VALUES ('901234567', 'CURRENT','10000','2022');
INSERT INTO Account VALUES ('900012345','SAVINGS', '5000','9');
INSERT INTO Account VALUES ('5467890', 'CURRENT','10000','54');
INSERT INTO Account VALUES ('17512345', 'SAVINGS','670000','1751');
INSERT INTO Account VALUES ('50008900', 'CURRENT', '45000','5');
INSERT INTO Account VALUES ('642134567', 'SAVINGS','89000','6421');
Select * from Account;
INSERT INTO Loan VALUES ('23', 'PERSONAL LOAN', '17512345', '50000', '2998');
INSERT INTO Loan VALUES ('56', 'HOUSE LOAN', '17512345', '1000000', '2998');
INSERT INTO Loan VALUES ('90', 'CAR LOAN', '50008900', '600000', '5');
INSERT INTO Loan VALUES ('76', 'BUISNESS LOAN', '642134567', '300000', '6421');
INSERT INTO Loan VALUES ('92', 'PERSONAL LOAN', '965789012', '75000', '5943');

Select * from Loan;

INSERT INTO Customer VALUES ('1234', 'RAHUL', 'KASTURABA ROAD,NEW DELHI', 'M',
'8799001435', '965789012', '23', '5943');

INSERT INTO Customer VALUES ('4565', 'SANJAY', 'BTM LAYOUT,BANGLORE', 'M',


'9900134568', '178900345', '56', '2998');

INSERT INTO Customer VALUES ('5678', 'KARTHIK', 'KUVEMPU NAGAR,MYSORE', 'M',


'8998708901', '901234567', '76', '2022');

INSERT INTO Customer VALUES ('0234', 'LAKSHMI', 'AMBEDKAR CIRCLE,MUMBAI', 'F',


'9089076547', '900012345', '90', '9' );

INSERT INTO Customer VALUES ('2367', 'URMILA', 'TIPPU CIRCLE,HASSAN', 'F', '9081076547',
'5467890', '90', '54');

INSERT INTO Customer VALUES ('6789', 'SHWETHA', 'JAYAMMA APARTMENT HOUSE


NO1, MANGLORE', 'F', '9089076547', '17512345', '90', '1751');

INSERT INTO Customer VALUES ('7899', 'KUMAR', 'MOODBIDRE MANGALORE', 'M',


'9087076547', '50008900', '92', '5');

INSERT INTO Customer VALUES ('8975', 'BINDHU', 'MAIN ROAD KARKALA', 'F', '8789076547',
'642134567', '92', '6421');

Select * from Customer;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy