Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

132 page-3.

1
a)select * from course
where dept_name = 'Computer Science'
and credits = 3;
b)select distinct takes.ID
from instructor, teaches,takes
where instructor.ID= teaches.ID
and teaches.semester =takes.semester
and teaches.year = takes.year
and teaches.sec_id = takes.sec_id
and instructor.name= 'Einstein';
c)select max(salary) from instructor;
d)select * from instructor
where salary =
(select max(salary) from instructor);
e)select *
from section S, takes T
where S.semester = T.semester
and S.year = T.year
and S.sec_id = T.sec_id
and S.semester= 'spring'
and S.year = 2009;
f)select max(KOUNT) from
(
select count(T.ID) KOUNT, S.sec_id
from section S, takes T
where S.semester = T.semester
and S.year = T.year
and S.sec_id = T.sec_id
and S.semester= 'spring'
and S.year = 2009
group by S.sec_id) F
;
g)select count(S.sec_id), T.sec_id
from section S,takes T
where S.sec_id= T.sec_id
and S.semester= T.semester
and S.year =T.year
and T.semester= 'spring'
and T.year= 2009
group by T.sec_id;

You might also like