Bird
0
0

What does a LEFT JOIN do in PostgreSQL?

easy📝 Conceptual Q11 of 15
PostgreSQL - Joins in PostgreSQL
What does a LEFT JOIN do in PostgreSQL?
AReturns all rows from the left table and matching rows from the right table, or NULL if no match.
BReturns all rows from the right table and matching rows from the left table, or NULL if no match.
CReturns only rows that have matching values in both tables.
DReturns all rows from both tables, matching where possible.
Step-by-Step Solution
Solution:
  1. Step 1: Understand LEFT JOIN behavior

    A LEFT JOIN returns all rows from the left table regardless of matches in the right table.
  2. Step 2: Check what happens with unmatched rows

    If there is no matching row in the right table, the result includes NULLs for right table columns.
  3. Final Answer:

    Returns all rows from the left table and matching rows from the right table, or NULL if no match. -> Option A
  4. Quick Check:

    LEFT JOIN = all left rows + matched right rows [OK]
Quick Trick: LEFT JOIN keeps all left rows, fills right with NULL if no match [OK]
Common Mistakes:
  • Confusing LEFT JOIN with RIGHT JOIN
  • Thinking LEFT JOIN returns only matched rows
  • Assuming unmatched rows are dropped

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes