select A.authorid, A.aname, A.acity, sum(O. qty) as QTY_SUM from Author A, CATALOGUE C, Order_Det O where A.authorid = C.authorid and C.bookid = O.bookid group by A.authorid, A.aname, A.acity, C.bookid
having sum(O.qty) >= all (select sum(qty) from Order_Det group by bookid)

update CATALOGUE set price = price * 1.1 where publisherid in (select publisherid from publisher where pname ='Pearson')

SELECT COUNT(ordno) AS COUNT, bookid FROM ORDER_DET WHERE bookid IN
(SELECT bookid FROM ORDER_Det group by bookid
HAVING SUM(qty) <=ALL( SELECT SUM(qty) FROM ORDER_DET GROUP BY bookid) GROUP BY bookid

Edit

Pub: 12 Jan 2022 05:21 UTC

Views: 217