数据库系统概念第六版答案(包括实践习题,习题)下载 您所在的位置:网站首页 数据库系统概念课后答案第六章 数据库系统概念第六版答案(包括实践习题,习题)下载

数据库系统概念第六版答案(包括实践习题,习题)下载

#数据库系统概念第六版答案(包括实践习题,习题)下载| 来源: 网络整理| 查看: 265

数据库系统概念第六版答案(包括实践习题,习题)例如3.11答案Exercises •Write the following queries in SQL, using the university schema. •Find the names of all students who have taken at least one Comp. Sci. course; make sure there are no duplicate names in the result. •Find the IDs and names of all students who have not taken any course offering before Spring 2009. 11 •For each department, find the maximum salary of instructors in that department. You may assume that every department has at least one instructor. •Find the lowest, across all departments, of the per-department max- imum salary computed by the preceding query. Answer: •SQL query: select name from student natural join takes natural join course where course.dept = ’Comp. Sci.’ •SQL query: select id, name from student except select id, name from student natural join takes where year < 2009 Since the except operator eliminates duplicates, there is no need to use a select distinct clause, although doing so would not affect correctness of the query. •SQL query: select dept, max(salary) from instructor group by dept



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有