OCP认证是Oracle非常重要的一个认证,对于11g版本来说,考试科目为071、052、053,对于12c版本来说,考试科目为071、062、063,可见071是个很重要的考试,这里我们收集了近期071考试的原题,分享给大家。
--------------------------------------------
071考题整理-第30题、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解析公开课时间:【每周五晚8点】
OCP解析公开课地址:https://ke.qq.com/course/326223
OCP解析群资料分享:1015267481 验证:ocp
另外,除了OCP公开课,OCM题库直播也同步进行中,OCM最新题库大爆料-【每周四晚8点】,【微信群直播】,可以联系咨询老师进群参与