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 BYandLIMIT, and reading a query from the inside out- Aggregation with
GROUP BYandHAVING, 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,CASEexpressions and cleaning messy text values - Common table expressions (CTEs) to break a long query into readable steps
- Window functions: running totals, rankings,
LAGandLEADfor 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:
- Write correct queries with joins, aggregation and window functions against an unfamiliar schema.
- Build funnel, cohort and retention reports from raw event and order tables.
- Spot and fix the common causes of wrong numbers: fan-out joins,
NULLhandling and time zones. - 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
| Module | Topic |
|---|---|
| 1 | How analytical databases are organised |
| 2 | Selecting, filtering and sorting |
| 3 | Aggregation and grouping |
| 4 | Joins and checking row counts |
| 5 | Dates, times and period comparisons |
| 6 | NULL, CASE and cleaning values |
| 7 | CTEs and subqueries |
| 8 | Window functions |
| 9 | Funnels and conversion analysis |
| 10 | Cohorts and retention |
| 11 | Validating and documenting your numbers |
| 12 | Project: 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.