Bird
0
0

Which of the following is the correct syntax to perform a full outer join in dbt's SQL model?

easy📝 Syntax Q12 of 15
dbt - Advanced Patterns

Which of the following is the correct syntax to perform a full outer join in dbt's SQL model?

SELECT * FROM source_a a
FULL OUTER JOIN source_b b
ON a.id = b.id
ASELECT * FROM source_a a FULL OUTER JOIN source_b b ON a.id = b.id
BSELECT * FROM source_a a INNER JOIN source_b b ON a.id = b.id
CSELECT * FROM source_a a LEFT JOIN source_b b ON a.id = b.id
DSELECT * FROM source_a a CROSS JOIN source_b b
Step-by-Step Solution
Solution:
  1. Step 1: Identify the join type needed for fan-in

    Multi-source fan-in requires a full outer join to keep all records from both sources.
  2. Step 2: Match the syntax for full outer join

    The correct syntax is FULL OUTER JOIN with the join condition.
  3. Final Answer:

    SELECT * FROM source_a a FULL OUTER JOIN source_b b ON a.id = b.id -> Option A
  4. Quick Check:

    Full outer join syntax = SELECT * FROM source_a a FULL OUTER JOIN source_b b ON a.id = b.id [OK]
Quick Trick: Full outer join keeps all rows from both tables [OK]
Common Mistakes:
MISTAKES
  • Using INNER JOIN which drops unmatched rows
  • Using LEFT JOIN which keeps only left table rows
  • Using CROSS JOIN which creates Cartesian product

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes