Home > Database > Mysql Tutorial > body text

What is the code to add records to mysql database?

青灯夜游
Release: 2020-11-03 10:26:30
Original
3600 people have browsed it

Mysql database adding record code is "INSERT INTO table name (column name 1, column name 2,... column name n) VALUES (value 1, value 2,... value n);"; when inserting data, The column names following the INSERT statement do not need to be inserted in the order defined by the table, as long as the order of the values ​​is the same as the order of the column fields.

What is the code to add records to mysql database?

(Recommended tutorial: mysql video tutorial)

How to add records to mysql database

In MySQL, you can use the INSERT statement to insert one or more rows of records into an existing table in the database.

Grammar format

INSERT INTO 表名 (列名1,列名2,…列名n)
VALUES (值1,值2,…值n);
Copy after login

The syntax description is as follows.