Lessons
Pick a track. Lessons go from first steps to job-ready skills.
Query a live database: filter, join, aggregate.
0 / 30 completed
3 free lessons left. Pick any lesson in any track.
Basics
- 1SELECT: read from a tablePick the columns you need from a table.
- 2WHERE: keep only the rows you needFilter rows by text and number conditions.
- 3DISTINCT: remove duplicatesList each value once and count how many different values a column has.
- 4Calculated columns, AS and ROUNDDo arithmetic in SELECT, name the result and round it.
Filtering
Sorting
Aggregates
Joins
Shaping data
- 14CASE WHEN, computed columns and aliasesCalculate new columns and sort values into bands.
- 15Text functionsChange case, measure, cut, join and replace text.
- 16Date functionsTake the year or month out of a date, shift a date and count the days between two dates.
- 17COALESCE, IFNULL and NULLIFReplace NULL with a value you choose, or turn a value into NULL.
Combining tables
- 18Joining three tables for reportsJoin orders, customers and products, then total revenue by category or country.
- 19Self join: a table joined to itselfCompare rows of one table with each other: employees and managers, colleagues, levels.
- 20UNION, INTERSECT and EXCEPTStack the results of two queries, or keep only their common or differing rows.
Reports
Advanced
Window functions
- 25ROW_NUMBER, RANK and DENSE_RANKNumber and rank rows without collapsing them.
- 26PARTITION BY: windows per groupRank inside each group and compare every row with its group.
- 27Running totals and moving averagesAccumulate values row by row and measure each row's share of the total.
- 28LAG and LEAD: compare with the neighbouring rowRead the previous or next row to calculate changes over time.