数据库习题6.1

上传人:仙*** 文档编号:31653395 上传时间:2021-10-12 格式:DOC 页数:2 大小:332.50KB
返回 下载 相关 举报
数据库习题6.1_第1页
第1页 / 共2页
数据库习题6.1_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述
6. I 7.使用大学的模式, 用关系代数来表达下面这些查询。A. 找出计算机( Comp. Sci. )系开设的占3 个学分的课程的名称。b 找出选了教师Einstei n 所教课程的所有学生的ID , 注意结果中不能有重复。c. 找出所有教师的最高工资。d. 找出收入为最高工资的所有教师(可能有多个人工资相同) 0e. 找出29 年秋季学期开设的各个课程段的选课人数。L 找出29 年秋季学期开设的各个课程段中最大的选课人数。g. 找出在29 年秋季学期选课人数最多的课程段。a. 5ti tle (sdept name = Comp. Sci credits=3(course)b. 5I D(sI I D = Einstein(takes 1 rt1(IID, course id, section id, semester, year)teaches)Assuming the set version of the relational algebra is used, there isno need to explicitly remove duplicates. If the multiset version isused, the grouping operator can be used without any agggregationto remove duplicates. For example given relation r (A, B) possiblycontaining duplicates, A,BG(r ) would return a duplicate free versionof the relation.c. Gmax(salary)(instructor)d. instructor 1 (Gmax(salary) as salary (instructor)Note that the above query renames the maximum salary as salary, sothe subsequent natural join outputs only instructors with that salary.e. course id,section idGcount() as enrollment(syear=2009semester=Autumn(takes)f. t1 course id,section idGcount() as enrollment(syear=2009semester=Autumn(takes)result = Gmax(enrollment)(t1)g. t2 Gmax(enrollment) as enrollment(t1)where t1 is as defined in the previous part of the question.result = t1 1 t2
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业管理 > 销售管理


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!