Can I Learn SQL on My Own?
By Owen Middleton · Updated November 2026 · We ran the examples on PostgreSQL 17
Yes, you can learn SQL on your own. With no class, you must do four jobs yourself: choose the order of topics, check your answers, find help and keep a schedule.
In the 2024 Stack Overflow Developer Survey, 82.1% of the people who answered named "other online resources" as a way that they learn to code. 49.1% named school.
We make SQLMaxx Learn, a free SQL course for self-study, so we have an interest in this answer.
What does a SQL teacher do that you must do on your own?
In a class, a teacher does four jobs for you. On your own, you must replace each one:
- Choose the order of topics. In a class: The teacher gives you a syllabus. On your own: Use a course with lessons in order, or a written order of topics.
- Check your answers. In a class: The teacher marks your answers. On your own: Use a course where you get a check on the result of each query. You can also write a second query to check it.
- Find help. In a class: The teacher answers your questions. On your own: Read the error message and the documentation. Open a worked solution after you try. Ask in a forum.
- Keep a schedule. In a class: You go to class at fixed times, and you have deadlines. On your own: Set your own fixed days and time for practice.
For an order of topics, with the research behind it, read our page on how to learn SQL. In our view, the check is the hardest job to replace.
Can SQL be self-taught? What developers told Stack Overflow
In our view, yes, you can learn SQL by yourself. In the survey below, many people named ways to learn other than school, for example online resources and books.
In the 2024 Stack Overflow Developer Survey, the question was "How do you learn to code? Select all that apply." There were 59,912 responses. "Other online resources" (82.1%) and "School" (49.1%) were the first and the fourth most common answers. The second and the third were "Books / Physical media" (50.3%) and "E-courses or Certification" (50%).
In the group that Stack Overflow calls "Learning to Code" (6,590 responses), other online resources are also the top answer: 84.9%. 55.6% of this group also named school (Stack Overflow Developer Survey 2024, Learning to code).
These numbers have four limits:
- Only people who chose to take the survey answered.
- The question is about code in all languages, not about SQL alone.
- Each person could select more than one answer.
- If a person did not select school, you cannot tell that the person never went to school.
How do you check your own SQL answer with no teacher?
Write a second query to test what you think about the data. Here is an example on the
salaries table of Helix Systems, a made-up company. In this table, there is a salary
amount for each employee_id, with two dates:
Schema · hr1 table? = nullable
The question: which five employees of Helix Systems have the highest salaries? Here is a first try:
SELECT employee_id, amount AS salary
FROM salaries
ORDER BY salary DESC, employee_id
LIMIT 5; | employee_id | salary |
|---|---|
| 1 | 420000.00 |
| 1 | 380000.00 |
| 7 | 270000.00 |
| 2 | 260000.00 |
| 8 | 250000.00 |
PostgreSQL runs this query with no error message. But employee 1 is in the result two times, so you get only 4 different employees. With no teacher, nobody tells you that this answer is wrong. You must find it yourself.
To check, count the rows and the employees in the table:
SELECT COUNT(*) AS salary_rows, COUNT(DISTINCT employee_id) AS employees
FROM salaries; | salary_rows | employees |
|---|---|
| 116 | 60 |
There are 116 rows for 60 employees, so some employees have more than one row. Look at the rows of employee 1:
SELECT employee_id, amount, effective_date, end_date
FROM salaries
WHERE employee_id = 1
ORDER BY effective_date; | employee_id | amount | effective_date | end_date |
|---|---|---|---|
| 1 | 380000.00 | 2018-01-15 | 2020-01-01 |
| 1 | 420000.00 | 2020-01-01 | NULL |
There is a salary history in the table. Employee 1 has an old salary with an end_date, and a current
salary with no end_date. For the current salary, end_date is NULL. To get only
the current salaries, add WHERE end_date IS NULL:
SELECT employee_id, amount AS salary
FROM salaries
WHERE end_date IS NULL
ORDER BY salary DESC, employee_id
LIMIT 5; | employee_id | salary |
|---|---|
| 1 | 420000.00 |
| 7 | 270000.00 |
| 2 | 260000.00 |
| 8 | 250000.00 |
| 4 | 245000.00 |
Now you get 5 different employees. Check the fix with the same count:
SELECT COUNT(*) AS salary_rows, COUNT(DISTINCT employee_id) AS employees
FROM salaries
WHERE end_date IS NULL; | salary_rows | employees |
|---|---|
| 60 | 60 |
There are 60 rows for 60 employees: one current salary for each employee. In the first try, there is no syntax error. The mistake is an assumption about the data: one row for each employee.
So before you trust a result, write down what you think is true, for example "one row for each employee". Then test it with a second query.
In the first try, you sort the rows with ORDER BY and give the amount column the name
salary with AS. To sort rows, read ORDER BY and Result Sorting, with live examples. For AS, learn
how Column Aliases and Expression Naming works.
Where do you get help with SQL when you learn by yourself?
Use the sources of help below, in this order. The percentages are from the 2025 Stack Overflow survey, question "How did you learn to code in the past year? Select all that apply." (33,454 people answered it; Stack Overflow Developer Survey 2025, How did you learn to code?). This question is about the past year only, so the answers are about how people learn now. The question is also about code in all languages, and each person could select more than one answer.
- The error message. When PostgreSQL cannot run your query, it shows an error message. Read it first.
- The documentation of your database, for the clause or the function that you use. 67.8% named "Technical documentation (is generated for/by the tool or system)".
- A worked solution, after you try. In SQLMaxx Learn, you can open a worked solution for each of the 615 practice problems: the query and a written explanation.
- A forum or an online community. Show your query, the error message or the result, and the result that you expected. 58.7% named "Other online resources (e.g. standard search, forum, online community)", and 51.4% named "Stack Overflow or Stack Exchange".
- An AI tool. Ask the AI tool to explain an error message. Check a query from an AI tool the same way as your own query: test it with a second query. 44% named "AI CodeGen tools or AI-enabled apps".
How do you practice SQL on a regular schedule with no class?
Set fixed days and a fixed time for practice. Before you stop, write down the next topic.
In SQLMaxx Learn, you can also use Review mode. In Review mode, you practice lessons that you have mastered. The automatic Review list is the lessons that you mastered, when we predict a chance below 80% that you remember the lesson. You need an account for Review.
When is a SQL class a better choice than self-study?
In our view, a class is the better choice if you need one of these:
- A deadline from another person, so that you continue.
- A person who answers your questions on the same day.
- A credential from a school or from your employer.
- A group of people to learn with.
Start SQLMaxx Learn lesson 1
SQLMaxx Learn is free. It is a SQL course that you can take on your own, with 66 lessons. Lesson 1 is "SELECT and Column Expressions", and you can start it in your browser with no account.
In SQLMaxx Learn, you get a result check and a worked solution for each problem, but no teacher, forum or video.
More questions: can you learn SQL on your own?
How much does it cost to learn SQL on your own?
You can learn SQL on your own with free software and free lessons. PostgreSQL is free. It has the PostgreSQL License, "a liberal Open Source license, similar to the BSD or MIT licenses". All 66 lessons and all 615 practice problems of SQLMaxx Learn are free. Source: PostgreSQL License.
Which SQL database should I use to learn SQL on my own?
Use the database of your job, or of the job that you want, if you know it. If you do not know it, start with one database. In SQLMaxx Learn, you learn only PostgreSQL.
Do I need an account to learn SQL with SQLMaxx Learn?
No. Without an account, you can continue only in the browser where you started. When you sign up, you keep your progress. You need an account for Review mode and for the certificate.