Learn SQL for Beginners: Short Lessons, Real Queries | Sololearn

Learn SQL

Start from nothing and learn by writing real queries, a few minutes a day. You don’t need to install a database or know any code.

36M+ learners · 4.8★ on the App Store · 4.6★ on Google Play

What a first query looks like
SELECT title, year
FROM movies
WHERE year > 2020
ORDER BY year;
It returns
title          year
Dune           2021
Oppenheimer    2023

What you’ll learn

There are two SQL courses, and one path that adds Python. Start with the first one. Open a module to see its lessons.

Introduction to SQL

4 modules, 20 lessons, 17 coding challenges

Reading data from tables: queries, sorting, filtering, pattern matching, grouping and cleaning data. You don’t need to know anything before you start.

Getting Started with SQL4 lessons
  • Working with Data
  • Running SQL Queries
  • Relational Databases
  • Debugging

Coding challenges: Box Office, Store Inventory

Going Deeper with SQL5 lessons
  • Standards & Best Practices
  • Sorting Data
  • Limiting Data
  • Data Types
  • Filtering Data

Coding challenges: Employee Salary, Student Grade, Menu, Giveaway!, Tennis Tournament, Online Bookstore, Movie Ratings

Query Techniques5 lessons
  • Pattern Matching
  • Advanced Pattern Matching
  • SQL Conditions
  • Data Aggregation
  • Mixing Things Up

Coding challenges: Chocolate!, Music and Love!, Select your Car, Grocery Store

Data Analysis6 lessons
  • Analyzing Data
  • Grouping
  • Grouping and Filtering
  • Cleaning Data
  • Fixing Data Types
  • Making Sense of Data

Coding challenges: Social Media Posts, Sports League, Teacher Data, Theater Management

Go to the course page

SQL Intermediate

3 modules, 11 lessons

Changing and combining data: string and math functions, CASE, keys and constraints, joins and unions.

Data Manipulations4 lessons
  • Introduction
  • String Functions
  • Math & Aggregate Functions
  • CASE
Table Constraints3 lessons
  • Identity
  • Primary & Foreign Keys
  • Unique
Working with Data4 lessons
  • Multiple Tables
  • Joins
  • Union
  • Find the Average

Go to the course page

Coding for Data

10 modules, 54 lessons, 45 coding challenges

Python and SQL in one path, for people who want to work with data. It includes the whole Introduction to SQL course.

Getting started with Python5 lessons
  • Writing Code
  • Memory & Variables
  • Text Data
  • Numerical Data
  • Working with Variables

Coding challenges: Game Messages, Shopping Prices, The Semester Grade

Going Deeper with Python5 lessons
  • Debugging
  • Standards and Best Practices
  • Applying Best Practices
  • Inputs and Outputs
  • Data Types

Coding challenges: And the Winner is …, Flight Tracker, Snowflake, It’s Payday!, Chatbot v1.0, Messaging App, Chatbot v1.1

Working with Data6 lessons
  • Data Type Checking
  • Data Conversion
  • Fixing Data Types
  • Comparison Operations
  • Logical Operations
  • Combining Comparison and Logical Operations

Coding challenges: Finance App, Chess Tournament, Level Up!, Fitness Goals!, Houston, we’ve had a problem.

Control Flow6 lessons
  • Control Flow
  • For Loops
  • While Loops
  • More on Iteration
  • Conditional Statements
  • More on Conditional Statements

Coding challenges: Fasten your Seat Belt, Time’s Up!, Cell Growth, Smart Parking Lot, Medical Software

Working with Lists6 lessons
  • Lists
  • Indexing
  • Using Indexing
  • Slicing
  • Using Slicing
  • Advanced Slicing and Indexing

Coding challenges: Game Machine, Pancakes, Relay Race, Step Counter

Functions6 lessons
  • Functions
  • Function Arguments
  • String Functions
  • List Functions
  • Custom Functions
  • More on Custom Functions

Coding challenges: Survey Data Format, Queue Management, Shipping cost, Hashtag Generator

Getting Started with SQL4 lessons
  • Working with Data
  • Running SQL Queries
  • Relational Databases
  • Debugging

Coding challenges: Box Office, Store Inventory

Going Deeper with SQL5 lessons
  • Standards & Best Practices
  • Sorting Data
  • Limiting Data
  • Data Types
  • Filtering Data

Coding challenges: Employee Salary, Student Grade, Menu, Giveaway!, Tennis Tournament, Online Bookstore, Movie Ratings

Query Techniques5 lessons
  • Pattern Matching
  • Advanced Pattern Matching
  • SQL Conditions
  • Data Aggregation
  • Mixing Things Up

Coding challenges: Chocolate!, Music and Love!, Select your Car, Grocery Store

Data Analysis6 lessons
  • Analyzing Data
  • Grouping
  • Grouping and Filtering
  • Cleaning Data
  • Fixing Data Types
  • Making Sense of Data

Coding challenges: Social Media Posts, Sports League, Teacher Data, Theater Management

Go to the course page

How the lessons work

You write code in every lesson

There’s nothing to install. The lesson comes with sample tables and an editor, so you type a query, press Run and see the rows it returns. It works in a browser and in the Android and iOS apps.

Lessons are short

A lesson takes a few minutes. Each one ends with a quiz or a coding exercise, so you use what you just read before you move on. A lesson or two a day is plenty.

You can get help

The community Q&A forum is free, and other learners answer there. On Sololearn MAX you also get Kodie, an AI assistant in the editor that can explain your code, find the bug or give you a hint.

You get a certificate

Every course you finish gives you a certificate, and you don’t pay for it. You can add it to your CV or LinkedIn.

What learners say

Sololearn is one of the best websites for beginners who want to learn coding in a simple and fun way. The lessons are short, clear and simple, with small quizzes and coding practice after each one — which helps you learn faster.
Rahmanullah T., Trustpilot, US
A perfect starting point. Short, on-point, with hands-on use of what you just learned.
Irakli, Trustpilot, ES
Programming was far easier than other platforms make it look. Every lesson is bite-sized, with a review question before each one. 95 days non-stop.
Samuel, Trustpilot, NG

Common questions

Do I need any experience to start?

No. Introduction to SQL is written for people who have never coded. It goes one small step at a time.

Do I need to install a database?

No. The lessons come with sample tables and an editor, in your browser or in the app, so you can run queries straight away.

Should I learn Python or SQL first?

Either order works. SQL is smaller, and you can do useful things with it quickly. If you want both, the Coding for Data path teaches Python first and then SQL.

Is there practice?

Yes. Introduction to SQL has 17 coding challenges, where you write a query for a small task such as a store inventory or a tennis tournament. 13 of them are free.

Do I get a certificate?

Yes, one for each course you finish, and it’s free. You can add it to your CV or LinkedIn.

How much time does it take?

That’s up to you. Introduction to SQL has 20 short lessons, and 10 to 15 minutes a day is enough to make steady progress.

Write your first SQL query today

It takes a few minutes, and you don’t need to install anything.