数据库系统概论课后习题答案与效果展示Word文档格式.docx
- 文档编号:3780178
- 上传时间:2023-05-02
- 格式:DOCX
- 页数:30
- 大小:60.48KB
数据库系统概论课后习题答案与效果展示Word文档格式.docx
《数据库系统概论课后习题答案与效果展示Word文档格式.docx》由会员分享,可在线阅读,更多相关《数据库系统概论课后习题答案与效果展示Word文档格式.docx(30页珍藏版)》请在冰点文库上搜索。
Professor'
)
t02'
GU'
t03'
FANG'
t04'
LI'
Lecturer'
t05'
LIU'
t06'
YE'
);
t#
tname
title
t01
WANG
Professor
t02
GU
t03
FANG
t04
LI
Lecturer
t05
LIU
t06
YE
插入s表数据
insertintos(s#,sname,age,sex)
s36'
Gu'
20'
M'
s01'
WU'
21'
F'
s02'
s03'
SHEN'
15'
s04'
16'
'
s05'
LOU'
22'
s06'
s07'
LIN'
23'
s08'
s09'
YING'
s10'
SUN'
17'
s11'
YAN'
18'
s12'
ZHOU'
s13'
MU'
s14'
SU'
24'
s15'
LANG'
s16'
LUO'
s17'
JIANG'
19'
s18'
YU'
s19'
LING'
s20'
MA'
25'
s#
sname
age
sex
s01
WU
21
F
s02
20
M
s03
SHEN
15
s04
16
s05
LOU
22
s06
s07
LIN
23
s08
s09
YING
s10
SUN
17
s11
YAN
18
s12
ZHOU
s13
MU
s14
SU
24
s15
LANG
s16
LUO
s17
JIANG
19
s18
YU
s19
LING
s20
MA
25
s36
Gu
插入c表数据
insertintoc
values('
c01'
高数'
c02'
英语'
c03'
物理'
c04'
毛概'
c05'
生物'
c06'
模电'
c07'
MATHS'
c#
cname
c01
高数
c02
英语
c03
物理
c04
毛概
c05
生物
c06
模电
c07
MATHS
插入sc表数据
insertintosc
90);
100);
80);
89);
98);
85);
95);
92);
76);
86);
72);
82);
96);
94);
97);
c21'
null);
55);
79);
63);
15);
32);
88);
68);
60);
53);
49);
score
90
100
80
89
98
s03
72
s04
95
92
s05
76
86
82
96
55
94
79
63
97
32
88
68
60
53
49
85
P112(第3.2题)
1)检索年龄小于17岁的女学生的学号和姓名:
selects#,sname
froms
whereage<
17andsex='
;
s#
1
2
2)检索男学生所学课程的课程号和课程名
selectc.c#,cname
froms,sc,c
wheres.s#=sc.s#andsc.c#=c.c#andsex='
3
4
5
6
7
8
9
10
11
12
13
14
26
27
28
3)检索男学生所学课程的任课老师的工号和姓名
selectt.t#,tname
froms,sc,c,t
wheres.s#=sc.s#andsc.c#=c.c#andc.t#=t.t#andsex='
4)检索至少选修两门课程的学生学号
selectdistinctx.s#
fromscasx,scasy
wherex.s#=y.s#andx.c#!
=y.c#;
s01
s02
s06
s07
s08
s09
s10
s11
s12
s13
s14
s15
s16
s17
s18
s19
s20
s36
5)检索至少有学号为S02和S04学生选修的课程和课程号
selectdistinctx.c#
wherex.s#='
andy.s#='
andx.c#!
c01
c02
c03
c04
6)检索WANG同学不学的课程和课程号
selectc#
fromc
wherenotexists
(
select*
froms,sc
wheres.s#=sc.s#andsc.c#=c.c#andsname='
);
c05
c06
c07
7)检索全部学生都选修的课程的课程号与课程名
selectc#,cname
froms
wherenotexists
fromsc
wheres#=s.s#andc#=c.c#
));
8)检索选修课程包含LIU老师所授全部课程的学生学号
selectdistincts#
fromscasx
(select*
fromc,t
wherec.t#=t.t#andtname='
andnotexists
(select*
fromscasy
wherey.s#=x.s#andy.c#=c.c#));
书本上的作业题:
P112(第3.7题)
1)统计有学生选修的课程门数
selectcount(distinctc#)
fromsc;
无列名
2)求选修C4课程的女同学的平均年龄
selectavg(age)
froms,sc
wheres.s#=sc.s#andc#='
c4'
andsex='
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据库 系统 概论 课后 习题 答案 效果 展示