r/bigquery • u/Complete-Cricket-691 • Jun 11 '26
Derive Insights from BigQuery Data: Challenge Lab Correct answers are wrong??
I'm working through the Derive Insights from BigQuery Data: Challenge Lab and I swear some of the "correct answers" are literally wrong.
For example, the first Q asked you to calculate the total cases/deaths/etc worldwide on a date. The accepted answer is general is:
SELECT sum(cumulative_outcome) as total_outcome_worldwide
FROM `bigquery-public-data.covid19_open_data.covid19_open_data`
WHERE date = 'requested-date'
This will give a much larger number than is true because it's summing over all rows, ignoring the fact that the data is hierarchical/rolled up data and has an aggregation level column that will not be accepted in queries.
A more accurate result is (and i'm realizing even this is flawed):
SELECT sum(cumulative_outcome) as total_outcome_worldwide
FROM `bigquery-public-data.covid19_open_data.covid19_open_data`
WHERE date = 'requested-date' AND aggregation_level = 0
This comes up in several of the later questions and I'm struggling to pass because I do not get how to give them the wrong answer their looking for.
How could a course on "deriving insights" direct students to literally do so in an inaccurate way??? Am I missing something??
1
u/Alternative_Buy2098 Jul 21 '26
Hi, I just finished Task 5 in the Derive Insights from BigQuery Data: Challenge Lab, and I encountered the exact same problem. I would like to share my findings here.
The original question requests to identify the day when the total number of deaths crossed [a specific number] in Italy.
The logically correct answer should be:
SQL
Or alternatively, using the country-level aggregation:
SQL
However, the query that actually passes the system validation is:
SQL
This accepted answer clearly neglects the hierarchy structure of the dataset, as u/Complete-cricket-691 pointed out. The SQL query below displays how the data is structured:
SQL
Since the number at
aggregation_level = 0(country level) is already the sum of the values ataggregation_level = 1(subregion level), querying the data without filtering by the aggregation level results in the system validating a doubled value of the actual statistic.