INSERT Statement in SQL

Level 4107 keystrokes

INSERT INTO adds one new row to a table, with a value for each listed column.

SQL code

-- Add a row to the products table
1INSERT INTO
-- List the columns to fill; columns not listed get their default value
2 products (name, price, category, created_at)
-- VALUES gives the data in the same order as the column list
3VALUES (
-- name, price and category values
4 'Laptop',
5 999.99,
6 'Electronics',
-- NOW() fills created_at with the current date and time
7 NOW()
8);

Output

Query OK, 1 row affected
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this SQL code and how often they appear.

  • ,× 6
  • '× 4
  • (× 3
  • )× 3
  • _× 1
  • ;× 1
  • .× 1

More SQL examples at level 4

← SQL typing practice