Course 3 of 7 · 13 lessons · Free

SQL for Data Analysis

Query, join and summarise data in relational databases, from first SELECT to window functions.

Comes after: Power BI Mastery

  1. What Is SQL? Your First SELECTLearn how relational databases store data in tables, meet the sample database and write your first queries.
  2. Filtering Rows with WHEREKeep only the rows you need using comparisons, AND, OR, IN, BETWEEN, LIKE and correct handling of NULL.
  3. Sorting, Limiting and DISTINCTOrder results, take the top rows, page through data and remove duplicate values.
  4. Aggregate Functions and GROUP BYSummarise data with COUNT, SUM and AVG, group it by category and filter the groups with HAVING.
  5. Joining Tables with INNER JOINCombine rows from related tables on a shared key, the single most important skill in SQL.
  6. LEFT JOIN, Self Joins and Finding Missing DataKeep rows that have no match, find customers with no orders and join a table to itself.
  7. SubqueriesUse the result of one query inside another: in WHERE, in FROM and row by row with correlated subqueries.
  8. Common Table Expressions (WITH)Break a long query into named, readable steps, and generate sequences with a recursive CTE.
  9. CASE Expressions and Built-in FunctionsAdd conditional logic to a query and work with text, numbers, dates and missing values.
  10. Window FunctionsRank rows, calculate running totals and compare each row with the previous one, without collapsing the rows.
  11. Creating Tables and Changing DataDefine tables with the right types and constraints, then insert, update and delete rows safely inside transactions.
  12. Indexes and Query PerformanceUnderstand why some queries are slow, how an index speeds them up and how to read a query plan.
  13. Project: Analyse a Shop Database with SQLAnswer eight real business questions with the skills from this course, each harder than the last.