Example 1
Insert one row and read it back
This example focuses on the table state after insertion rather than the command status message, which can differ more across engines and drivers.
Engine-specific syntax
Setup
CREATE TABLE projects (id INT, name VARCHAR(50));
INSERT INTO
projects (id, name)
VALUES
(1, 'Atlas');SQL
INSERT INTO
projects (id, name)
VALUES
(2, 'Beacon');
SELECT
id,
name
FROM
projects
ORDER BY
id;| id | name |
|---|---|
| 1 | Atlas |
| 2 | Beacon |
Engine-specific syntax
Setup
CREATE TABLE projects (id INT, name VARCHAR(50));
INSERT INTO
projects (id, name)
VALUES
(1, 'Atlas');
INSERT INTO
projects (id, name)
VALUES
(2, 'Beacon');SQL
SELECT
id,
name
FROM
projects
ORDER BY
id;| id | name |
|---|---|
| 1 | Atlas |
| 2 | Beacon |
The verification output is the same, but the executable setup and run blocks differ to keep the captured result deterministic.