mysql 编写一个建表语句
时间: 2023-09-04 13:15:57 浏览: 85
Excel生成MYSQL建表语句
Sure, here is an example of a MySQL table creation statement:
```
CREATE TABLE users (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(30) NOT NULL,
email VARCHAR(50) NOT NULL,
age INT(3),
gender ENUM('male', 'female', 'other')
);
```
This creates a table named "users" with columns for ID, username, email, age, and gender. The ID column is set to auto-increment and serves as the primary key, while the rest of the columns have data type and null/not null constraints specified.
阅读全文