用SQL语句实现教材第2章综合题第4题中的7个查询。完成第3个查询。在“(____)”内填答案。select Cname from Customers (____) Orders (____) Products pwhere c. Cid=o. Cid and p. Cid=o. Cid and Price=(____)(____) by Cnamehaving (____) > 500
举一反三
- 用SQL语句实现教材第2章综合题第4题中的7个查询。完成第1个查询。在“()”内填答案。⑴、select (____) from (____)(____) (____)= (____)
- 【单选题】假设订单表 orders 用于存储订单信息, cid 代表客户编号, money 代表单次订购额,现要查询每个客户的订购次数和每个客户的订购总金额,则下列() SQL 语句可以返回正确的结果。 A. select cid,count(distinct(cid)),sum(money) from ordersgroup by cid B. select cid , count(distinct(cid)) , sum(money) fromorders order by cid C. select cid , count(cid) , sum(money) from orders orderby cid D. select cid , count(cid) , sum(money) from orders groupby cid
- 用SQL语句创建教材第2章习题中的4个表:客户表Customers、代理人表Agents、产品表Products和订单表Orders。如下为第1个操作语句。在“(____)”内填答案。(____) (____) (____)(Cid char(6) (____) (____),(____) varchar(20) (____) (____),City varchar(20) (____) (____))
- 查询选修了a001号课程的学生的最高成绩() A: select cid, max(grade) from course where cid=’a001’ group by cid B: select cid,max(grade) from student where cid=’a001’ group by cid C: select cid, max(grade) from sc where cid=’a001’ group by cid D: select cid, max(grade) from student group by cid having cid=’a001’
- 统计选修了a001课程的学生的平均成绩( ) A: select cid,avg(grade) from student group by cid having cid=’a001’ B: select cid,avg(grade) from student where cid=’a001’ group by cid C: select cid,avg(grade) from course where cid=’a001’ group by cid D: select cid,avg(grade) from sc where cid=’a001’ group by cid