Reading Data for SQLs
Reading data in SQL means retrieving rows from tables with SELECT. You choose columns, filter rows with WHERE, sort with ORDER BY and limit output, then shape values using functions and expressions such as string, date and CASE logic. It is the first skill in SQL, because every report and analysis begins with a query.
Stage: Query Basics · Part of the SQL roadmap · Last reviewed 19 November 2026
What to learn in Reading Data
- Select specific columns and rename them with aliases
- Filter rows using WHERE with AND, OR, IN, BETWEEN and LIKE
- Sort results with ORDER BY and restrict them with LIMIT or FETCH
- Handle NULL correctly using IS NULL and COALESCE
- Build conditional columns with CASE expressions
Reading Data interview questions
Why does WHERE column = NULL return no rows?
NULL means an unknown value, and any comparison with it using = evaluates to unknown, not true, so the row is filtered out. You must write IS NULL or IS NOT NULL. This three-valued logic also means NOT IN can misbehave when the list contains NULL.
Can you use an aggregate function in WHERE, and what do you use instead?
WHERE filters individual rows before grouping happens, while HAVING filters groups after aggregation, so it can use aggregate functions such as COUNT or SUM. Put row-level conditions in WHERE for efficiency, and use HAVING only for conditions on aggregated results. HAVING handles aggregates.
Where Reading Data fits in the SQL roadmap
Reading Data belongs to the Query Basics stage (beginner level), which takes about 18 hours. Ask the database questions.