Learn SQL
Use SQL to query a real database. Learn SELECT, filtering, sorting, grouping, joins, and how to create and change tables.
Start learning
Build real skills one lesson at a time
Explore the complete curriculum below, then start with the lesson that is right for you.
About this course
SQL is how you ask a database a question, and it is one of the few skills that goes everywhere: behind a website, an app, a dashboard, or a report. This course teaches it from zero. You do not need to know any programming language first.
Every lesson gives you a real PostgreSQL database to query. You write a query, save, and the rows come back a second later, or the error message does. The whole course uses one bookstore, so by the end you know its authors, books, customers, and orders well enough to ask it anything.
Nothing you type can break it. The database is rebuilt before every run, which makes adding, changing, and deleting data as safe to experiment with as reading it.
What you'll learn
- SELECT and FROM, choosing columns, and renaming them with
AS - Filtering with WHERE: comparisons,
AND,OR, and parentheses - Patterns and ranges with
IN,BETWEEN,LIKE, andIS NULL - Sorting and limiting with
ORDER BY,LIMIT, andDISTINCT - Aggregates and grouping:
COUNT,SUM,AVG,GROUP BY, andHAVING - Joining tables, including
LEFT JOINand chains across four tables - Changing data with
INSERT,UPDATE,DELETE, andRETURNING - Creating tables: types, primary keys,
NOT NULL,DEFAULT,REFERENCES, andALTER TABLE
It ends with a capstone: a reservations feature for the bookstore, built end to end, from the table itself to the questions the owner asks about it every morning.
Prerequisites
- None. No SQL, no databases, and no programming language. If you can read a spreadsheet, you can start here.
When you want to put a database behind an app, JavaScript Basics (opens in a new tab) is where the programming side starts.
Course instructor
Brad Traversy
Founder of Traversy Media and an educator known for practical, project-focused web development courses.
Course content
Keep learning
More programming courses
Beginner course
Python for Beginners
Go from zero to writing real Python programs in the browser. Build up the core language, variables, types, control flow, lists, loops, and functions, with instant feedback and no setup required.
View courseIntermediate course
Vue.js Fundamentals
Build real Vue apps from scratch. Learn single-file components, template syntax, reactivity with ref and computed, props and events, forms with v-model, data fetching, composables, and routing, then put it all together in an anime explorer capstone. Assumes you have finished JavaScript Basics and Intermediate JavaScript.
View courseAdvanced course
Software Design Principles in JavaScript
Learn to structure code that survives change: separation of concerns, coupling and cohesion, SOLID, composition, dependency injection, and the patterns worth knowing, all applied to real JavaScript you restructure yourself.
View course

