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.
💻 Live Code Editor
This page's programs are ready here — run them, edit them, and learn. No installation needed.
Powered by OneCompiler. The code loads into the editor automatically — press Run to see the output. If the editor does not open, open it in a new tab.