select distinct(T.bookISBN), T.booktitle, C.courseno, C.cname
from TEXTBOOK T, COURSE C, BOOK_ADOPTION BA
where T.bookISBN = BA.bookISBN and C.courseno=BA.courseno
and C.dept='cs' and C.courseno
IN (select courseno from BOOK_ADOPTION group by courseno having count(*)>=2) order by T.booktitle
select distinct(C.dept) from COURSE C where
NOT EXISTS
(
(select bookISBN from BOOK_ADOPTION where courseno in
(select courseno from COURSE where dept = C.dept) )
EXCEPT
(select bookISBN from TEXTBOOK where publisher='McGraw')
)
select distinct T.bookISBN, T.booktitle ,C.dept
from TEXTBOOK T, BOOK_ADOPTION BA, COURSE C
where T.bookISBN = BA.bookISBN and C.courseno = BA.courseno and C.dept
in (select C.dept from COURSE C, ENROLL E where C.courseno = E.courseno
group by C.dept having count() >= all
(select count() from
COURSE C, ENROLL E where
C.courseno = E.courseno
group by C.dept))