1 / 7
文档名称:

数据库作业.doc

格式:doc   页数:7页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

数据库作业.doc

上传人:luyinyzha 2016/7/4 文件大小:0 KB

下载得到文件列表

数据库作业.doc

文档介绍

文档介绍:班级:软件工程 1班姓名:刘辰欢学号: 2012551413 a. select title from course where dept name =’ Comp. Sci. ’ and credits =3 b. select distinct from ( student join takes using ( ID )) join ( instructor join teaches using ( ID )) using ( course id, sec id, semester , year ) where =’ Einstein ’ As an alternative to th join .. using syntax above the query can be written by enumerating relations in the from clause, and adding the corresponding join predicates on ID, course id, section id, semester , and year to the where clause. Note that using natural join in place of join .. using would result in equating student ID with instructor ID, which is incorrect. c. select max ( salary ) from instructor d. select ID, name from instructor where salary =( select max ( salary ) from instructor ) e. select course id, sec id, count ( ID ) from section natural join takes where semester =’ Autumn ’ and year = 2009 group by course id, sec id select course id, sec id,( select count ( ID ) from takes where = and = and takes . course id= section . course id and takes . section id= section . section id) from section where semester =’ Autumn ’ and year = 2009 f. select max ( enrollment ) from ( select count ( ID ) as enrollment from section natural join takes where semester =’ Autumn ’ and year = 2009 group by course id, sec id) g. w