Department of Computer Engineering
Department of Computer Engineering
Assignment –1
Deposit (Actno, Cname, Bname, Amount, Adate)
Branch(Bname, City)
Customer(Cname, City)
Borrow(Loan_no, Cname, Bname, Amount)
1. List all the depositors along with their branch name and amount living in city
Nagpur.
Query:- select bname,amount from deposit where bname=(select bname from branch where
city='bhopal';
Output:-
2.List the branch cities of Aditya and Shivani who are depositors.
Query:-select city from branch where bname IN (select bname from deposit where
cname='Aditya' or cname='Shivani';
Output:-
3.List the customer having deposit greater than 1000 and loan less than 10000.
Query:- select cname from deposit where amount >1000 and bname IN (select bname from
borrow where amount <10000);
Output:-
Query:- select city from branch where bname=(select bname from deposit where
bname='SGSITS';
Output:-
Output:-
Output:-
Output:-
Query:- select city from branch Group by city having (count(distinct bname)=1);
Output:-
10.List maximum deposit of customer living in Bhopal.
Query:- select max(amount) from deposit where cname IN (select cname from
customer where city='bhopal');
Output:-
Output:-
Output:-
13. Give city name and citywise deposit.
Output:-
Output:-
Output:-
16.List branch name having no. of customers who are taking loan is greater than
two.
Output:-
17.List the names of customers having deposit in the branches where the
average deposit is more than 5000.
Output:-
Output:-
19.List branchname having total number of borrower greater than 4.
Output:-
Output:-
21. Give 10% interest to all depositors living in Gwalior and branch city is Pune.
Query:-select 1.1*amount AS new amount from deposit where bname IN (select bname
from branch where city IN('gwalior','pune');
Output:-
22.List total deposit of customer having account date later than 1-jan-2014.
Query:-select cname,amount from deposit where adate>'2014-01-01';
Output:
24.List all depositors having deposit in all the branches where avinash is having
account.
Query:- select cname from deposit where bname IN (select bname from deposit where
cname='avinash';
Output:-
25.Change the deposit of “ABC” branch to 1000 and change the branch as
“XYZ”.
Output:- cname