INSERT into statement
The INSERT INTO statement is used to insert a new row into the table.
Grammar
INSERT into table name values (value 1, value 2,....)
We can also specify the columns for which you want to insert data:
INSERT into table_name (column 1, column 2,...) Values (value 1, value 2,....)
Insert a new line "Persons" table:
LastName |
FirstName |
Address |
| City
Carter |
Thomas |
Changan Street |
Beijing |
SQL statements:
INSERT into Persons VALUES (' Gates ', ' Bill ', ' xuanwumen ', ' Beijing ')
Results:
LastName |
FirstName |
Address |
| City
Carter |
Thomas |
Changan Street |
Beijing |
Gates |
Bill |
Xuanwumen 10 |
Beijing |
Insert the data "Persons" table in the specified column:
LastName |
FirstName |
Address |
| City
Carter |
Thomas |
Changan Street |
Beijing |
Gates |
Bill |
Xuanwumen 10 |
Beijing |
SQL statements:
INSERT into Persons (LastName, Address) VALUES (' Wilson ', ' champs-elysees ')
Results:
LastName |
FirstName |
Address |
| City
Carter |
Thomas |
Changan Street |
Beijing |
Gates |
Bill |
Xuanwumen 10 |
Beijing |
Wilson |
|
Champs-elysees |
|
SQL INSERT into statement