Data ScienceBeginner

SQL for Data Analysis

Answer real questions straight from the database.

Taught by Niraj Thapa · Analytics Lead

What you'll learn

  • Retrieve and shape data with SELECT, WHERE, and ORDER BY against real tables
  • Summarize data using aggregate functions, GROUP BY, and HAVING to answer business questions
  • Combine multiple tables correctly with INNER, LEFT, and self JOINs without losing or duplicating rows
  • Break complex logic into readable steps using subqueries and common table expressions (CTEs)
  • Rank, compare, and compute running totals with window functions like ROW_NUMBER, RANK, and SUM OVER
  • Translate a vague stakeholder request into a correct, performant, and readable analytical query

About this course

Learn to turn raw tables into clear answers using nothing but SQL. This course walks you from your first SELECT to window functions and CTEs, teaching the analytical query patterns that real analysts use every day to measure growth, rank performance, and explain trends. By the end you will read a business question and write the correct, readable query that answers it.

Course content

9 lessons
  1. 1Reading Data: SELECT, FROM, and a Mental Model of TablesUnderstand how relational data is stored and write your first queries to pull exactly the columns and rows you want.Preview
  2. 2Filtering and Sorting: WHERE, Operators, and ORDER BYKeep only the rows that matter and present them in a meaningful order using comparison, logical, and pattern operators.Preview
  3. 3Summarizing Data: Aggregate Functions and GROUP BYCollapse many rows into one number per group to answer questions about totals, averages, and counts.
  4. 4Filtering Groups: HAVING vs WHEREFilter on aggregated results, and understand exactly why HAVING exists alongside WHERE.
  5. 5Combining Tables: INNER and LEFT JOINsBring related tables together on a key, and choose the join type that keeps the rows you actually need.
  6. 6Deeper Joins: Self Joins, Multi-Table Joins, and Avoiding Fan-OutChain several tables, join a table to itself, and protect your totals from accidental row duplication.
  7. 7Subqueries and CTEs: Breaking Complex Logic Into StepsUse subqueries and WITH clauses to compose readable, multi-step analyses instead of one tangled query.
  8. 8Window Functions: Ranking, Running Totals, and Period-over-PeriodCompute values across related rows without collapsing them, unlocking rankings, cumulative sums, and growth comparisons.
  9. 9Putting It Together: An Analytical Query PlaybookCombine every technique into correct, readable queries that answer real stakeholder questions, with a method and a cheat-sheet.