If I have three simple tables: mysql> select * from customer; +----+--------+ | ID | NAME | +----+--------+ | 1 | Joey | | 2 | Mike | | 3 | Kellie | +----+--------+ 3 rows in set (0.00 sec)
mysql> select * from fruit; +----+---------+ | ID | NAME | +----+---------+ | 1 | Apples | | 2 | Grapes | | 3 | Oranges | | 4 | Kiwis | +----+---------+ 4 rows in set (0.00 sec) mysql> select * from purchases; +----+---------+----------+ | ID | CUST_ID | FRUIT_ID | +----+---------+----------+---- | 2 | 3 | 2 | | 3 | 1 | 4 | | 4 | 1 | 2 | | 5 | 2 | 1 | +----+---------+----------+---- I am having trouble understanding a relational query. How can I select those fruits that Joey has not purchased?