insert into table with values in sql database tables

Insert into table values

The insert into sql statement is used to insert data into tables of SQL databases. You can insert data by specifying column names or without column names in SQL insert into – values statement.

Syntax of Insert into values sql statement

The general syntax of SQL insert into statement with values:


Where insert into statement is followed by name of table where you are intended to insert data. After table name, fields or column names of table in parenthesis.

Lastly values of those columns or fields in same sequence as column names are.

This is one way of using insert into statement. The other way of using insert statement is without column names:


That is, you can only provide insert into with values without giving column names.

Example of insert into – values statement with column names

We have a table tbl_employee with five columns (emp_id, emp_name, emp_age, emp_salary and joining_date). Now let us insert rows into tbl_employee by using insert into statements and specifying column names.

Insert into values with column names example

See graphic of this example


Example of insert into statement without column names

In examples below we will insert a row without specifying column names. As mentioned above the order of values must correspond to column names in table.


Was this article helpful?

Related Articles

Leave A Comment?