SQL Tutorial for Data Analysis (formerly Mode)
A free, analysis-focused SQL tutorial that goes from SELECT to joins, subqueries and window functions, with a query editor in the browser. Originally Mode's well-known tutorial, it is now hosted by ThoughtSpot, which acquired Mode in 2023.
Course
Other
ThoughtSpot
Beginner
Free
What it is
This is the SQL tutorial that Mode Analytics built for analysts, now hosted on thoughtspot.com after ThoughtSpot completed its acquisition of Mode in July 2023; the old mode.com/sql-tutorial address redirects here. It is organised into Basic SQL, Intermediate SQL, SQL Analytics Training and Advanced SQL sections, and the lessons include a query editor so you can run examples in the browser without installing a database.
Why analysts like it
Most SQL tutorials are written for developers building applications. This one is written for people answering business questions. The examples use realistic datasets, and the lessons cover what analysts use daily:
- Filtering, sorting and aggregation with GROUP BY and HAVING.
- Joins of every kind, including the common mistakes with join conditions and filtering.
- CASE, date handling and working with messy text.
- Subqueries.
- Window functions: ROW_NUMBER, RANK, DENSE_RANK, NTILE, LAG and LEAD, and running totals with SUM() OVER.
- An analytics training section that walks through realistic investigations, which is closer to the job than isolated exercises.
Is it worth your time?
Yes, especially once you know the basics. Use SQLBolt or a similar interactive course for the first few hours if you have never written SQL, then move to this tutorial for joins, window functions and the analytics case studies. If you want to go further into databases themselves (indexes, design, transactions), use a dedicated SQL and databases course.
Time needed
The basic and intermediate sections take a couple of weeks part time. Window functions and the analytics section need another week or two of practice.
Prerequisites
None for the basics. The advanced lessons assume you are comfortable with GROUP BY and joins.
Free vs paid
The tutorial is free and does not require sign-up to read. The page offers ThoughtSpot product trials and demos; you do not need them for the tutorial.
Common questions
Which SQL dialect does it use? Standard SQL close to PostgreSQL. Most of it transfers to MySQL, SQL Server, BigQuery and Snowflake with small syntax changes.
Is it the same content as the old Mode tutorial? The structure and lessons match the tutorial analysts have used for years; some product references have changed with the new host.
Ready to start?
Opens on ThoughtSpot in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.