Learn SQL in your browser
A free SQL tutorial in short lessons on one shop database. Every example runs on real PostgreSQL in your browser, and the page checks your answers.
Database design, migrations, SQL and everyday database work — explained with practical examples.
A free SQL tutorial in short lessons on one shop database. Every example runs on real PostgreSQL in your browser, and the page checks your answers.
Learn the SQL wildcard characters from short examples with their results: % and _, SQL Server's [ ] and [^ ], ESCAPE for a literal % or _, and what MySQL, PostgreSQL and SQLite use instead.
Learn SQL aggregate functions with COUNT, SUM, AVG, MIN, MAX, GROUP BY, HAVING, and ROLLUP examples. Build reporting queries faster in DbSchema.
Learn the SQL LIKE operator from short examples with their results: % and _, NOT LIKE and NULL, ESCAPE, ILIKE and case, several patterns, and index use.
Learn SQL HAVING with GROUP BY from short examples with their results: COUNT, AND, COUNT DISTINCT, HAVING without GROUP BY, HAVING vs WHERE, and the errors each engine raises.
ANY is true when one row of a subquery matches, ALL only when every row does. Short examples with their results, IN and NOT IN, NULLs and empty subqueries.
SQL aliases explained: rename columns and tables with AS, quote aliases with spaces, and see where an alias may be referenced in WHERE, GROUP BY, HAVING and ORDER BY.
SQL SELECT INTO creates a new table from a query result. Short examples with their results: a full copy, columns, WHERE, an empty copy, JOIN, and CREATE TABLE AS on MySQL, Oracle and SQLite.
Learn MongoDB CRUD operations in mongosh from short examples with their results: insertOne, find, filters, projection, sort, updateOne, updateMany, replaceOne, upsert, deleteOne and deleteMany.
Create a MongoDB database with use and a first insert in mongosh, or through Atlas, Compass, Docker and DbSchema. Why an empty database does not persist.
Learn MongoDB $lookup with simple joins, pipeline lookups, $unwind, indexing, and performance tips. Build and inspect joins visually in DbSchema.