SQL for Absolute Beginners
Write your very first SQL queries with confidence. Every problem here teaches one keyword — SELECT, WHERE, ORDER BY, LIKE, IN, LIMIT, GROUP BY. No joins, no subqueries, just pure SQL fundamentals.
SELECT + WHERE with two conditions (AND / OR) — your very first query. Read a table, filter rows, return columns.
WHERE with AND on two columns — combining multiple filter conditions in a single query.
WHERE + ORDER BY — filter rows then sort the result. Two of the most used clauses together.
WHERE with IS NULL and <> — handling NULL values correctly. NULLs behave differently from empty strings.
ORDER BY multiple columns — primary sort key and secondary sort key. Multi-column ordering syntax.
ORDER BY DESC + LIMIT — get the top N rows. The most common pattern in leaderboard and ranking queries.
WHERE with a numeric comparison — filter rows where a number column is below a threshold.
WHERE with >= on a value column — filtering on amount thresholds, the basis of every business rule query.
WHERE with BETWEEN on dates — date range filtering. BETWEEN is inclusive on both ends.
WHERE with date function — YEAR(hire_date) or date_trunc(). Extracting parts of a date column.
WHERE column IN (...) — filter against a list of values. Cleaner than writing multiple OR conditions.
WHERE column LIKE '%pattern' — wildcard string matching. % matches any sequence of characters.
WHERE LIKE with % on both sides — search for a substring anywhere in a column value.
SELECT with CONCAT() or || operator — building a new column by combining two string columns.
SELECT with arithmetic — multiply a column by a constant. Derived columns with expressions in SELECT.
SELECT column * expression — apply a percentage discount. Arithmetic on column values in SELECT.
SELECT DISTINCT — remove duplicate rows from results. The SQL equivalent of a set operation.
GROUP BY + COUNT(*) — your first aggregation. Group rows and count how many fall in each bucket.
GROUP BY + SUM() — aggregate a numeric column per group. The foundation of every reporting query.
GROUP BY + HAVING COUNT > 1 — filter groups after aggregation. HAVING is to groups what WHERE is to rows.