SQL for Data Analytics · Joining tables
Joining tables
So far, every query you've written has pulled from one table. But Northwind keeps its information in separate tables that point at each other. An order has a CustomerID, and the customer's name and country are stored in the Customers table. A JOIN brings those tables back together in a query, so you can see an order and the name of the customer who placed it in the same row. Most real questions need information from more than one table, so you'll be writing joins for the rest of the course.
The lessons:
- Table Relationships (13 min). How tables point at each other, and the kinds of relationships between them.
- Table JOINs (15 min). Writing a JOIN, and what it does to the rows.
- Multiple Table JOINs (17 min). Joining three, four, or five tables, and what one row is after each join.
- LEFT JOIN (20 min). There's no video for this one. Keeping the rows a JOIN leaves out, and handling the NULLs that come with them.
When you've finished the lessons, do the Practice. It's fifteen questions in two parts: ten queries to write, then five questions where you use queries to answer something. This is what you turn in on Canvas.