Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select all columns from the test failures table.
dbt
SELECT [1] FROM test_failures; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting only one column when all columns are needed.
Using incorrect column names.
✗ Incorrect
Using * selects all columns from the table.
2fill in blank
mediumComplete the code to filter test failures where the failure count is greater than 5.
dbt
SELECT * FROM test_failures WHERE failure_count [1] 5;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
< instead of >.Using
= which only matches exactly 5.✗ Incorrect
The operator > filters rows where failure_count is greater than 5.
3fill in blank
hardFix the error in the code to count failures grouped by test name.
dbt
SELECT test_name, COUNT([1]) FROM test_failures GROUP BY test_name; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Counting a column that may have NULLs.
Using
COUNT(test_name) which is redundant here.✗ Incorrect
Using COUNT(*) counts all rows per group.
4fill in blank
hardFill both blanks to create a dictionary of test names and their failure counts where count is greater than 10.
dbt
SELECT [1], [2] FROM test_failures WHERE failure_count > 10;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting columns unrelated to failure counts.
Forgetting to filter by failure count > 10.
✗ Incorrect
Selecting test_name and failure_count gives the test and its failure count.
5fill in blank
hardFill all three blanks to create a summary of failures grouped by test name and ordered by failure count descending.
dbt
SELECT [1], SUM([2]) AS total_failures FROM test_failures GROUP BY [3] ORDER BY total_failures DESC;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Grouping by wrong column.
Summing wrong column.
Not ordering results correctly.
✗ Incorrect
Grouping by test_name and summing failure_count gives total failures per test.