MySQL + SQL · Lesson 42
INSERT INTO Command
INSERT INTO
The INSERT command adds new rows to a table.
INSERT INTO students (roll_no, name, marks)
VALUES (1, 'Aman', 88);
Insert Multiple Rows
INSERT INTO students (roll_no, name, marks) VALUES
(2, 'Riya', 91),
(3, 'Karan', 76);3 rows inserted in one command.
Tips
- Column list is optional if you give values for all columns in order.
- Text values go in single quotes; numbers do not.
Summary
- INSERT INTO table (cols) VALUES (...).
- Multiple rows can be inserted in one statement.