Introduction
We use INSERT INTO multiple rows to add many new records to a table in one simple step. This saves time and keeps the data organized.
INSERT INTO table_name (column1, column2, column3) VALUES (value1a, value2a, value3a), (value1b, value2b, value3b), (value1c, value2c, value3c);
INSERT INTO students (name, age) VALUES ('Alice', 20), ('Bob', 22), ('Charlie', 19);
INSERT INTO products (product_name, price, stock) VALUES ('Pen', 1.5, 100), ('Notebook', 3.0, 50);
CREATE TABLE employees ( id INT PRIMARY KEY, name VARCHAR(50), department VARCHAR(50) ); INSERT INTO employees (id, name, department) VALUES (1, 'John Doe', 'Sales'), (2, 'Jane Smith', 'Marketing'), (3, 'Emily Davis', 'HR'); SELECT * FROM employees;
INSERT INTO table_name (col1, col2) VALUES (1, 'A'), (2, 'B'); do?students with columns id and name?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;
INSERT INTO employees (id, name) VALUES (1, 'John'); (2, 'Jane');
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?Pass the test and this pattern moves unknown