Home >Database >Mysql Tutorial >What is the sql command to add records to the database
The sql command to add records to the database is INSERT INTO.
(Recommended learning: mysql tutorial)
The syntax of the INSERT INTO statement
The INSERT INTO statement can be written in two forms, respectively Yes:
First form
There is no need to specify the column name to insert data, just provide the inserted value:
INSERT INTO table_name VALUES (value1,value2,value3,...);
Second form
Need to specify the column name and inserted value:
INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...);
Example:
insert into #tblInsert(Col1, Col2, Col3, Col4) values('张三', 30, 9850.5, 1); insert into #tblInsert(Col1, Col2, Col3, Col4) values('李四', 40, 10000, 0); insert into #tblInsert(Col1, Col2, Col3, Col4) values('王五', 50, 8753.15, 1);
The above is the detailed content of What is the sql command to add records to the database. For more information, please follow other related articles on the PHP Chinese website!