Skip to main content

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

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.

Back to the full SQL roadmap