In this lesson, we learned about relationships between tables in relational databases and how to query information from multiple tables using SQL.
Let’s summarize what we’ve learned so far:
JOINwill combine rows from different tables if the join condition is true.
LEFT JOINwill return every row in the left table, and if the join condition is not met,
NULLvalues are used to fill in the columns from the right table.
Primary key is a column that serves a unique identifier for the rows in the table.
Foreign key is a column that contains the primary key to another table.
CROSS JOINlets us combine all rows of one table with all rows of another table.
UNIONstacks one dataset on top of another.
WITHallows us to define one or more temporary tables that can be used in the final query.
Feel free to experiment a bit more with the
customers tables before moving on!