NotesHub
([Link])
DBMS LAB FILE
Th
4 Semester
[Name]
[Roll No.]
CREATE TABLES ACCORDING TO THE FOLLOWING
DEFINITION:-
Create table deposit(acno varchar2(5), cname varchar2(18),
bname varchar2(18), amount number(8,2), adate date);
Create table branch(bname varchar2(18), city varchar2(18));
Create table customers(cname varchar2(18), city varchar2(18));
[Name]
[Roll No.]
Create table borrow(loanno varchar2(5), cname varchar2(18),
bname varchar2(18), amount number(8,2));
[Name]
[Roll No.]
DESCRIBE TABLES WHICH ARE ALREADY
DESCRIBED:-
Describe deposit;
Describe branch;
[Name]
[Roll No.]
Describe customers;
Describe borrow;
[Name]
[Roll No.]
INSERT THE DATA AS SHOWN BELOW:-
Insert into deposit values (‘100’,’anil’,’vrce’,1000.00,’1-mar-
95’);
Insert into deposit values (‘101’,’sunil’,’ajni’,5000.00,’4-jan-96’);
Insert into deposit values
(‘102’,’mehul’,’karolbagh’,3500.00,’17-nov-95’);
Insert into deposit values
(‘104’,’madhuri’,’chandini’,1200.00,’17-dec-95’);
[Name]
[Roll No.]
Insert into deposit values
(‘105’,’pramod’,’[Link]’,3000.00,’27-mar-96’);
Insert into deposit values (‘106’,’sandip’,’andheri’,2000.00,’31-
mar-96’);
Insert into deposit values (‘107’,’shivani’,’virar’,1000.00,’5-sep-
95’);
Insert into deposit values (‘108’,’kranti’,’nehru
place’,5000.00,’2-jul-95’);
[Name]
[Roll No.]
Insert into deposit values (‘109’,’minu’,’powai’,7000.00,’10-aug-
95’);
Insert into branch values (‘vrce’,’nagpur’);
Insert into branch values (‘ajni’,’nagpur’);
Insert into branch values (‘karolbagh’,’delhi’);
[Name]
[Roll No.]
Insert into branch values (‘chandini’,’delhi’);
Insert into branch values (‘dharampeth’,’nagpur’);
Insert into branch values (‘[Link]’,’bangalore);
Insert into branch values (‘andheri’,’bombay’);
[Name]
[Roll No.]
Insert into branch values (‘virar’,’bombay’);
Insert into branch values (‘nehru place’,’delhi’);
Insert into branch values (‘powai’,’bombay’);
Insert into customers values (‘anil’,’calcutta’);
[Name]
[Roll No.]
Insert into customers values (‘mehul’,’baroda’);
Insert into customers values (‘mandar’,’patna’);
Insert into customers values (‘madhuri’,’nagpur’);
Insert into customers values (‘pramod’,’nagpur’);
[Name]
[Roll No.]
Insert into customers values (‘sandip’,’surat’);
Insert into customers values (‘shivani’,’bombay’);
Insert into customers values (‘kranti’,’bombay’);
Insert into customers values (‘naren’,’bombay’);
[Name]
[Roll No.]
Insert into borrow values (‘201’,’anil’,’vrce’,1000.00);
Insert into borrow values (‘206’,’mehul’,’ajni’,5000.00);
Insert into borrow values (‘311’,’sunil’,’dharampeth’,3000.00);
Insert into borrow values (‘321’,’madhuri’,’andheri’,2000.00);
[Name]
[Roll No.]
Insert into borrow values (‘375’,’pramod’,’virar’,8000.00);
Insert into borrow values (‘481’,’kranti’,’nehru place’,3000.00);
[Name]
[Roll No.]
SELECTING DATA FROM SINGLE TABLE:-
List of all data from the table deposit
List of all data from the table branch
[Name]
[Roll No.]
List of all data from the table customers
List of all data from the data borrow
[Name]
[Roll No.]
Give account no. and amount of depositers
Give cname and account no. of all depositers
[Name]
[Roll No.]
Give the names of customers
Give the names of branches
[Name]
[Roll No.]
Give the names of borrowers
Give the names of customers living in the city Nagpur
Give the names of depositers having amount greater than 4000
[Name]
[Roll No.]
Give account date of the customer anil
Give the names of all branches located in the city Bombay
Give the name of the borrower having loanno 205
Give the names of depositers having account in vrce
[Name]
[Roll No.]
Give the names of all branches located in delhi
Give the names of all customers who have opened account
after date 1-dec-96
Give the account no. and deposit amount of all customers
having account opened between the dates 1-may-96 and 1-dec-
96
[Name]
[Roll No.]
Give the name of the city where branch karolbagh is located
Give details of customer anil
[Name]
[Roll No.]
AGGREGATE FUNCTIONS
LIST TOTAL LOAN
LIST TOTAL DEPOSIT
LIST TOTAL LOAN TAKEN FROM KAROLBAGH BRANCH
[Name]
[Roll No.]
LIST TOTAL DEPOSIT OF CUSTOMERS HAVING ACCOUNT DATE
LATER THAN 1-JAN-96
LIST TOTAL DEPOSIT OF CUSTOMERS LIVING IN NAGPUR
LIST MAX DEPOSIT OF CUSTOMERS LIVING IN BOMBAY
[Name]
[Roll No.]
LIST TOTAL DEPOSIT OF CUSTOMERS LIVING IN BRANCH CITY
DELHI
COUNT TOTAL NUMBER OF CUSTOMERS
COUNT TOTAL NUMBER OF BRANCH CITIES
GIVE MAX LOAN FROM BRANCH VRCE
[Name]
[Roll No.]
GIVE AVERAGE LOAN
GIVE AVERAGE DEPOSIT
[Name]
[Roll No.]
THE UPDATE STATEMENT
GIVE 10% INTEREST TO ALL DEPOSITERS
[Name]
[Roll No.]
GIVE 10% INTEREST TO ALL DEPOSITERS HAVING BRANCH VRCE
INCREASE LOAN AMOUNT BY 20%
[Name]
[Roll No.]
THE DELETE STATEMENT
DELETE DEPOSIT OF VIJAY
DELETE BORROWER HAVING BRANCH NAME CHANDINI
DELETE FROM CUSTOMERS
[Name]
[Roll No.]
DELETE DEPOSITERS HAVING DEPOSIT LESS THAN 5000
[Name]
[Roll No.]
ARITHEMATIC OPERATORS
[Name]
[Roll No.]
LOGICAL OPERATOR
[Name]
[Roll No.]
RANGE OPERATOR
[Name]
[Roll No.]
PATTERN MATCHING OPERATOR
[Name]
[Roll No.]
NUMERIC FUNCTIONS
[Name]
[Roll No.]
[Name]
[Roll No.]
STRING FUNCTIONS
[Name]
[Roll No.]
[Name]
[Roll No.]
CONSTRAINTS
[Name]
[Roll No.]
[Name]
[Roll No.]
JOIN
[Name]
[Roll No.]