The best SQL courses for data analysis (2026)
Free from zero: Microsoft Learn. A university certificate: Coursera. Short exercises in the browser: DataCamp. The step after GROUP BY: Hey Maestro.
Published by Hey Maestro, which sells some of the courses compared
In this guide
| Option | Price | Length | Practice | Tutor | Refund |
|---|---|---|---|---|---|
| Microsoft Learn: Query and modify data with Transact-SQL | Free | 6 modules, about 6 hours | Reading and a short assessment at the end of each module | Microsoft Q&A forum | Doesn't apply: it's free |
| Coursera: SQL for Data Science (UC Davis) | Free to enroll with limited access; the full course and certificate come with Coursera Plus, $59 a month or $399 a year | 4 modules, about 2 weeks at 10 hours a week | Videos, quizzes and graded coding assignments | Discussion prompts; Coursera Coach, an AI assistant, in many Coursera courses | Coursera Plus: 7-day free trial on the monthly plan, 14 days on the yearly plan |
| DataCamp: Introduction to SQL | First chapter free; Premium from $11 a month, billed yearly | About 2 hours | Short code exercises in the browser | AI Tutor format that comments on each answer, with an Individual plan | Its terms offer no refunds on individual plans |
| Hey Maestro: Window Functions in SQL | Free | 5 modules, 12 pages | Queries that run on the page (DuckDB) and exercises that mark themselves | AI tutor that answers from the page you're on | Doesn't apply: it's free |
| Hey Maestro: SQL for Data Analysis | $25, one-time | 7 modules, 40 pages | Queries that run on every page (DuckDB) | AI tutor that answers from the page you're on | 7 days, in full, for any reason |
Checked on November 12, 2026, on each platform's own site. Prices are the ones each site shows from the United States. Length is given in the unit each site publishes.
How to choose
Start with the database you'll actually work in. SQL is nearly the same everywhere, but each engine has its quirks. Then decide whether you want one course or a whole catalog, and whether a certificate matters to you.
Microsoft Learn: best if you work with SQL Server or Azure
"Query and modify data with Transact-SQL" is free and teaches Microsoft's dialect (T-SQL) from SELECT to changing data, in six modules. It's the best pick if your company runs SQL Server, Azure SQL or Fabric, or if you plan to get a Microsoft certification. What it teaches carries over to other engines, though a few examples use functions only T-SQL has.
Coursera: best if you want a university certificate
SQL for Data Science, from UC Davis, is one of the most taken SQL courses anywhere, with videos, quizzes and graded coding assignments. It's the first course in a specialization, so it suits someone building toward a longer program with a certificate to show for it. Expect to spend about two weeks on it at ten hours a week.
DataCamp: best for practicing code in short bursts
Introduction to SQL is about two hours of short exercises where you write queries in the browser. With an Individual plan, the AI Tutor format comments on each answer. It's a good fit if you've already decided to learn several data tools on one platform, and the subscription opens the rest of the catalog.
Hey Maestro: best for understanding what each query counted
Hey Maestro has two SQL courses. "Window Functions in SQL" is free and teaches OVER, PARTITION BY, ROW_NUMBER, RANK and LAG: the topic that usually stops people who already write queries with GROUP BY. "SQL for Data Analysis" goes from your first SELECT to CTEs for $25, paid once. In both, the queries run on the same page you're reading, and an AI tutor answers from that page. They suit people who work with data and need to explain what a query counted, not just get a number.
Frequently asked questions
What's the best free SQL course?
To start from zero, Microsoft Learn's Transact-SQL path is free and complete. For the next step, window functions, Hey Maestro's free course picks up where beginner courses stop.
Does it matter which database the course teaches?
Not much at first. SELECT, WHERE, JOIN and GROUP BY work the same in SQL Server, PostgreSQL, MySQL, BigQuery and DuckDB. What changes is the names of some date and text functions, and how you connect.
How this guide was made
Each option was checked on its own site on November 12, 2026: price, length, language, how you practice, what help is available and the refund policy, citing each platform's terms where they exist. Length is given in the unit each platform publishes: hours, weeks or, on Hey Maestro, modules and pages. Hey Maestro publishes this guide and sells some of the courses compared, so each section says who each option is best for, including the ones that aren't Hey Maestro's. If something has changed, write to hola@heymaestro.app and the guide will be corrected.
Sources
- Microsoft Learn: Query and modify data with Transact-SQL (length from Microsoft Learn's official catalog)
- Coursera: SQL for Data Science, Coursera Plus pricing and terms
- DataCamp: Introduction to SQL, pricing and terms of use
- Hey Maestro: Window Functions in SQL and SQL for Data Analysis
Try a free course before you choose
Every free Maestro course reads in full without an account, so you can see how one teaches before you pay for any course on this page.
Free courseWindow Functions in SQLBy the end, you'll be able to write queries with OVER, PARTITION BY, ROW_NUMBER, RANK, LAG and window frames, and explain why a running total repeats numbers or why a LAG skips a month.Start reading