Create a new related table with constraints and watch both the Tables sidebar and the SVG ER diagram update automatically.
{"schema":"dblab-v1","dataset":"skola","customSchemaSql":"","starterSql":"CREATE TABLE sekcije (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n naziv TEXT NOT NULL UNIQUE,\n vodja_id INTEGER NOT NULL,\n max_clanova INTEGER NOT NULL CHECK (max_clanova BETWEEN 5 AND 50),\n FOREIGN KEY (vodja_id) REFERENCES ucenici(id)\n);\n\nINSERT INTO sekcije (naziv, vodja_id, max_clanova) VALUES ('Robotika', 1, 20);\nSELECT * FROM sekcije;","mode":"sandbox","ui":{"showSchemaTree":true,"showErDiagram":true,"allowStepper":true,"maxRows":500}}Try this
- Open ER diagram first, then click Run SQL: the new
sekcije table and its foreign-key arrow to ucenici appear immediately. - Try inserting a row with
max_clanova = 2 to see SQLite enforce the CHECK constraint.
Last modified: Wednesday, 2 December 2026, 8:23 PM