Instruction
Alright! Let's summarize everything we learned in this part.
- We don't have to join tables on the primary-foreign key relationship. It is possible to use any two columns:
SELECT buyer.name, car.name FROM buyer JOIN car ON buyer.preferred_car_type = car.type
The query above will show the name of every buyer together with every car that matches their preferred type. - We also don't have to use the equality operator when joining tables. We are free to use other comparison operators (
<,>,<=,>=,!=,<>) or theBETWEENoperator:SELECT auctioneer.name, item.name FROM auctioneer JOIN item ON auctioneer.funds > item.price
- We can write a special kind of
JOINto list items within a certain range (for example, within a budget), all pairs of items, or all unique pairs.
Exercise
Click the button to continue.



