Thursday, 27 August 2026

MCQ on JOIN

Amazon SQL Interview: Joins

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.

SELECT c.customer_name, o.order_id FROM customers c JOIN orders o ON c.customer_id = o.customer_id;
Amazon interview tip: Always clarify whether unmatched rows should be retained. That determines whether you need an inner join, left join, right join, or full outer join.
Most common

INNER JOIN

Returns only rows with matching values in both tables.

FROM A INNER JOIN B ON A.key = B.key;
Frequently tested

LEFT JOIN

Returns every row from the left table and matching rows from the right table.

FROM A LEFT JOIN B ON A.key = B.key;
Less common

RIGHT JOIN

Returns every row from the right table and matching rows from the left table.

FROM A RIGHT JOIN B ON A.key = B.key;
Dialect dependent

FULL OUTER JOIN

Returns all rows from both tables. Unmatched columns contain NULL.

FROM A FULL OUTER JOIN B ON A.key = B.key;
Special purpose

CROSS JOIN

Returns the Cartesian product: every row in A paired with every row in B.

FROM A CROSS JOIN B;
Hierarchy and relationships

SELF JOIN

Joins a table to itself using different aliases.

FROM employees e JOIN employees m ON e.manager_id = m.employee_id;

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

1. Which join returns only matching rows from both tables?



2. Which join is best for finding customers who have no orders?



3. If table A has 4 rows and table B has 3 rows, how many rows can a CROSS JOIN produce?



4. What is a common cause of duplicate rows after a join?



5. What can unintentionally turn a LEFT JOIN into an INNER JOIN?




SQL interview practice: focus on row preservation, NULL behavior, cardinality, and join-key uniqueness.

Contact for Enquiry

Name

Email *

Message *