- Explain the order & structure of join statements
- Write basic SQL joins:
one-to-many
- INNER join
- LEFT join
- FULL OUTER join
- Write basic SQL joins that only select certain fields
- INNER join
- LEFT join
- Create a database called joins
- Connect to joins database using psql
- Run joins.sql file while connected to db:
\i joins.sql
INNER JOIN going from 'owner' to 'pet'
SELECT * FROM owner INNER JOIN pet ON pet.owner_id = owner.id;
LEFT JOIN
SELECT * FROM owner LEFT JOIN pet ON pet.owner_id = owner.id;