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.
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

WhatsApp