CodeBlanks Logo Icon CodeBlanks

Summary - INSERT

Transfer data with single and multi-row INSERT.

Summary - INSERT

In this group you learned INSERT basics, multi-row, INSERT SELECT and DEFAULT. Adding data is now easy.

INSERT INTO products (id, name, price)
VALUES (7, 'Kitap', 30), (8, 'Defter', 12);

This query adds two products in one query.

The values given with VALUES are inserted into products as new rows.

Practice Summary - INSERT

Insert id=9, name='Pen', price=5 into products.

Starter code

query.sql
-- summary insert
INSERT INTO products
VALUES

Sample solution

query.sql
INSERT INTO products (id, name, price)
VALUES (9, 'Kalem', 5)

Expected output

1 satır eklendi

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What separates value sets in multi-row insert?

  • A semicolon
  • A colon
  • A comma Correct answer
  • A space

Explanation: Value sets are separated by commas.

2 Summary - INSERT: match the terms

Term Meaning
INSERT insert
VALUES values
SELECT select
DEFAULT default

All lessons in Beginner