HomeInterview QuestionsWhat would be the output of a left join? Suppose t…

What would be the output of a left join? Suppose the master table is A and the other table is B. If we perform a left join, what would be the output?

🟡 Medium Conceptual Junior level
1Times asked
Jun 2026Last seen
Jun 2026First seen

💡 Model Answer

A left join (or left outer join) returns all rows from the left (master) table, and the matching rows from the right (joined) table. For each row in the left table, the database searches for rows in the right table that satisfy the join condition. If a match is found, the columns from both tables are combined into a single result row. If no match is found, the columns from the right table are filled with NULLs, but the left table’s row still appears in the result.

For example, if table A has rows (1, 'Alice'), (2, 'Bob'), (3, 'Carol') and table B has rows (1, 'NY'), (3, 'LA'), a left join on the first column would produce:

1, 'Alice', 'NY'

2, 'Bob', NULL

3, 'Carol', 'LA'

Thus, the output preserves all rows from A, with B’s data where available, and NULLs where there is no matching key in B.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.

Get Assisting AI — Starts at ₹500