Dbms-Program-2 Solution
Dbms-Program-2 Solution
Flights (no: integer, from: string, to: string, distance: integer, Departs: time, arrives: time,
price: real)
Note that the Employees relation describes pilots and other kinds of employees as well; Every
pilot is certified for some aircraft, and only pilots are certified to fly.
i. Find the names of aircraft such that all pilots certified to operate them have salaries
more than Rs.80, 000.
ii. Find the names of pilots whose salary is less than the price of the cheapest route from
Bengaluru to Frankfurt.
iii. Find the names of pilots certified for some Boeing aircraft.
iv. Find the aids of all aircraft that can be used on routes from Bengaluru to New Delhi.
PAGE-4
2020-21 19MCAL38 1NZ19MCA08
EID AID
203 400
200 403
203 403
201 404
201 402
204 401
200 401
203 402
204 400
PAGE-5
2020-21 19MCAL38 1NZ19MCA08
1 Find the names of aircraft such that all pilots certified to operate them have salaries more
than Rs.80, 000
select aname from aircraft where aid in(select c.aid from certified c, employees e where c.eid=e.eid
and e.salary>80000)
ANAME
Kingfisher
Spicejet
2 Find the names of pilots whose salary is less than the price of the cheapest route from
Bengaluru to Frankfurt
select distinct e.ename from employees e,certified c where e.eid=c.eid and salary<(select
min(price)from flights where from1 like 'bangalore' and to1 like'frankfurt')
ENAME
Tomas
select distinct ename from employees e,certified c,aircraft a where c.eid=e.eid and a.aid=c.aid and
aname='boeing';
ENAME
John
Jill
Tomas
4 Find the aids of all aircraft that can be used on routes from Bengaluru to New Delhi.
AID
400
401
402
403
404
PAGE-6