Most of the numbers a business cares about – revenue by month, repeat customers, where people drop out of a signup flow – already sit in a database. SQL is how you get them out without waiting for an engineer or exporting everything to a spreadsheet. This course teaches SQL from the analyst's side of the desk: you read tables you didn't design, ask questions of them and turn the answers into figures people can trust.

What you'll learn

  • How analytical data is laid out: fact and dimension tables, keys and grain
  • SELECT, WHERE, ORDER BY and LIMIT, and reading a query from the inside out
  • Aggregation with GROUP BY and HAVING, and the classic mistakes that double-count rows
  • Inner, left and self joins, and how to check a join didn't change your row count
  • Working with dates and time zones: truncating to week or month, comparing periods
  • Handling NULL, CASE expressions and cleaning messy text values
  • Common table expressions (CTEs) to break a long query into readable steps
  • Window functions: running totals, rankings, LAG and LEAD for period-on-period change
  • Funnel, cohort and retention queries built step by step
  • Checking your own work: reconciling totals, sampling rows and writing down assumptions

Who it's for

  • Marketing, operations and finance staff who live in spreadsheets and want direct access to data
  • Junior analysts preparing for an analyst role where SQL is expected
  • Product managers who want to answer their own questions about user behaviour

Prerequisites

  • Comfort with spreadsheets: sorting, filtering and basic formulas
  • No programming experience needed
  • A laptop that can run a browser; we provide a sample database

Outcomes

By the end of this course you will be able to:

  1. Write correct queries with joins, aggregation and window functions against an unfamiliar schema.
  2. Build funnel, cohort and retention reports from raw event and order tables.
  3. Spot and fix the common causes of wrong numbers: fan-out joins, NULL handling and time zones.
  4. Explain how a figure was calculated so others can check and reuse it.

Projects you'll build

  • Monthly sales report – revenue, orders and average order value by month and channel from an e-commerce schema, practising joins, date functions and grouping.
  • Signup funnel – step-by-step conversion from visit to paid account using event data, practising CTEs and conditional aggregation.
  • Customer retention cohorts – a cohort table showing what share of each month's new customers buy again, practising window functions and date arithmetic.

Tools you'll use

PostgreSQL 18 with DBeaver or pgAdmin, plus a short look at how the same SQL runs in BigQuery and DuckDB.

Course outline

ModuleTopic
1How analytical databases are organised
2Selecting, filtering and sorting
3Aggregation and grouping
4Joins and checking row counts
5Dates, times and period comparisons
6NULL, CASE and cleaning values
7CTEs and subqueries
8Window functions
9Funnels and conversion analysis
10Cohorts and retention
11Validating and documenting your numbers
12Project: a reporting pack for a sample business

FAQ

How is this different from SQL and PostgreSQL Essentials?

SQL and PostgreSQL Essentials is for developers and covers table design, indexes and transactions. This course skips most of that and spends the time on analytical queries: funnels, cohorts, period comparisons and checking that your numbers are right.

Which database will I learn?

We use PostgreSQL because it is free and follows the SQL standard closely. Almost everything carries over to BigQuery, Snowflake, MySQL and SQL Server, and we point out the differences you are likely to meet.

What should I learn next?

Pair SQL with a dashboard tool such as Tableau for Beginners or Power BI and Dashboards, or move on to Data Analysis with Python and pandas.

How do I join?

Get in touch and we'll share the current format, schedule and enrolment details.