|
Posted by tizmagik on 04/13/07 23:58
Database consists of the following 4 tables with respective
attributes:
CUSTOMER(C#, CUSTOMER NAME, ADDRESS), the key is [C#]
ITEM(I#, ITEM NAME, MANUFACTURER, YEAR), the key is [I#]
BOUGHT(C#, I#, DATE, QUANTITY), the key is [C#, I#,DATE]
PREFER(I#, C#), the key is [I#, C#]
I'm trying to construct the following query (in SQL)
List of customers that bought all the items that John prefers.
I can get the list of all the items that John prefers, but I'm not
sure how to check that list against customers who bought ALL those
items. I'm assuming it's either a division or some sort of subtraction
but I'm not sure how to formulate the SQL query.
Any and all help is appreciated, thanks!
[Back to original message]
|