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.
Show tables in PostgreSQL with \dt, \dt+, and SQL queries against information_schema or pg_catalog. Filter by schema, include sizes, and list all objects.
Learn the SQLite constraints on one customers and orders example: PRIMARY KEY, NOT NULL, DEFAULT, UNIQUE, CHECK and FOREIGN KEY, with the error each one returns.
Learn SQLite CREATE TABLE on one products table: PRIMARY KEY, NOT NULL, DEFAULT, type affinity, STRICT, FOREIGN KEY, IF NOT EXISTS, AUTOINCREMENT and CREATE TABLE AS.
The MySQL statement that drops each kind of constraint, with the errors that MySQL 5.7, 8.0 and 9.1 return and the query that finds a constraint's name.
Draw an ER diagram of a MySQL database: connect DbSchema and import the schema, read the line ends, find the foreign keys that MyISAM never stored, or design new tables.
Document a MySQL schema in six steps: write table and column comments, reverse-engineer the schema into DbSchema, split it into diagrams and export one HTML5 file.
Learn MySQL CREATE TRIGGER from short examples with their results: BEFORE INSERT, OLD and NEW, BEGIN END with DELIMITER, SIGNAL, AFTER DELETE, and the errors to expect.
The default MySQL username is root, and there is no default password. See what the password of root is for each kind of installation, and how to reset it.
Learn MySQL CREATE DATABASE step by step: IF NOT EXISTS, character set and collation, USE, SHOW CREATE DATABASE, ALTER and DROP DATABASE, and an account for one database.
dbdiagram.io alternatives that read the schema from your database: DbSchema, Azimutt and SqlDBM, compared with ChartDB, Lucidchart, DrawSQL and the db2dbml command.