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.
Create an ER diagram from an existing database: connect DbSchema, import the schemas, then add and check the relationships that the database never declared.
Learn PostgreSQL JSONB operators, GIN indexes, path queries, and update patterns. Explore and document JSONB structures visually in DbSchema.
List PostgreSQL schemas with psql, information_schema, and pg_namespace. Filter system schemas, inspect search_path, and browse them in DbSchema.
Learn PostgreSQL CREATE PROCEDURE from short examples with their results: CALL, IN, OUT and INOUT parameters, COMMIT inside a procedure, and EXCEPTION.
PostgreSQL schema design with ER diagrams: create a schema, add tables and columns, set foreign keys, and generate documentation in DbSchema.
psql commands for PostgreSQL 18: connect and switch databases, list tables and roles, read privileges, export rows, dump and restore, find the session holding a lock.
Add a foreign key to a PostgreSQL table that already holds rows: ADD CONSTRAINT, NOT VALID, VALIDATE CONSTRAINT, ON DELETE CASCADE, RESTRICT, locks and the child-column index.
Describe a PostgreSQL table with psql and SQL metadata queries. See columns, defaults, constraints, indexes, and inspect structure in DbSchema.
Learn SQLite joins from short examples with their results: INNER, LEFT, RIGHT, FULL OUTER and CROSS JOIN, USING, the 3.39.0 version boundary, and the rewrite for older SQLite.
Read the schema of an undocumented SQLite file from sqlite_master and the PRAGMA functions, find the relationships it never declared, and check the stored types.