Google Sheets Test Google Sheets Data Sorting and Filtering 3 — Questions and Answers
Question 1: Which QUERY clause is used to filter rows based on a condition?
- WHERE (Correct answer)
- SELECT
- ORDER BY
- LABEL
Correct answer: WHERE
In the Google Visualization query language, WHERE restricts which rows are returned.
Question 2: In QUERY, which clause sorts the returned results?
- ORDER BY (Correct answer)
- GROUP BY
- PIVOT
- WHERE
Correct answer: ORDER BY
ORDER BY defines the sort column and direction (ASC or DESC) for QUERY output.
Question 3: How does QUERY refer to spreadsheet columns in its query string?
- By column letters like A, B, C (Correct answer)
- By header names in quotes
- By zero-based index numbers
- By named ranges only
Correct answer: By column letters like A, B, C
QUERY uses the spreadsheet column letters (Col1 only when the range is an array without letters).
Question 4: What does QUERY(A:C, "SELECT A, B WHERE C > 100") return?
- Columns A and B for rows where C exceeds 100 (Correct answer)
- All columns sorted by C
- Only column C values over 100
- A count of rows over 100
Correct answer: Columns A and B for rows where C exceeds 100
SELECT A, B picks those two columns and WHERE C > 100 keeps only rows whose column C is greater than 100.
Question 5: In a QUERY WHERE clause, how should a text value be enclosed?
- In single quotes, e.g. WHERE B = 'Active' (Correct answer)
- In double quotes inside the string
- In backticks
- No quotes are needed
Correct answer: In single quotes, e.g. WHERE B = 'Active'
Text literals inside the query string are wrapped in single quotes so they don't clash with the outer double quotes.
Question 6: Which keyword after ORDER BY sorts results from highest to lowest?
- DESC (Correct answer)
- ASC
- TOP
- REVERSE
Correct answer: DESC
DESC produces a descending sort; ASC (the default) produces ascending.
Question 7: What advantage does QUERY have over a basic filter for regularly updated data?
- It recalculates automatically as source data changes (Correct answer)
- It permanently deletes non-matching rows
- It works only on static data
- It disables editing of the source
Correct answer: It recalculates automatically as source data changes
QUERY is a live formula, so its output updates automatically whenever the referenced source data changes.
Which QUERY clause is used to filter rows based on a condition?