0
0
MySQLquery~10 mins

INSERT INTO multiple rows in MySQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to insert multiple rows into the table 'students'.

MySQL
INSERT INTO students (name, age) VALUES [1];
Drag options to blanks, or click blank then click option'
A('Alice', 21)
B('Alice', 21), ('Bob', 22)
C('Alice'; 21), ('Bob'; 22)
D('Alice' 21), ('Bob' 22)
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons instead of commas between rows.
Omitting parentheses around each row's values.
2fill in blank
medium

Complete the code to insert three rows into the 'products' table with columns 'product_name' and 'price'.

MySQL
INSERT INTO products (product_name, price) VALUES [1];
Drag options to blanks, or click blank then click option'
A('Pen', 1.5), ('Notebook', 3.0), ('Eraser', 0.5)
B('Pen', 1.5); ('Notebook', 3.0); ('Eraser', 0.5)
C('Pen' 1.5), ('Notebook' 3.0), ('Eraser' 0.5)
D('Pen', 'Notebook', 'Eraser', 1.5, 3.0, 0.5)
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons instead of commas between rows.
Mixing column values incorrectly.
3fill in blank
hard

Fix the error in the code to correctly insert multiple rows into 'employees' with columns 'first_name' and 'last_name'.

MySQL
INSERT INTO employees (first_name, last_name) VALUES [1];
Drag options to blanks, or click blank then click option'
A('John', 'Doe'), ('Jane', 'Smith')
B('John' 'Doe'), ('Jane' 'Smith')
C('John', 'Doe'; 'Jane', 'Smith')
D('John', 'Doe'), ('Jane' 'Smith')
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons instead of commas between rows.
Omitting commas between values inside parentheses.
4fill in blank
hard

Fill both blanks to insert multiple rows into 'orders' with columns 'order_id' and 'amount'.

MySQL
INSERT INTO orders (order_id, amount) VALUES [1], [2];
Drag options to blanks, or click blank then click option'
A('1001', 250)
B('1002', 300)
C,
D;
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons instead of commas between rows.
Omitting parentheses around each row.
5fill in blank
hard

Fill both blanks to insert multiple rows into 'inventory' with columns 'item', 'quantity', and 'price'.

MySQL
INSERT INTO inventory (item, quantity, price) VALUES [1] , [2];
Drag options to blanks, or click blank then click option'
A('Chair', 5, 45.0)
B,
C('Table', 2, 150.0)
D('Lamp', 10, 20.0)
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolons instead of commas between rows.
Missing commas between rows.
Adding a comma after the last row.