Complete the code to define a basic test that checks if a column has no null values.
version: 2 models: - name: customers columns: - name: email tests: - [1]
The not_null test ensures that the column has no missing values, which is a basic data quality check.
Complete the code to add a test that checks if values in the 'status' column are within allowed values.
version: 2 models: - name: orders columns: - name: status tests: - accepted_values: values: [1]
The accepted_values test checks that the 'status' column only contains the specified list of allowed values.
Fix the error in the test definition that checks for unique values in the 'user_id' column.
version: 2 models: - name: sessions columns: - name: user_id tests: - [1]
The unique test ensures that each 'user_id' appears only once, which is important for identifying distinct users.
Fill both blanks to create a test that checks if 'order_id' in 'orders' model exists in 'order_details' model.
version: 2 models: - name: orders columns: - name: order_id tests: - [1]: to: [2]
The relationships test checks foreign key constraints. Here, it verifies that 'order_id' in 'orders' exists in 'order_details'.
Fill all three blanks to define a custom test that checks if the 'age' column values are greater than 18.
version: 2 models: - name: users tests: - name: age_check test: "select * from [1] where [2] [3] 18"
This custom test selects rows where age <= 18 from the users model. The test passes only if zero rows are returned, ensuring all ages are greater than 18.