Joining Multiple Tables Flashcards
7 cards from real SQL practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Joining Multiple Tables flashcards as text
Which join returns only rows that have matching values in both tables?
Answer: INNER JOIN
INNER JOIN returns only the rows where the join condition matches in both tables.
A LEFT JOIN between Customers and Orders returns customers with no orders. What appears in the Orders columns for those rows?
Answer: NULL
Unmatched rows from the right table produce NULL values in the result.
Which clause is used to specify the matching condition in a join?
Answer: ON
The ON clause specifies the condition that links the joined tables.
What does a CROSS JOIN produce?
Answer: The Cartesian product of both tables
A CROSS JOIN pairs every row of the first table with every row of the second.
Which keyword lets you join a table to itself?
Answer: Use table aliases
A self join references the same table twice using different aliases.
In 'SELECT * FROM A JOIN B USING (id)', what does USING require?
Answer: A column named id in both tables
USING joins on a column that exists with the same name in both tables.
Which join returns all rows from both tables, matched where possible and NULL-filled otherwise?
Answer: FULL OUTER JOIN
FULL OUTER JOIN combines LEFT and RIGHT joins, keeping all rows from both sides.