Assignment 8:: Desc Branch - Ece - 3B - 64
Assignment 8:: Desc Branch - Ece - 3B - 64
desc branch_ece_3B_64;
desc customer_ece_3B_64;
desc loan_ece_3B_64;
desc borrower_ece_3B_64;
create table account_ece_3B_64(branch_name char(20) ,account_number number(20) primary key
,balance number(20));
desc account_ece_3B_64;
desc depositer_ece_3B_64;
A) Give the customer name who has an account but not any loan.
COMMANDS –
output:-
B)Give the name of the customer who has entire(100000-200000) or (300000-400000) in their account.
COMMANDS-
on d.customer_name = c.customer_name
on a.account_number = d.account_number
where a.balance between 100000 and 200000 or a.balance between 300000 and 400000;
output:-
C)Which branch has issued maximum amount of loan?
COMMANDS-
output:-
D)Give the name of the customer who has maximum balance in their account.
COMMANDS-
on d.customer_name = c.customer_name
on a.account_number = d.account_number
output:-
E) Give the name of the customer who has opened an account in a city in which he is not located.
COMMANDS-
on d.customer_name = c.customer_name
on a.account_number = d.account_number
on b.branch_name = a.branch_name
output:-
ASSIGNMENT 9:
desc CUSTOMER_3B_64;
desc TRUCK_3B_64;
desc CITY_3B_64;
desc PARTS_3B_64;
create table SHIPMENT_3B_64(ship_no number primary key,cust_id number references
CUSTOMER_3B_64(cust_id),weight number,truck_no number references TRUCK_3B_64(truck_no),p_no
number references PARTS_3B_64(p_no),start_city varchar(20) references
CITY_3B_64(city_name),destination_city varchar(20));
desc SHIPMENT_3B_64;
A)Give shipment number for which the population of start_city is greater than the
population of the destination_city.
COMMANDS—
select s.ship_no from SHIPMENT_3B_64 s left join city_3B_64 a on s.start_city=a.city_name left join
city_3B_64 b on s.destination_city =b.city_name where a.population > b.population;
B)Give the shipment number for which the annual_revenue of the customer is greater tha
120000,part color is red and population of both the start_city and destination_city is
more than 70000.
COMMANDS—
c )Give the count of the shipments for each driver where the weight is more tha 400.
COMMANDS—
COMMANDS—
select cust_name from CUSTOMER_3B_64 where cust_id=(select cust_id from SHIPMENT_3_64 group
by cust_id having count(ship_no)=(select max(count(ship_no))from SHIPMENT_3B_64 group by
cust_id));
COMMANDS—
select city_name from CITY_3B_64 where city_name NOT IN(select start_city from SHIPMENT_3B_64);
UNIVERSITY OF ENGINEERING & MANAGEMENT,
KOLKATA
____________________
Teacher’s signature