Bird
0
0

Given the following dbt model SQL snippet, what will be the value of status for a row where score = 75?

medium📝 Predict Output Q13 of 15
dbt - Jinja in dbt
Given the following dbt model SQL snippet, what will be the value of status for a row where score = 75?
SELECT
  score,
  CASE
    WHEN score >= 90 THEN 'Excellent'
    WHEN score >= 70 THEN 'Good'
    ELSE 'Average'
  END AS status
FROM scores_table
A'Good'
BNULL
C'Average'
D'Excellent'
Step-by-Step Solution
Solution:
  1. Step 1: Check conditions in order for score = 75

    First condition: score >= 90? No (75 < 90). Second condition: score >= 70? Yes (75 >= 70).
  2. Step 2: Determine which condition applies first

    The first true condition is WHEN score >= 70 THEN 'Good', so status = 'Good'.
  3. Final Answer:

    'Good' -> Option A
  4. Quick Check:

    75 >= 70 = 'Good' [OK]
Quick Trick: Check CASE conditions top to bottom [OK]
Common Mistakes:
MISTAKES
  • Ignoring order of CASE conditions
  • Choosing 'Excellent' incorrectly
  • Assuming ELSE applies before WHEN

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes