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 SQL ORDER BY with examples: ASC/DESC sorting, multiple columns, NULL handling, LIMIT/OFFSET pagination, CASE expressions, and performance tips.
Learn how SQL NULL values affect filters, joins, aggregates, UNIQUE rules, and NOT IN queries. Use DbSchema to inspect nullable columns and test fixes safely.
Learn SQL INSERT INTO SELECT with JOINs, filters, duplicate prevention, and transaction-safe data copy patterns for MySQL, PostgreSQL, and SQL Server.
Learn SQL JOINs with clear INNER, LEFT, RIGHT, FULL, CROSS, and SELF JOIN diagrams, examples, and FAQs. Build and test joins visually in DbSchema.
COUNT(*) counts every row including NULLs, COUNT(column) skips them, and SUM and AVG ignore NULL. SQL COUNT, AVG, SUM syntax with GROUP BY and HAVING.
Learn SQL foreign key syntax with examples, ON DELETE and ON UPDATE actions, composite keys, and how to add or drop constraints in MySQL, PostgreSQL, and SQL Server.
Learn what a primary key in SQL is, with syntax and examples for MySQL, PostgreSQL, and SQL Server, plus composite keys and primary key vs unique vs foreign key.
SQL TOP, LIMIT, FETCH FIRST n ROWS ONLY and ROWNUM compared engine by engine: syntax, worked examples and the pagination form for each.
Learn MongoDB CRUD operations with mongosh and DbSchema examples: insert, find, update, delete, bulk writes, projections, sorting, and filters.
Visualize a MongoDB database as a diagram in DbSchema: reverse-engineer collections, draw virtual relations, edit validation rules, export HTML5 documentation.