Auto commit

This commit is contained in:
smallkun 2025-03-17 19:47:22 +08:00
parent 86d4341146
commit d76940406d

View File

@ -261,6 +261,38 @@ GROUP BY d.depid, e.sex;
![image-20250315225818026](https://yp.smallkun.cn/markdown/image-20250315225818026.png!compress)
```sql
#1
CREATE DATABASE test_school DEFAULT CHARACTER SET 'UTF8';
#2
DROP TABLE department;
CREATE TABLE department(
depNo INT(10) PRIMARY KEY COMMENT '部门号',
depName VARCHAR(50) NOT NULL COMMENT '部门名称',
depNote VARCHAR(20) COMMENT '部门备注'
);
CREATE TABLE teacher(
number INT PRIMARY KEY COMMENT '教工号',
`name` VARCHAR(30) NOT NULL COMMENT '姓名',
sex VARCHAR(4) COMMENT '性别',
birth DATE COMMENT '出生日期',
depNo INT COMMENT '部门号',
salary FLOAT COMMENT '工资',
address VARCHAR(100) COMMENT '家庭住址'
);
INSERT INTO department()
VALUES
(601, '软件技术系', '软件技术等专业'),
(602, '网络技术系', '多媒体技术等专业'),
(603, '艺术设计系', '广告艺术设计等专业'),
(604, '管理工程系', '连锁经营管理等专业');
INSERT INTO teacher()
VALUES
(2001, 'Tom', '女', '1970-01-10', 602, 4500, '四川省绵阳市'),
(2002, 'Lucy', '男', '1983-12-18', 601, 2500, '北京市昌平区'),
(2003, 'Mike', '男', '1990-06-01', 604, 1500, '重庆市渝中区'),
(2004, 'James', '女', '1980-10-20', 602, 3500, '四川省成都市'),
(2005, 'Jack', '男', '1975-05-30', 603, 1200, '重庆市南岸区');
```
![image-20250315225829272](https://yp.smallkun.cn/markdown/image-20250315225829272.png!compress)