If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

the customer table is missing from the code section...customer table isnt mentioned anywhere in code?

Why would it need to be? Your query specifies to find products that haven't been bought by customers. Since customers doesn't have any direct relationship to product, there's no need to include the customers table as anything not bought will not have a reference within the sales table.
So all you need to find is anything within the product table that has no related record within sales. Since the product has never been sold, there is no reason to collect any Customer information from it.

This is clearly homework as well, so he really shouldn't have given you the answer to the third one. The first two are simply aggregates and groups.

This is also access, which is. . . not great SQL wise. MySQL code will not run properly within it for two reasons: the functions are different for anything proprietary, and Access is incredibly easy to confuse if you start joining more than two tables together.
So this belongs in the other databases section.

PHP Code:

header('HTTP/1.1 420 Enhance Your Calm');

Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

Probably the LEFT JOIN answer is beyond where he is in the class or book, anyway.

Probably the instructor is expecting him to use a NOT IN( ) clause at this stage in the class.

That's one of the problems with giving answers to homework - the answer will almost certainly include code that is well beyond that so far covered in the course. Of course that makes it far easier for the teacher to tell who cheated since anyone using code that is beyond where they are in class would need to be able to explain exactly how that code works in order to prove that they really are ahead of the class and if they can't then it will be obvious they cheated. Most likely the teacher already knows who is ahead anyway and so wouldn't even need to ask.