HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to SQL (SELECT)Tables (CREATE & INSERT)Filtering (WHERE)Sorting & LimitingAggregate FunctionsUpdate & DeleteJoins (JOIN)
REFERENCE
📖 Overview
🔎 Querying (SELECT)
🗃️ Creating a Table
✏️ Inserting & Modifying Data
INSERT INTOUPDATEDELETE
🧲 Filtering (WHERE)
🔢 Sorting & Limiting
📊 Aggregate Functions
🔗 Joins (JOIN)
SQL›REFERENCE›Inserting & Modifying Data
✏️

Inserting & Modifying Data

INSERT, UPDATE, DELETE.

CommandDescription
INSERT INTOInserts a row into the table.
UPDATEUpdates existing rows.
DELETEDeletes row(s).

INSERT INTO

Try it yourself →

Inserts a row into the table.

Syntax

INSERT INTO table VALUES (...);

Description

Adds new row(s). You can separate multiple rows with commas.

Example

CREATE TABLE k(id INTEGER, name TEXT);
INSERT INTO k VALUES (1, 'Alex'), (2, 'Linus');
SELECT COUNT(*) FROM k;

Expected output

2

When to use?

Inserting data.

UPDATE

Try it yourself →

Updates existing rows.

Syntax

UPDATE table SET column=value WHERE condition;

Description

Updates ALL rows without WHERE — watch out! You narrow down the target with WHERE.

Example

CREATE TABLE k(id INTEGER, name TEXT);
INSERT INTO k VALUES (1, 'Alex');
UPDATE k SET name='Alex L.' WHERE id=1;
SELECT name FROM k;

Expected output

Alex L.

When to use?

Updating records.

Common mistakes

  • ⚠️ UPDATE without WHERE modifies all rows — be very careful.

DELETE

Try it yourself →

Deletes row(s).

Syntax

DELETE FROM table WHERE condition;

Description

Deletes target rows with WHERE. Deletes ALL rows without WHERE.

Example

CREATE TABLE k(id INTEGER);
INSERT INTO k VALUES (1), (2), (3);
DELETE FROM k WHERE id=2;
SELECT COUNT(*) FROM k;

Expected output

2

When to use?

Deleting records.

Common mistakes

  • ⚠️ DELETE without WHERE empties the entire table.
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code