Section 7: Window Functions: Ranking Data
The idea behind OVER, PARTITION BY and ORDER BY
How ROW_NUMBER, RANK and DENSE_RANK differ
Filter window function results with QUALIFY
Lab: find each customer's first order and the top sellers in each branch
Section 8: Lab: Running Totals and Period Comparisons
Running totals and moving averages with window frames
LAG and LEAD to compare with the previous month and the previous year
Share of total and growth rates
Lab: a monthly sales report with MoM and YoY figures
Section 9: Lab: Cohort, Retention and Funnel Analysis
Group customers by the month of their first purchase to build cohorts
Calculate monthly retention and lay it out as a cohort table
Funnels from event data: page view, add to cart and checkout
Read the results to find where customers drop off, and the pitfalls of interpretation
Section 10: Writing Cost-Efficient Queries
How BigQuery charges for queries and why bytes scanned matter
Avoid SELECT * and choose only the columns you need
Partitioned and clustered tables, and filtering so partitions are pruned
The query cache, dry runs and setting maximum bytes billed
Lab: compare bytes scanned before and after tuning a query
Section 11: Saving and Sharing Results, and Drafting SQL with Gemini
Save queries, create views and set up scheduled queries
Send results to Google Sheets and connect them to Data Studio
Use Gemini in BigQuery to draft and explain SQL from plain language
Review AI-written SQL for logic, figures and cost before using it
Section 12: Workshop: Capstone Business Analysis
Take a business brief from a fictional executive and turn it into questions SQL can answer
Write queries that analyse sales, customers and retention with the techniques covered
Save the results as views and connect Data Studio to present them visually
Present the findings, review the SQL together and wrap up with a query-writing checklist