Recall & Review
beginner
What does the SQL statement
INSERT INTO do?It adds new rows of data into a table in the database.
Click to reveal answer
beginner
How do you insert multiple rows in one SQL statement?
Use
INSERT INTO table_name (columns) VALUES (row1), (row2), (row3); listing each row's values separated by commas.Click to reveal answer
intermediate
Why insert multiple rows at once instead of one by one?
It is faster and uses fewer resources because the database processes one command instead of many.
Click to reveal answer
beginner
Write a simple example to insert two rows into a table named
students with columns id and name.INSERT INTO students (id, name) VALUES (1, 'Alice'), (2, 'Bob');
Click to reveal answer
intermediate
What happens if you try to insert rows with duplicate primary keys?
The database will return an error and will not insert any of the rows.
Click to reveal answer
Which SQL keyword is used to add new rows to a table?
✗ Incorrect
The
INSERT INTO statement adds new rows to a table.How do you separate multiple rows in an
INSERT INTO statement?✗ Incorrect
Multiple rows are separated by commas inside the
VALUES clause.What is the benefit of inserting multiple rows in one statement?
✗ Incorrect
Inserting multiple rows at once is faster and uses fewer resources.
Which of these is a correct syntax to insert two rows into a table named
users?✗ Incorrect
Option C correctly inserts two rows in one statement using commas.
What error occurs if you insert rows with duplicate primary keys?
✗ Incorrect
The database throws a duplicate key error and rejects the insert.
Explain how to insert multiple rows into a MySQL table in one statement.
Think about how you add items to a shopping list separated by commas.
You got /4 concepts.
Describe why inserting multiple rows at once is better than inserting one row at a time.
Imagine carrying many groceries in one trip instead of many trips.
You got /4 concepts.