Hint: Use VALUES with comma-separated rows, no AND or SET [OK]
Common Mistakes:
Using semicolons between value sets
Using AND instead of commas
Using SET keyword incorrectly
3. Given the table products(id INT, name VARCHAR(20)), what will be the result of this query?
INSERT INTO products (id, name) VALUES (1, 'Pen'), (2, 'Pencil'), (3, 'Eraser'); SELECT * FROM products;
medium
A. No rows will be added because SELECT does not insert data.
B. Only one row with id 3 and name Eraser will be added.
C. The query will cause a syntax error.
D. Three new rows with ids 1, 2, 3 and names Pen, Pencil, Eraser will be added.
Solution
Step 1: Analyze the INSERT statement
The INSERT adds three rows with given ids and names in one command.
Step 2: Understand the SELECT statement
SELECT * FROM products will show all rows including the newly inserted ones.
Final Answer:
Three new rows with ids 1, 2, 3 and names Pen, Pencil, Eraser will be added. -> Option D
Quick Check:
Multiple VALUES sets insert multiple rows [OK]
Hint: INSERT adds all rows; SELECT shows them all [OK]
Common Mistakes:
Thinking only last row inserts
Confusing SELECT with INSERT
Expecting syntax error due to multiple rows
4. Identify the error in this SQL statement:
INSERT INTO employees (id, name) VALUES (1, 'John'); (2, 'Jane');
medium
A. Using semicolon between value sets causes syntax error.
B. Missing column names in the statement.
C. VALUES keyword is missing.
D. Using single quotes around names is invalid.
Solution
Step 1: Check punctuation between value sets
Multiple rows must be separated by commas, not semicolons.
Step 2: Confirm correct use of VALUES and quotes
VALUES keyword is present and single quotes for strings are correct.
Final Answer:
Using semicolon between value sets causes syntax error. -> Option A
Quick Check:
Use commas, not semicolons, between multiple VALUES [OK]
Hint: Separate multiple rows with commas, not semicolons [OK]
Common Mistakes:
Using semicolons instead of commas
Omitting column list when required
Misusing quotes around strings
5. You want to insert multiple rows into a table orders(order_id, product, quantity) but only have values for product and quantity. Which query correctly inserts three rows with products and quantities, letting order_id auto-increment?
hard
A. INSERT INTO orders (product, quantity) VALUES ('Book', 2), ('Pen', 5), ('Notebook', 3);
B. INSERT INTO orders VALUES ('Book', 2), ('Pen', 5), ('Notebook', 3);
C. INSERT INTO orders (order_id, product, quantity) VALUES (NULL, 'Book', 2), ('Pen', 5), ('Notebook', 3);
D. INSERT INTO orders (product, quantity) VALUES ('Book', 2); ('Pen', 5); ('Notebook', 3);
Solution
Step 1: Use column list excluding auto-increment column
Specify only product and quantity columns to let order_id auto-fill.
Step 2: Provide multiple value sets separated by commas
INSERT INTO orders (product, quantity) VALUES ('Book', 2), ('Pen', 5), ('Notebook', 3); correctly uses VALUES with comma-separated tuples.
Final Answer:
INSERT INTO orders (product, quantity) VALUES ('Book', 2), ('Pen', 5), ('Notebook', 3); -> Option A
Quick Check:
Omit auto-increment column, list others, use commas [OK]
Hint: List columns except auto-increment, separate rows with commas [OK]
Common Mistakes:
Omitting column list when not providing all columns
Using semicolons between rows
Inserting NULL explicitly for auto-increment column
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.