IntermediateEnglish

Applied SQL for Analysts

Write queries you can defend in a review

AMTaught by Arun Menon

3.5(2 reviews)

13 enrolled

About this course

Most analysts learn SQL by copying a query that worked once and changing the dates. This course takes you from that to writing queries you understand, can explain, and can fix when the numbers look wrong.

You will work against a realistic sales and subscriptions schema with the kinds of problems real data has: duplicate rows, late arriving records, currencies that changed mid year, and a customer table where the same person appears three times.

By the end you will be comfortable with window functions, common table expressions and query plans, and you will know why a query that runs in two seconds on your laptop takes four minutes in production.

Curriculum

24 lessons, 7m 40s total

2 lessons are free to preview.

  1. 01Getting your bearings

    4 lessons, 1m 20s

    1. What this course assumes you already know0:20
    2. The schema we will use throughout0:20
    3. Reading a query someone else wrote0:20
    4. Why SELECT * costs more than you think0:20
  2. 02Joins that behave

    5 lessons, 1m 20s

    1. Inner, left and the row count trap0:20
    2. When a join multiplies your rows0:20
    3. Anti joins and finding what is missing0:20
    4. Exercise: reconcile two order tables0:20
    5. Reference: join cheat sheet
  3. 03Aggregation and grouping

    4 lessons, 1m 20s

    1. GROUP BY, and what HAVING is actually for0:20
    2. Counting things that are not there0:20
    3. Averages that lie0:20
    4. Rolling up to month, quarter and year0:20
  4. 04Window functions

    5 lessons, 1m 40s

    1. The mental model: a window, not a group0:20
    2. ROW_NUMBER, RANK and deduplication0:20
    3. Running totals and period over period0:20
    4. LAG and LEAD for change detection0:20
    5. Exercise: build a retention curve0:20
  5. 05Making it fast

    3 lessons, 1m

    1. Reading an EXPLAIN plan without fear0:20
    2. Indexes: what they cost and what they buy0:20
    3. Why your query is slow only in production0:20
  6. 06Putting it together

    3 lessons, 1m

    1. Structuring a long query with CTEs0:20
    2. Writing a query someone else can maintain0:20
    3. Final project walkthrough0:20
Applied SQL for Analysts | Northside College