CREATE TABLE `history` ( `ds` datetime NOT NULL COMMENT '日期', `confirm` int(11) DEFAULT NULL COMMENT '累计确诊', `confirm_add` int(11) DEFAULT NULL COMMENT '当日新增确诊', `suspect` int(11) DEFAULT NULL COMMENT '剩余疑似', `suspect_add` int(11) DEFAULT NULL COMMENT '当日新增疑似', `heal` int(11) DEFAULT NULL COMMENT '累计治愈', `heal_add` int(11) DEFAULT NULL COMMENT '当日新增治愈', `dead` int(11) DEFAULT NULL COMMENT '累计死亡', `dead_add` int(11) DEFAULT NULL COMMENT '当日新增死亡', PRIMARY KEY (`ds`) USING BTREE
时间: 2023-07-15 15:11:48 浏览: 54
这是一个 MySQL 数据库的表定义语句,用于创建一个名为 history 的表,包含了日期、累计确诊、当日新增确诊、剩余疑似、当日新增疑似、累计治愈、当日新增治愈、累计死亡和当日新增死亡等9个字段。其中,ds 字段为日期类型,其他字段均为整型。PRIMARY KEY (`ds`) USING BTREE 表示将 ds 字段作为主键,并使用 B树索引。
相关问题
create_time DATETIME NOT NULL DEFAULT CURRENT TIMESTAMP COMMENT'创建时间',
在你的SQL语句中,'CURRENT TIMESTAMP'应该是'CURRENT_TIMESTAMP',两者之间应该没有空格,这样才能正确地使用当前的时间作为默认值。同时,'COMMENT'前后应该各有一个空格,这样才能正确地将其识别为列的注释信息。修正后的语句如下:
```
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
```
CREATE TABLE `details` ( `id` int(11) NOT NULL AUTO_INCREMENT, `update_time` datetime DEFAULT NULL COMMENT '数据最后更新时间', `province` varchar(50) DEFAULT NULL COMMENT '省', `city` varchar(50) DEFAULT NULL COMMENT '市', `confirm` int(11) DEFAULT NULL COMMENT '累计确诊', `confirm_add` int(11) DEFAULT NULL COMMENT '新增治愈', `heal` int(11) DEFAULT NULL COMMENT '累计治愈', `dead` int(11) DEFAULT NULL COMMENT '累计死亡', PRIMARY KEY (`id`)
这是一个MySQL语句,用于创建一个名为`details`的表。该表包含以下字段:
- `id`: 自增长的整数型主键
- `update_time`: datetime类型,记录数据最后更新时间
- `province`: varchar(50)类型,记录省份信息
- `city`: varchar(50)类型,记录城市信息
- `confirm`: int(11)类型,记录累计确诊人数
- `confirm_add`: int(11)类型,记录新增治愈人数
- `heal`: int(11)类型,记录累计治愈人数
- `dead`: int(11)类型,记录累计死亡人数
每个字段的默认值为`NULL`,并且`id`字段为主键,自动增长。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)