select C.custname as CUSTOMERNAME, count(O.orderid) as NOOFORDER, avg(O.ordamt) as AverageAmount from CUSTOMER C, C_ORDER O
where C.custid = O.custid group by C. custname

select itemid,count(),sum(qty) from ORDER_ITEM where orderid in
(select orderid from SHIPMENT group by orderid having count(
) >=2) group by itemid having count(*) >=2

select C.custname from CUSTOMER C where NOT EXISTS
(
(select itemid from ITEM)
EXCEPT
(select distinct(OI.itemid) from C_ORDER O,ORDER_ITEM OI where O.orderid = OI.orderid and O.custid = C.custid )
)

Edit

Pub: 12 Jan 2022 04:16 UTC

Views: 229