全球旧事资料 分类
号分类名数量品牌from商品表1x商品表2ywherex商品代号y商品代号2.selectdisti
ct产地from商品表23.selectcou
tdisti
ct产地as产地数from商品表24.selectx商品代号分类名产地品牌from商品表1x商品表2y
4
fwherex商品代号y商品代号a
d品牌熊猫or品牌春兰5.select学生学生号cou
tas选课门数from学生选课where学生学生号选课学生号groupby学生学生号6.selectdisti
ctxfrom学生x选课y选课zwherey学生号z学生号a
dy课程号z课程号a
dx学生号y学生号7.selectfrom学生where学生号i
select学生号from选课groupby学生号havi
gcou
t18.selectxfrom课程x,选课ywherex课程号y课程号a
dy学生号s1ba
dy课程号
oti
select课程号from课程where选课学生号s29.selectfrom课程where
otexistsselectfrom选课where课程课程号选课课程号10.selectfrom课程whereexistsselectfrom选课where课程课程号选课课程号11.selectfrom学生whereexistsselectfrom选课where学生学生号选课学生号groupby选课学生号havi
gcou
t312.select
5
ffrom学生where学生号i
select学生号from选课groupby学生号havi
gcou
t2or
otexistsselectfrom选课where学生学生号选课学生号13.select专业cou
tas专业人数from学生groupby专业orderby专业人数desc14.selectx课程名课程学分成绩from学生x课程y选课zwherex学生号z学生号a
dy课程号z课程号orderbyx学生号z成绩15.selectfrom学生where
otexistsselecty课程号from学生xi
erjoi
选课yo
x学生号y学生号wherex姓名aa
d
otexistsselectfrom选课where学生学生号选课学生号a
dy课程号选课课程号
三、根据教材第四章所给的商品库和教学库,按照下列所给的每种功能写出相应的根据教材第四章所给的商品库和教学库,查询语句。查询语句。在名称为商品库的数据库中包含有商品表1和商品表2,它们的定义分别为:商品表1商品代号char8分类名char8单价float数量i
t商品表2商品代号char8产地char6品牌char6在名称为教学库的数据库中包含有学生、课程和选课三个表,它们的定义分别为:学生学生号char7姓名char6性别char2出生日期datetime专业char10年级i
t课程课程号char4课程名char10课程学分i
t选课学生号char7课程号char4成绩i
t1从商品库中查询出每一种商品的商品代号、单价、数量和产地。2从商品库中查询出数量大于10的商品种数。3从商品库中查询出数量在10和20之间r
好听全球资料 返回顶部