床位表字段名称改成英文的
时间: 2023-08-28 10:06:48 浏览: 141
修改后的MySQL脚本:
```mysql
-- 创建床位表
CREATE TABLE IF NOT EXISTS bed_info (
ID INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '床位表的唯一标识符',
Bed_Number INT UNSIGNED NOT NULL COMMENT '床位编号',
Room_Number INT UNSIGNED NOT NULL COMMENT '房间编号',
Elderly_Name VARCHAR(100) NOT NULL COMMENT '老人名称',
Status CHAR(2) NOT NULL COMMENT '床位状态',
Created_Time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
Modified_Time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (ID),
UNIQUE KEY (Bed_Number, Room_Number)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='床位表';
```
测试数据:
```mysql
-- 插入测试数据
INSERT INTO bed_info (Bed_Number, Room_Number, Elderly_Name, Status) VALUES
(1, 101, '张三', '空闲'),
(2, 101, '李四', '已占用'),
(3, 102, '王五', '已占用'),
(4, 102, '赵六', '空闲'),
(5, 103, NULL, '空闲');
```
阅读全文