Skip to content
Lifetime access to every course you buy · 14-day refund window

DATA & AI · INTERMEDIATE · NEW

SQL for Business Analysis

Write, check and explain the SQL behind everyday business questions, from monthly revenue to retention cohorts.

Most questions about sales, customers and products can be answered with a small, well-understood part of SQL. This course teaches that part thoroughly on one consistent schema of customers, orders, order items and products, from filters and aggregates to joins, CTEs and window functions. You will also learn to check results before anyone acts on them, write queries colleagues can review, and work safely with read-only access and personal data.

  • 4modules
  • 12lessons
  • 3h 56mof material
  • Oct 2026last updated
Clearwork course teamWritten and maintained by the Clearwork data & AI curriculum team

What you will be able to do

  • Read an unfamiliar schema, identify its primary and foreign keys, and state the grain of each table before querying it
  • Filter, sort, group and summarise data with WHERE, GROUP BY and HAVING, handling NULLs and dates correctly
  • Combine tables with INNER and LEFT joins and recognise when a join has dropped rows or duplicated values
  • Build multi-step analyses with CASE WHEN, CTEs and window functions such as ROW_NUMBER, SUM OVER and LAG
  • Produce and verify standard business queries: revenue by month, top customers, retention cohorts and funnel conversion

Who it is for

  • Analysts, operations and finance staff who export data to spreadsheets today and want to query it directly
  • Product, marketing and e-commerce managers who want to answer their own questions or review analysts’ queries
  • People who can write a basic SELECT and want to use joins, CTEs and window functions with confidence

Before you start

  • Comfort with spreadsheets and everyday business measures such as revenue, orders and average order value
  • A place to practise SQL: read-only access to a work database, or a free local database such as SQLite or PostgreSQL
  • Some first contact with SQL helps, but Module 1 reviews the basics quickly

Curriculum

4 modules · 12 lessons · 3h 56m

Module 1Tables, Keys and Basic Queries3 lessons · 49 min

Learn how the course schema fits together, then select, filter, sort and categorise rows with SELECT, WHERE, ORDER BY, LIMIT and CASE WHEN.

  1. Tables, rows and keysHow relational tables are organised, what primary and foreign keys guarantee, and why you should name the grain of every table before you query it.15 min · free preview · worked example · exercise
  2. SELECT, WHERE, ORDER BY and LIMITChoose columns, filter rows precisely, sort the result and limit the output, avoiding the AND/OR and date-range traps.18 min · worked example · exercise
  3. Calculated columns and CASE WHENCreate new columns with arithmetic and conditions, and use CASE WHEN to sort rows into business categories you define.16 min · worked example · exercise
  4. Module quiz4 questions with explanations
Module 2Aggregates, NULLs and Dates3 lessons · 58 min

Summarise rows with aggregates, GROUP BY and HAVING, handle missing values deliberately, and group activity by month in different databases.

  1. Aggregates, GROUP BY and HAVINGCount, sum and average rows, group them into categories, and filter groups with HAVING instead of WHERE.20 min · worked example · exercise
  2. NULLs and missing valuesWhat NULL means, why it breaks ordinary comparisons, and how IS NULL, COALESCE and aggregates treat missing values.18 min · worked example · exercise
  3. Working with dates and monthsGroup activity by month, calculate date differences, and handle the syntax differences between databases.20 min · worked example · exercise
  4. Module quiz4 questions with explanations
Module 3Joins, Row Counts and CTEs3 lessons · 1h

Combine tables with INNER and LEFT joins, understand why joins change row counts and duplicate values, and structure longer queries with CTEs.

  1. INNER JOIN: combining related tablesJoin tables on their keys, use aliases, and understand which rows an inner join keeps and which it drops.18 min · worked example · exercise
  2. LEFT JOIN, row counts and duplicate fan-outKeep unmatched rows with LEFT JOIN, avoid turning it back into an inner join, and recognise when a join multiplies rows and inflates totals.22 min · worked example · exercise
  3. CTEs and readable SQLBreak long queries into named steps with WITH, pre-aggregate safely, and format SQL so that colleagues can review it.20 min · worked example · exercise
  4. Module quiz4 questions with explanations
Module 4Window Functions, Business Queries and Checks3 lessons · 1h 9m

Rank, accumulate and compare periods with window functions, build the standard business queries, and check results before anyone acts on them.

  1. Window functions: ROW_NUMBER, running totals and LAGCalculate rankings, running totals and period-over-period changes without collapsing rows, using OVER with PARTITION BY and ORDER BY.24 min · worked example · exercise
  2. Core business queries: revenue, top customers, cohorts and funnelsPatterns for four of the queries analysts are asked for most often: revenue by month, top customers, retention cohorts and funnel conversion.25 min · worked example · exercise
  3. Checking results, read-only access and data privacyVerify a result with row counts, spot checks and reconciliation before sharing it, and work safely with live systems and personal data.20 min · worked example · exercise
  4. Module quiz4 questions with explanations

Included downloads

  • Cheat sheetSQL for Analysis Cheat Sheet

    The practice schema, clause order, NULL rules, date functions by database, window functions and four business query templates in one place.

  • ChecklistQuery Review Checklist

    Questions to run through before you share any query result, from definitions and joins to reconciliation, access and privacy.

  • TemplateAnalysis Request and Results Note

    A one-page template for agreeing a data question before you write any SQL, and for documenting the answer when you share it.

Taken this course? Reviews come only from learners with a completed order.

KEEP GOING

Related courses.

NewPractical Data Analysis with Spreadsheets & AI
Data & AI · Intermediate

Practical Data Analysis with Spreadsheets & AI

Clean, analyse and present business data in Google Sheets or Excel, with AI assistants doing the tedious parts.

4 modules · 12 lessons · 2h 49m
$149.00Clearwork course team
NewAI Automation Without Code
Data & AI · Beginner

AI Automation Without Code

Turn repetitive office tasks into reliable AI-assisted workflows, with checks that keep a person in control.

4 modules · 12 lessons · 3h 41m
$99.00Clearwork course team
PopularBrand Positioning Essentials
Marketing · Beginner

Brand Positioning Essentials

Find the one idea your market will remember you for, then say it the same way everywhere.

4 modules · 12 lessons · 2h 40m
$79.00Clearwork course team