Couldn't find anything on this, using set-based operations. Not sure if I'm on the right track, but I have 2 guesses on how to do this, but I'm not sure if I'm even close, or if MINUS is the right set-based operation to use:
SELECT customerid
FROM customer
MINUS
SELECT orderid
FROM custorder
WHERE custorder IS NULL;
or
SELECT customerid
FROM customer
MINUS
SELECT orderid
FROM custorder;
Suggestions on how to improve or what to change? Any help is appreciated. Could someone also possibly explain when to use UNION, UNION ALL, or INTERSECT on a similar sample like this?
Also, I'm not sure if I need these in 2 different tables or not. In this database, 2 of these tables are CUSTOMER (has customerid) and CUSTORDER (has customerid and orderid). Here's a screenshot of the table values if you wanted to see: https://i.stack.imgur.com/BFvbB.jpg
NOTE: I HAVE TO USE SET-BASED OPERATIONS ONLY FOR FULL CREDIT
probably more like
you need to MINUS off the same type of values from the set