sqlcmd.net validated sql reference
beginner inserting MySQL MariaDB SQL Server PostgreSQL SQLite

Insert a Row

Add new data to a table, then verify the inserted row with a deterministic query.

Docker-validated Not currently validation-green

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.

MySQL MariaDB SQLite
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;
idname
1Atlas
2Beacon
SQL Server PostgreSQL
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;
idname
1Atlas
2Beacon

The verification output is the same, but the executable setup and run blocks differ to keep the captured result deterministic.

Where this command helps.

  • creating a new business record from application input
  • seeding a small dataset for a later query example

What the command is doing.

Use INSERT INTO ... VALUES (...) to create new rows. For teaching content, follow the insert with a simple SELECT so readers can see the resulting state clearly.