SQL INSERT INTO Statement
SQL INSERT INTO Statement
Syntax 1
You can sequentially insert values into columns according to table structure without
mentioning column names.
INSERT INTO TableName
VALUES (value1, value2, …, valueN)
Syntax 2
You can mention specific columns and their values to insert in table.
INSERT INTO TableName (column1, column2, …, columnN)
VALUES (value1, value2, …, valueN)
You can use specific syntax according to your business requirements. We will see couple
of examples how to use INSERT INTO statements.
We will use Student table to insert records. You can refer Student table as given below.
SQL query to insert record in Student table is:
We will take one more example where we will try to insert specific column values for
RollNumber, FirstName and LastName.