You can learn SQL for free with Harvard's CS50 SQL course, Kaggle's Intro to SQL, SQLBolt's interactive lessons, Khan Academy and Microsoft Learn. For practice, SQLite and PostgreSQL are free databases you can install yourself, so you don't need to pay for anything.
SQL is the skill I most often tell marketers and small business owners to pick up after spreadsheets. If you've ever wanted to pull your own numbers out of a CRM, an online shop or an analytics export, SQL is how it's done. It's also one of the easier languages to start, because a single line of SQL can already answer a real question.
Free SQL courses compared
| Course | Style | Length | Good for |
|---|---|---|---|
| CS50 SQL (Harvard OpenCourseWare) | Lectures and problem sets | Seven weeks of material | A thorough grounding in databases |
| Kaggle Learn: Intro to SQL | Short tutorials and exercises on Google BigQuery | 6 lessons, about 3 hours | Data and analytics work |
| SQLBolt | Interactive exercises in the browser | 18 core lessons plus extra topics | Learning by doing, fast |
| Khan Academy | Video and practice | Self-paced | Gentle beginners |
| Microsoft Learn: Transact-SQL | Learning path | 6 modules, beginner level | Anyone using SQL Server or Azure |
| PostgreSQL tutorial | Official documentation | Self-paced reading | Learning on a real database |
CS50 SQL: the deepest free SQL course
Harvard's CS50's Introduction to Databases with SQL teaches you to create, read, update and delete data in relational databases, and to model real-world entities and relationships. Its course page says anyone can take it for free through OpenCourseWare by working through seven weeks of material, submitting problem sets and a final project. You'll need a free edX account to submit work for feedback.
Verified certificates go through edX, and Harvard also offers transfer credit through Harvard Extension School. Both are separate from the free route.
Kaggle Intro to SQL: the fastest way in
Kaggle's course teaches SQL using Google BigQuery, across six lessons: getting started, SELECT, FROM and WHERE, GROUP BY, HAVING and COUNT, ORDER BY, AS and WITH, and joining data. Kaggle estimates about 3 hours to earn the certificate and lists the cost as "No cost, like all Kaggle Learn Courses".
One thing to know: Kaggle says this course builds on its Python course. You can follow along without much Python, but if you get stuck, that's why.
SQLBolt, Khan Academy and Microsoft Learn
- SQLBolt teaches SQL with simple interactive exercises. Its core lessons run from SELECT queries through joins, NULLs, aggregates, inserting, updating and deleting rows, to creating, altering and dropping tables, with extra topics like subqueries and unions.
- Khan Academy runs SQL lessons in its computing section. It describes itself as a 501(c)(3) nonprofit whose mission is a free, world-class education for anyone, anywhere.
- Microsoft Learn has a beginner learning path, Query and modify data with Transact-SQL, with 6 modules. The only prerequisite it lists is familiarity with tables of data, for example in a spreadsheet.
How to practise SQL for free at home
- Pick a course above and do the first few lessons in the browser, where there's nothing to install.
- Install a free database when you're ready. SQLite's own site says its source code is in the public domain and free, and its database file is cross-platform, so you can copy it freely between machines.
- If you'd like a full database server, follow the official PostgreSQL tutorial, which is free in the PostgreSQL documentation.
- Export a real dataset you care about, such as a sales report or email list stats, and load it in.
- Write five questions you'd like answered about your business, then write the SQL to answer them.
If you're choosing which database to practise on, my guide to free database software compares the options. Once you've got the basics, these ChatGPT prompts for SQL are handy for checking and explaining your queries. And if you want SQL as part of a bigger data skill set, here are free data analytics courses.
Which version of SQL should you learn first?
SQL is one language, but each database adds its own flavour. Microsoft Learn's path teaches Transact-SQL, the version used across SQL Server and Azure SQL. Kaggle's course runs on Google BigQuery. SQLBolt teaches the core commands in the browser. The basics you'll use every day, such as SELECT, WHERE, GROUP BY and joins, appear in all of these courses, so start wherever suits you and pick up the differences later.
If your company already runs on Microsoft, Transact-SQL is a sensible first choice. If you work with marketing or website data in Google's tools, Kaggle's BigQuery course will feel closer to home.
My advice
Start with SQLBolt or Kaggle for a quick win, then do CS50 SQL if you want to understand databases rather than just query them. Practise on SQLite with your own data from day one. A course teaches you the syntax; answering a question about your own business is what makes it stick.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
Frequently asked questions
Can I learn SQL for free?
Yes. Harvard's CS50 SQL, Kaggle's Intro to SQL, SQLBolt, Khan Academy and Microsoft Learn's Transact-SQL path are all free to study.
How long does it take to learn SQL basics?
Kaggle estimates about 3 hours for its Intro to SQL course. Harvard's CS50 SQL is a much deeper course with seven weeks of material.
Do I need to install anything to learn SQL?
No. SQLBolt, Kaggle and Khan Academy all run in the browser. When you're ready, SQLite and PostgreSQL are free databases you can install.
Is there a free SQL certificate?
Kaggle Learn courses are free, certificate included. CS50 SQL is free to study, but its verified certificate comes through edX as a separate route.
Which free SQL course is best for beginners?
SQLBolt and Kaggle's Intro to SQL are the quickest starts. Microsoft Learn's Transact-SQL path is marked beginner level and only expects you to be familiar with tables of data, such as a spreadsheet.
Is SQLite free to use?
Yes. SQLite's own site says its source code is in the public domain and free, and its database files are cross-platform, so you can copy them between machines.
Is Harvard's CS50 SQL really free?
Yes, through Harvard's OpenCourseWare. You'll need a free edX account to submit problem sets for feedback, and the verified certificate is a separate route through edX.
Do I need Python before Kaggle's SQL course?
Kaggle says its Intro to SQL course builds on its Python course, so a little Python helps, though the SQL lessons themselves focus on queries.


