Which SQL clause filters rows in a dataset?
WHERE clause
What does the SELECT clause do in SQL?
Specifies which columns to return
Which SQL clause limits results to only rows meeting certain conditions?
WHERE
What SQL clause would you use to find customers who purchased in the last month?
WHERE
Which naming convention is SQL best practice?
lowercase or snake_case
Why is snake_case preferred in SQL?
It improves readability and avoids case-sensitivity issues
What is camelCase commonly used for?
Programming variables, not SQL column names
What type of case is ‘WebTrafficAnalytics’?
Camel case
What can be removed from a SQL query without breaking it?
Backticks around identifiers
When should backticks be used in SQL?
Only if names contain spaces, special characters, or reserved keywords
What does SELECT * mean?
Return all columns in a table
Why avoid SELECT * in production queries?
It reduces efficiency and can expose unnecessary data
How can you filter data for the last month?
Use WHERE with a date function like DATE_SUB
What’s the difference between WHERE and HAVING?
WHERE filters rows before aggregation; HAVING filters after
Which clause defines columns returned?
SELECT
What does the FROM clause specify in SQL?
The table from which to retrieve data.
What is the purpose of the WHERE clause?
To filter rows that meet specific conditions.
What mistake occurs if you write FROM Grade instead of FROM Students?
You are trying to select from a column, not a table.
Which SQL statement returns only elementary school students?
SELECT * FROM Students WHERE Grade = ‘elementary’;
What does SELECT * mean?
Return all columns from the specified table.
How do you filter results where Grade equals ‘elementary’?
Use WHERE Grade = ‘elementary’;
Why must ‘elementary’ be in quotes?
Because it is a text string (not a numeric or column name).
What happens if you omit the WHERE condition?
All rows in the table are returned.
What is the correct order of SQL clauses?
SELECT → FROM → WHERE