加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

【OCP-12c】CUUG最新考试原题整理及答案(071-9)

发布时间:2020-12-14 04:24:32 所属栏目:大数据 来源:网络整理
导读:9、(5-5) choose the best answer View the Exhibit and examine the structure of the SALES and STORES tables. You want to display the store name and the total quantity sold for each item in the store. Which SQL statement will give the requi
9、(5-5) choose the best answer
View the Exhibit and examine the structure of the SALES and STORES tables.
You want to display the store name and the total quantity sold for each item in the store.

Which SQL statement will give the required output?
A) SELECT str.name,s1.items_id,SUM(s1.quantity)
FROM sales s1 JOIN stores str
ON (s1.store_id = str.store_id)
GROUP BY str.name,s1.quantity;

B) SELECT str.name,s1.items_id;

C) SELECT str.name,
(SELECT SUM(quantitY)
FROM sales sls
ON sls.store_id = s1.store_id
GROUP BY sls.store_id)
FROM sales s1 JOIN stores str
ON (s1.store_id = str.store_id);

D) SELECT str.name,SUM(s1.quantity)
FROM sales s1 JOIN stores str ON (s1.store id = str.store_id)
GROUP BY s1.items_id,s1.quantity;

Answer:B(解析:分组函数的最基本特点,没有出现在分组函数中的列必须要出现在 group by 子句中。)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读