Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
SQL / POSTGRESQL / Learn / LESSON 01
INSERT adds rows. List columns explicitly: INSERT INTO items (id, name, category, qty, price) VALUES (...). Values follow the column list order. Every run starts from the displayed data — changes do not persist between attempts.
Small example:
INSERT INTO items (id, name, category, qty, price) VALUES (90, 'Demo', 'tools', 1, 1.00);
Starting tables for this task. Grading checks final state on other datasets too.
| id | name | category | qty | price |
|---|---|---|---|---|
| 1 | Pen | tools | 10 | 1.5 |
| 2 | Notebook | books | 5 | 3 |
| 3 | Mug | home | 2 | 8 |
| 4 | Sticker | NULL | 0 | 0.5 |
| 5 | Lamp | home | 1 | 25 |
| 6 | Book Atlas | books | 3 | 12 |
Expected verify columns: id, name, category, qty, price · row order is checked
Expected final state (displayed data):
Loading…INSERT adds rows. List columns explicitly: INSERT INTO items (id, name, category, qty, price) VALUES (...). Values follow the column list order. Every run starts from the displayed data — changes do not persist between attempts.
QUERY STANDBY
›