【OCP-12c】CUUG最新考试原题整理及答案(071-9)
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.items_id, s1.quantity;
B) 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.items_id;
C) SELECT str.name, s1.items_id,
(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, s1.items_id, 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 子句中。)
- OCP 12c最新考试原题及答案(071-7)
- Oracle ocp 12c-071最新考试题库及答案-1
- OCP 12c最新考试题库及答案(071-2)
- OCP 12c最新考试原题及答案(071-3)
- OCP 12c最新考试原题及答案(071-4)
- OCP 12c最新考试原题及答案(071-5)
- OCP 12c最新考试原题及答案(071-6)
- 2018版OCP 11g 052最新考试题库整理(带答案)(5)
- 2018版OCP 11g 052最新考试题库整理(带答案)(16)
- 2018版OCP 11g 052最新考试题库整理(带答案)(14)
- 2018版OCP 11g 052最新考试题库整理(带答案)(17)
- 2018版OCP 11g 052最新考试题库整理(带答案)(15)
- 2018版OCP 11g 052最新考试题库整理(带答案)(2)
- 2018版OCP 11g 052最新考试题库整理(带答案)(8)
- 2018版OCP 11g 052最新考试题库整理(带答案)(10)
- 2018版OCP 11g 052最新考试题库整理(带答案)(3)
- 2018版OCP 11g 052最新考试题库整理(带答案)(11)
- 2018版OCP 11g 052最新考试题库整理(带答案)(12)
- 2018版OCP 11g 052最新考试题库整理(带答案)(9)
- 2018版OCP 11g 052最新考试题库整理(带答案)(13)