@@ -243,55 +243,55 @@ MySQL在过去由于性能高、成本低、可靠性好,已经成为最流行
243
243
-- 创建学院表
244
244
create table tb_college
245
245
(
246
- collid int auto_increment comment ' 编号' ,
247
- collname varchar(50) not null comment ' 名称' ,
248
- intro varchar(500) default ' ' comment ' 介绍' ,
246
+ collid int auto_increment comment ' 编号' ,
247
+ collname varchar(50) not null comment ' 名称' ,
248
+ collintro varchar(500) default ' ' comment ' 介绍' ,
249
249
primary key (collid)
250
250
);
251
251
252
252
-- 创建学生表
253
253
create table tb_student
254
254
(
255
- stuid int not null comment ' 学号' ,
256
- stuname varchar(20) not null comment ' 姓名' ,
257
- sex boolean default 1 comment ' 性别' ,
258
- birth date not null comment ' 出生日期' ,
259
- addr varchar(255) default ' ' comment ' 籍贯' ,
260
- collid int not null comment ' 所属学院' ,
255
+ stuid int not null comment ' 学号' ,
256
+ stuname varchar(20) not null comment ' 姓名' ,
257
+ stusex boolean default 1 comment ' 性别' ,
258
+ stubirth date not null comment ' 出生日期' ,
259
+ stuaddr varchar(255) default ' ' comment ' 籍贯' ,
260
+ collid int not null comment ' 所属学院' ,
261
261
primary key (stuid),
262
262
foreign key (collid) references tb_college (collid)
263
263
);
264
264
265
265
-- 创建教师表
266
266
create table tb_teacher
267
267
(
268
- teaid int not null comment ' 工号' ,
269
- teaname varchar(20) not null comment ' 姓名' ,
270
- title varchar(10) default ' 助教' comment ' 职称' ,
271
- collid int not null comment ' 所属学院' ,
268
+ teaid int not null comment ' 工号' ,
269
+ teaname varchar(20) not null comment ' 姓名' ,
270
+ teatitle varchar(10) default ' 助教' comment ' 职称' ,
271
+ collid int not null comment ' 所属学院' ,
272
272
primary key (teaid),
273
273
foreign key (collid) references tb_college (collid)
274
274
);
275
275
276
276
-- 创建课程表
277
277
create table tb_course
278
278
(
279
- couid int not null comment ' 编号' ,
280
- couname varchar(50) not null comment ' 名称' ,
281
- credit int not null comment ' 学分' ,
282
- teaid int not null comment ' 授课老师' ,
279
+ couid int not null comment ' 编号' ,
280
+ couname varchar(50) not null comment ' 名称' ,
281
+ coucredit int not null comment ' 学分' ,
282
+ teaid int not null comment ' 授课老师' ,
283
283
primary key (couid),
284
284
foreign key (teaid) references tb_teacher (teaid)
285
285
);
286
286
287
287
-- 创建选课记录表
288
288
create table tb_record
289
289
(
290
- recid int auto_increment comment ' 选课记录编号' ,
291
- sid int not null comment ' 选课学生' ,
292
- cid int not null comment ' 所选课程' ,
293
- seldate datetime default now () comment ' 选课时间日期' ,
294
- score decimal(4,1) comment ' 考试成绩' ,
290
+ recid int auto_increment comment ' 选课记录编号' ,
291
+ sid int not null comment ' 选课学生' ,
292
+ cid int not null comment ' 所选课程' ,
293
+ seldate datetime default now () comment ' 选课时间日期' ,
294
+ score decimal(4,1) comment ' 考试成绩' ,
295
295
primary key (recid),
296
296
foreign key (sid) references tb_student (stuid),
297
297
foreign key (cid) references tb_course (couid),
@@ -548,13 +548,13 @@ MySQL在过去由于性能高、成本低、可靠性好,已经成为最流行
548
548
549
549
` ` ` SQL
550
550
-- 插入学院数据
551
- insert into tb_college (collname, intro ) values
551
+ insert into tb_college (collname, collintro ) values
552
552
(' 计算机学院' , ' 创建于1956年是我国首批建立计算机专业。学院现有计算机科学与技术一级学科和网络空间安全一级学科博士学位授予权,其中计算机科学与技术一级学科具有博士后流动站。计算机科学与技术一级学科在2017年全国第四轮学科评估中评为A;2019 U.S.News全球计算机学科排名26名;ESI学科排名0.945‰,进入全球前1‰,位列第43位。' ),
553
553
(' 外国语学院' , ' 1998年浙江大学、杭州大学、浙江农业大学、浙江医科大学四校合并,成立新的浙江大学。1999年原浙江大学外语系、原杭州大学外国语学院、原杭州大学大外部、原浙江农业大学公外部、原浙江医科大学外语教学部合并,成立浙江大学外国语学院。2003年学院更名为浙江大学外国语言文化与国际交流学院。' ),
554
554
(' 经济管理学院' , ' 四川大学经济学院历史悠久、传承厚重,其前身是创办于1905年的四川大学经济科,距今已有100多年的历史。已故著名经济学家彭迪先、张与九、蒋学模、胡寄窗、陶大镛、胡代光,以及当代著名学者刘诗白等曾先后在此任教或学习。在长期的办学过程中,学院坚持以马克思主义的立场、观点、方法为指导,围绕建设世界一流经济学院的奋斗目标,做实“两个伟大”深度融合,不断提高党的建设质量与科学推进一流事业深度融合。' );
555
555
556
556
-- 插入学生数据
557
- insert into tb_student (stuid, stuname, sex, birth, addr , collid) values
557
+ insert into tb_student (stuid, stuname, stusex, stubirth, stuaddr , collid) values
558
558
(1001, ' 杨逍' , 1, ' 1990-3-4' , ' 四川成都' , 1),
559
559
(1002, ' 任我行' , 1, ' 1992-2-2' , ' 湖南长沙' , 1),
560
560
(1033, ' 王语嫣' , 0, ' 1989-12-3' , ' 四川成都' , 1),
@@ -571,18 +571,18 @@ MySQL在过去由于性能高、成本低、可靠性好,已经成为最流行
571
571
delete from tb_student where stuid=4040;
572
572
573
573
-- 更新学生数据
574
- update tb_student set stuname=' 杨过' , addr =' 湖南长沙' where stuid=1001;
574
+ update tb_student set stuname=' 杨过' , stuaddr =' 湖南长沙' where stuid=1001;
575
575
576
576
-- 插入老师数据
577
- insert into tb_teacher (teaid, teaname, title , collid) values
577
+ insert into tb_teacher (teaid, teaname, teatitle , collid) values
578
578
(1122, ' 张三丰' , ' 教授' , 1),
579
579
(1133, ' 宋远桥' , ' 副教授' , 1),
580
580
(1144, ' 杨逍' , ' 副教授' , 1),
581
581
(2255, ' 范遥' , ' 副教授' , 2),
582
582
(3366, ' 韦一笑' , ' 讲师' , 3);
583
583
584
584
-- 插入课程数据
585
- insert into tb_course (couid, couname, credit , teaid) values
585
+ insert into tb_course (couid, couname, coucredit , teaid) values
586
586
(1111, ' Python程序设计' , 3, 1122),
587
587
(2222, ' Web前端开发' , 2, 1122),
588
588
(3333, ' 操作系统' , 4, 1122),
0 commit comments