Bird
0
0

A dbt test is written as:

medium📝 Debug Q7 of 15
dbt - Advanced Testing
A dbt test is written as:
select * from {{ ref('orders') }} where customer_email not like '%@%'
But it returns no rows even though some emails are invalid. What is the most probable reason?
AThe invalid emails contain NULL values which are not matched by LIKE
BThe test syntax is incorrect and causes no results
CAll emails actually contain '@' so test is correct
DThe table reference {{ ref('orders') }} is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Understand LIKE behavior

    LIKE does not match NULL values; NULLs are excluded.
  2. Step 2: Identify issue

    Invalid emails might be NULL, so test returns no rows.
  3. Final Answer:

    The invalid emails contain NULL values which are not matched by LIKE -> Option A
  4. Quick Check:

    LIKE ignores NULLs, causing false negatives [OK]
Quick Trick: LIKE does not match NULL values [OK]
Common Mistakes:
MISTAKES
  • Assuming LIKE matches NULLs
  • Blaming syntax without checking data
  • Ignoring NULL presence in columns

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes