A. It checks that order_id is unique and order_date has no null values
B. It checks that order_id has no null values and order_date is unique
C. It checks that both order_id and order_date are unique
D. It checks that both order_id and order_date have no null values
Solution
Step 1: Read the test types for each column
The test unique applies to order_id, ensuring no duplicates. The test not_null applies to order_date, ensuring no missing values.
Step 2: Match tests to their meaning
unique means no duplicates; not_null means no nulls. So the checks are: order_id is unique and order_date has no null values.
Final Answer:
It checks that order_id is unique and order_date has no null values -> Option A
Quick Check:
unique = no duplicates, not_null = no nulls [OK]
Hint: unique = no duplicates, not_null = no nulls [OK]
Common Mistakes:
Mixing up unique and not_null tests
Assuming both columns have the same test
Ignoring the column_name key in test definitions
4. You run dbt test but get an error: Compilation Error: Could not find test 'uniquee'. What is the likely cause?
medium
A. The test passed with no errors
B. The model name is incorrect
C. The database connection is missing
D. A typo in the test name in schema.yml
Solution
Step 1: Analyze the error message
The error says it cannot find test 'uniquee', which looks like a misspelled test name.
Step 2: Identify common causes of compilation errors
Typos in test names in schema.yml cause dbt to fail to find the test. Model name or connection errors produce different messages.
Final Answer:
A typo in the test name in schema.yml -> Option D
Quick Check:
Compilation errors often mean typos [OK]
Hint: Check spelling of test names in schema.yml [OK]
Common Mistakes:
Ignoring typo errors and rerunning blindly
Assuming connection issues cause compilation errors
Confusing model name errors with test name errors
5. You want to ensure that the email column in your users model is unique and not null. You also want to run tests only on this model. Which schema.yml snippet and command combination is correct?