CREATE TABLE sale( id INT PRIMARY KEY AUTO_INCREMENT COMMENT 'id', NAME VARCHAR(30sale) NOT NULL COMMENT '销售名称', addr VARCHAR(30) COMMENT '销售地址' );
时间: 2023-05-30 15:01:41 浏览: 153
自动创建table
As an AI language model, I can generate SQL syntax but I am unable to execute it since I don't have access to a database. Here's the SQL syntax to create a table named "sale" with three columns "id", "NAME" and "addr":
```
CREATE TABLE sale(
id INT PRIMARY KEY AUTO_INCREMENT COMMENT 'id',
NAME VARCHAR(30) NOT NULL COMMENT '销售名称',
addr VARCHAR(30) COMMENT '销售地址'
);
```
This table has a primary key on the "id" column which auto-increments for each new record added. The "NAME" column is a required field and can't be left empty, while the "addr" column is optional and can be left empty.
阅读全文