You are on page 1of 5

SCHOOL OF INFORMATION TECHNOLOGY AND ENGINEERING (SITE)

WINTER SEMESTER 2020-21


M.TECH (SE)
SWE1004 – Database Management System

Faculty: JAYARAM REDDY A


Slot: L51+L52

CAT-2

Submitted by:
PRATHAP M (18MIS0299)
1.Create tables identifying the primary keys and foreign keys
2. Insert required rows to each table.
a) select tno from train_18MIS0299 where source='katpadi' and destination='pune';
b) select pnrno from PASSENGER_18MIS0299 where (select count(*) from Passenger
where pnrno=?)>5;

d) select tno from Stops_at_18MIS0299 where TIMESTAMPDIFF


(MINUTES,arr_time,dep_time)>10;
e) select p.name,p.age,p.seat_type,p.seat_no,tk.total_fare,t.name from
PASSENGER_18MIS0299 as p inner join TICKET_18MIS0299 as tk on p.pnrno=tk pnrno
inner join Train as t on tk.tno=t.no;
5. Write a PL/SQL program check whether the sum of a given number is divisible by 3

You might also like