SQL Joins: Amazon Interview Prep
Learn join types, compare their results, and test your interview readiness.
What is a SQL join?
A join combines rows from two or more tables using a related column. The related columns do not need to have the same name, but they usually represent the same business concept.
INNER JOIN
Returns only rows with matching values in both tables.
LEFT JOIN
Returns every row from the left table and matching rows from the right table.
RIGHT JOIN
Returns every row from the right table and matching rows from the left table.
FULL OUTER JOIN
Returns all rows from both tables. Unmatched columns contain NULL.
CROSS JOIN
Returns the Cartesian product: every row in A paired with every row in B.
SELF JOIN
Joins a table to itself using different aliases.
Interactive Join Visualizer
Choose a join type to see which rows are returned.
Customers
| customer_id | customer_name |
|---|---|
| 1 | Ana |
| 2 | Ben |
| 3 | Chen |
| 4 | Dina |
Orders
| order_id | customer_id |
|---|---|
| 101 | 1 |
| 102 | 2 |
| 105 | 5 |
Returned rows
SQL Playground
Select a business question. The page shows the SQL pattern and the expected result.
Amazon-Style Interview Quiz
Score: 0 / 5