Challenge - 5 Problems
WHERE Clause Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
Filtering rows with WHERE clause in Google Sheets QUERY
Given a sheet named 'Sales' with columns Date, Product, and Amount, which QUERY formula filters rows where Amount is greater than 100?
Google Sheets
QUERY(Sales!A:C, "SELECT A, B, C WHERE C > 100", 1)
Attempts:
2 left
💡 Hint
Remember that column letters in QUERY use letters like A, B, C, not column names.
✗ Incorrect
In Google Sheets QUERY, you filter by column letters, not column headers. So 'WHERE C > 100' filters rows where the third column (Amount) is greater than 100.
🔧 Formula Fix
intermediate2:00remaining
Identify the syntax error in this QUERY with WHERE clause
Which QUERY formula has a syntax error when filtering rows where Product equals 'Apple'?
Attempts:
2 left
💡 Hint
Check the operator used for equality in QUERY language.
✗ Incorrect
In QUERY language, the equality operator is a single '=' sign. Using '==' causes a syntax error.
❓ optimization
advanced2:00remaining
Optimizing QUERY with multiple WHERE conditions
Which QUERY formula efficiently filters rows where Amount is greater than 50 and Product is 'Banana'?
Attempts:
2 left
💡 Hint
Use AND to combine conditions and single '=' for equality.
✗ Incorrect
Option C correctly uses AND to combine conditions and uses single '=' with quotes around 'Banana'.
🔧 Formula Fix
advanced2:00remaining
Why does this QUERY return no rows?
Given the formula QUERY(Sales!A:C, "SELECT A, B, C WHERE C > 100 AND B = 'Orange'", 1), why might it return no rows even if data exists?
Attempts:
2 left
💡 Hint
Check if the data actually matches both conditions at the same time.
✗ Incorrect
If no rows satisfy both conditions simultaneously, QUERY returns no rows. The syntax and column references are correct.
🧠 Conceptual
expert2:00remaining
Understanding WHERE clause behavior with NULL or empty cells
In Google Sheets QUERY, what happens when you filter with WHERE C > 0 but some rows in column C are empty or contain text?
Attempts:
2 left
💡 Hint
Think about how QUERY treats non-numeric values in numeric comparisons.
✗ Incorrect
QUERY excludes rows where the condition cannot be evaluated as true, so empty or text cells in numeric comparisons are excluded.