当前位置:网站首页>【作业】2022.5.23 MySQL入门
【作业】2022.5.23 MySQL入门
2022-06-30 03:27:00 【Sprite.Nym】
create table tb_college
(
college_id int comment '学院编号',
college_name varchar(15) not null comment '学院名称',
college_desc varchar(1000) comment '学院介绍',
college_birth date comment '学院成立日期',
college_url varchar(100) comment '学院网址',
primary key (college_id)
)engine=innodb comment '学院表';
create table tb_teacher
(
teacher_id int primary key comment '教师工号',
teacher_name varchar(30) not null comment '教师姓名',
teacher_gender boolean default 1 comment '教师性别',
teacher_title varchar(10) default '助教' comment '教师职称',
teacher_birth date comment '教师生日',
college__id int comment '学院编号',
foreign key(college__id) references tb_college(college_id)
on update cascade
on delete cascade
)engine=innodb comment '教师表';
create table tb_course
(
course_id int primary key comment '课程编号',
course_name varchar(15) not null comment '课程名',
course_score decimal(2,1) default 0.5 comment '课程学分',
course_semester int comment '开课学期',
course_teacher_id int,
course_college_id int,
foreign key(course_teacher_id) references tb_teacher(teacher_id)
on update cascade
on delete cascade,
foreign key(course_college_id) references tb_college(college_id)
on update cascade
on delete cascade
)engine=innodb comment '课程表';
*
开课学期用2位整数mn表示,十位m表示第m学年,个位n取0表示上学期,取1表示下学期
*
insert into tb_college(college_id, college_name, college_desc, college_birth, college_url) value(
'1',
'生物科学与工程学院',
'华南理工大学生物科学与工程学院于2004年成立,位于风景秀丽的华南理工大学大学城校区。学院拥有独立的教学科研大楼,设施完备,占地面积15000平方米,为学科建设和发展提供了很好的空间。 目前,在校生1023人,其中,本科生483人,研究生540人;学院教职工总数为75人,其中教师系列55人,教授25人,副教授26人,副高以上职称人数占专任教师总人数的93%;具有博士学位占教师总数的98%;含双聘院士1人、长江学者特聘教授1人、国家重点研发专项首席3名;现有生物学一级学科(含生物化学与分子生物学、细胞生物学、微生物学、生物物理与生理学、医药生物学二级学科)和发酵工程二级学科硕博士点,生物工程和药学专业学位硕士学位点,以及生物工程、生物技术和生物制药三个本科专业。以学院主力的“生物学与生物化学”进入全球前1%的排名。',
'2004-01-01',
'http://www2.scut.edu.cn/biology/main.htm'
);
insert into tb_college(college_id, college_name, college_desc, college_birth, college_url) value(
'2',
'机械与汽车工程学院',
'华南理工大学机械与汽车工程学院位于广州市天河区五山校区西湖边,组建于2008年1月,由原机械工程学院、工业装备与控制工程学院、汽车工程学院三个学院合并而成,是华南理工大学规模最大的学院之一。学院办学历史悠久,最早可以追溯到1918年成立的广东省立第一甲种工业学校机械科。 学院设有机械制造工程系、机械电子工程系、机械学系、汽车工程系、工业装备与控制工程系、高分子材料先进制造技术与装备研究所、金属材料制备成形及装备研究所、工程训练中心等教学与科研行政机构,拥有教学、科研和办公用房面积3.78万平方米,各类科学仪器设备近2万台。拥有2个国家工程研究中心、1个国家工程实验室,2个国家地方联合工程实验室,23个省部级科研基地、3个国家级实验教学示范中心。',
'2008-01-01',
'http://www2.scut.edu.cn/smae/main.htm'
);
insert into tb_teacher(teacher_id, teacher_name, teacher_gender, teacher_title, teacher_birth) values(
'1001',
'王菊芳',
'0',
'教授',
'1973-09-01'
),
(
'1002',
'林影',
'0',
'教授',
'1962-06-01'
),
(
'1003',
'潘力',
'1',
'教授',
'1954-01-01'
),
(
'1004',
'郑穗平',
'1',
'教授',
'1972-01-01'
),
(
'1005',
'韩双艳',
'0',
'教授',
'1976-06-01'
)
;
update tb_teacher set college__id = 1 where teacher_id = 1001;
update tb_teacher set college__id = 1 where teacher_id = 1002;
update tb_teacher set college__id = 1 where teacher_id = 1003;
update tb_teacher set college__id = 1 where teacher_id = 1004;
update tb_teacher set college__id = 1 where teacher_id = 1005;
*
忘了加学院编号。。。一个个补回来。。。
*
insert into tb_course(course_id, course_name, course_score, course_semester, course_teacher_id, course_college_id) values(
'100001',
'微生物学实验',
'2',
'21',
'1001',
'1'
),
(
'100002',
'细胞微生物学',
'1.5',
'50',
'1001',
'1'
),
(
'100003',
'微生物药物学',
'2.5',
'51',
'1001',
'1'
),
(
'100004',
'酶工程',
'1',
'30',
'1002',
'1'
),
(
'100005',
'发酵工程',
'2',
'31',
'1002',
'1'
),
(
'100006',
'微生物组学',
'2',
'31',
'1002',
'1'
),
(
'100007',
'微生物学',
'4',
'21',
'1003',
'1'
),
(
'100008',
'微生物遗传学',
'4',
'60',
'1003',
'1'
),
(
'100009',
'生物化学',
'4',
'21',
'1004',
'1'
),
(
'100010',
'发酵工程',
'2',
'31',
'1004',
'1'
),
(
'100011',
'代谢工程',
'2',
'21',
'1004',
'1'
),
(
'100012',
'基因工程',
'4',
'21',
'1005',
'1'
),
(
'100013',
'免疫学',
'2',
'31',
'1005',
'1'
),
(
'100014',
'现代生化实验技术',
'1',
'30',
'1005',
'1'
)
;
*
如果一种课上的人数太多要分成多个老师上,就当做两门课添加进去,例如上面的'发酵工程'。
*
边栏推荐
- yarn的安装和使用
- Redis高并发分布式锁(学习总结)
- C#【高级篇】 C# 匿名方法【待补充Lambda表达式。。。】
- TiDB 6.0:让 TSO 更高效丨TiDB Book Rush
- Global and Chinese market for nasal drug delivery devices 2022-2028: Research Report on technology, participants, trends, market size and share
- Utf8 error in Oracle migration of Jincang Kingbase database
- [0x0] open questions left by the principal
- Is the largest layoff and salary cut on the internet coming?
- Global and Chinese market of medical mass notification system 2022-2028: Research Report on technology, participants, trends, market size and share
- 数据库的下一个变革方向——云原生数据库
猜你喜欢

Buffer pool of MySQL notes

Use of foreach in QT

golang bilibili直播弹幕姬

Redis high concurrency distributed locks (learning summary)

Tidb 6.0: rendre les GRT plus efficaces 丨 tidb Book Rush

laravel9本地安装

共124篇!墨天轮“高可用架构”干货文档分享(含Oracle、MySQL、PG)

编译一个无导入表的DLL

Auto.js学习笔记16:按项目保存到手机上,不用每次都保存单个js文件,方便调试和打包

Mathematical solution of Joseph Ring
随机推荐
SDS understanding in redis
JS conversion of letters and numbers
How to realize remote collaborative office, keep this strategy!
【常见问题】页面跨域和接口跨域
Usage record of unity input system (instance version)
Product thinking - is the future of UAV express worth looking forward to?
C#【高级篇】 C# 泛型(Generic)【需进一步补充:泛型接口、泛型事件的实例】
Simple custom MVC
行政路线编码 字母+数字的排序方式
MySQL performance optimization (5): principle and implementation of master-slave synchronization
Are you a "social bull" or a "social terrorist" in the interview?
Stc89c52/90c516rd/89c516rd DHT11 temperature and humidity sensor drive code
JS cross reference
HOOK Native API
The 5-year Android development interview took 20 days to join Alibaba
Redis中的SDS理解
X书6.89版本shield-unidbg调用方式
专升本高数(四)
Stc89c52/90c516rd/89c516rd ADC0832 ADC driver code
Number of students from junior college to Senior College (4)