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 Owner.PreferredCarType = 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.



