How do you create a table in MySQL?

To create a table in MySQL, you can use the CREATE TABLE statement. Here is an example:

CREATE TABLE 表名 (
   列1 数据类型,
   列2 数据类型,
   ...
);

In this case, the table name is the name of the table you want to create, column1, column2, etc. are the column names within the table, and the data type refers to the type of data stored in each column.

For example, to create a table named “users” with columns id (integer type), name (string type), and age (integer type), you can use the following code:

CREATE TABLE users (
   id INT,
   name VARCHAR(50),
   age INT
);

This will create a table named “users” in MySQL, with three columns: id, name, and age.

bannerAds