MySQL Insert Statement

SQL Insert Statement is use to add data/row/record in the table.

Example 1: Insert command with all values which are mentioned in the table.

INSERT INTO student VALUES (5, 'Adam', '1995-05-15', '9876543210', 'Delhi');

Mention the field values in the same order in which they are stored in the sql table.

Example 2: Insert command with only specified field values.

INSERT INTO student (name, dob, phone) VALUES ('Adam', '1995-05-15', '9876543210');

MySQL - Copy data

To copy the data from one table into another, use the following command.

INSERT INTO new_table SELECT * FROM original_table;

Structure of both the table must be same.