Home >Common Problem >Can the create statement be used to create a table structure and append new records?
cannot. The function of the CREATE statement is to create a table structure, but it cannot append new records. You can use the INSERT statement to append new records. The CREATE statement can be used to create a new table in the database and specify the attributes and constraints of the data columns; however, the newly created table is an empty table and requires the use of the INSERT statement to append new records. The INSERT statement is used to insert one or more rows of tuple data into an existing table in the database.
The operating environment of this tutorial: windows7 system, mysql8, Dell G3 computer.
"The create statement is used to create a table structure and append new records" is wrong.
The function of the CREATE statement is to create a table structure, but it cannot append new records. You can use the INSERT statement to append new records.
CREATE statement
The CREATE statement can be used to create a new table in the database; the process of creating a data table specifies the attributes of the data columns The process is also the process of enforcing data integrity (including entity integrity, referential integrity and domain integrity) constraints.
The syntax format for creating a table is:
CREATE TABLE <表名> ([表定义选项])[表选项][分区选项];
Among them, the format of [Table definition option] is:
<列名1> <类型1> [,…] <列名n> <类型n>
CREATE TABLE command syntax is more, among which It is mainly composed of table creation definition (create-definition), table options (table-options) and partition options (partition-options).
Here we first describe a simple example of creating a new table, and then focus on some main syntax knowledge points in the CREATE TABLE command.
The main syntax and usage instructions of the CREATE TABLE statement are as follows:
CREATE TABLE: used to create a table with a given name, you must have table CREATE permissions.
The above is the detailed content of Can the create statement be used to create a table structure and append new records?. For more information, please follow other related articles on the PHP Chinese website!