View Single Post
Old 02-12-2013, 02:52 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by simon47 View Post
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.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote