My problem is that I have to rewrite the following query using COUNT and GROUP BY and get the same results. The Query lists the name of customers in a database such that all parts they buy are made by suppliers in "Germany"
the query goes as:
SELECT C_NAME
FROM CUSTOMER
WHERE NOT EXISTS (SELECT L_PARTKEY
FROM ORDER LINEITEM PARTSUPP SUPPLIER
WHERE O_CUSTKEY = C_CUSTKEY
AND O_ORDERKEY = L_ORDERKEY
AND L_PARTKEY = PS_PARTKEY
AND PS_SUPKEY = S_SUPKEY
AND S_NATIONKEY NOT IN (SELECT N_NATIONKEY
FROM NATION
WHERE _NAME = ``GERMANY''))
please any help how to rewrite the above using COUNT and GROUP BY will VERYVERY appreciate Thanks