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】CUUG最新考试原题整理及答案(071-9)的更多相关文章

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

    11.(5-8) choose the best answer: Examine the structure of the BOOKS_TRANSACTIONS table. You want to ...

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

    12.(5-12)choose two:Examine the data in the CUSTOMERS table:You want to list all cities that have mo ...

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

    10.(5-6) choose the best answer:Examine the structure of the EMPLOYEES table:There is a parent/child ...

  4. OCP 12c最新考试原题及答案(071-8)

    8.(5-4) choose the best answer:You need to produce a report where each customer's credit limit has b ...

  5. OCP 12c最新考试原题及答案(071-7)

    7.(5-1) choose two:View the Exhibit and examine the structure of the PRODUCTS table.Which two tasks ...

  6. OCP 12c最新考试原题及答案(071-6)

    6.(4-21) choose the best answer: View the Exhibit and examine the structure of the CUSTOMERS table. ...

  7. OCP 12c最新考试原题及答案(071-5)

    5.(4-12) choose two: You executed the following CREATE TABLE statement that resulted in an error: SQ ...

  8. OCP 12c最新考试原题及答案(071-4)

    4.(4-11) choose two:View the Exhibit and examine the data in the PRODUCT_INFORMATION table.Which two ...

  9. OCP 12c最新考试原题及答案(071-3)

    3.(4-10) choose the best answer:The user SCOTT who is the owner of ORDERS and ORDER_ITEMS tables iss ...

随机推荐

  1. Ubuntu 15.04 开机无法进入图形界面,自动进入emergency mode解决方法

    原因:关机的时候没有正常退出,直接强制关机了... 解决: 就是在那个GIVE root password for maintenance (or type control-D to continue ...

  2. 前端开发之JavaScript HTML DOM理论篇一

    主要内容: 1.DOM简介 2.DOM 节点 3.DOM 方法和属性 4.DOM 访问和修改 一.DOM简介 1.什么是 DOM? DOM 是 W3C(万维网联盟)的标准. DOM 定义了访问 HTM ...

  3. jenkins-为什么要持续集成

    持续集成(Continuous Integration),也就是我们经常说的 CI,是现代软件开发技术的基础.本文论述了当前软件开发过程中存在的问题,讲解了持续集成.持续集成服务器的概念,最终探讨了为 ...

  4. __str__&__repr__

    [__str__&__repr__] object.__str__(self): Called by the str() built-in function and by the print  ...

  5. Spark Streaming原理简析

    执行流程 数据的接收 StreamingContext实例化的时候,需要传入一个SparkContext,然后指定要连接的spark matser url,即连接一个spark engine,用于获得 ...

  6. 关于iOS URL缓存机制原理解析

    关于URL缓存机制中   利用request对象判断是否缓存   其实request是否相等的判断依据是URLString是否相等

  7. Cloudstack4.2之改变数据卷容量的大小(Resize Data Volumes)

    下图标注了这个功能在cloudstack4.2 UI中的位置 在cloudstack中是通过磁盘服务来设定卷的大小的.管理员可以设置相应的磁盘服务以供用户来使用.为了增强系统的灵活性,方便最终用户的使 ...

  8. spring4-5-事务管理

    1.简单介绍 事务管理是企业级应用程序开发中必不可少的技术,  用来确保数据的完整性和一致性. 事务就是一系列的动作, 它们被当做一个单独的工作单元. 这些动作要么全部完成, 要么全部不起作用 事务的 ...

  9. Can not find -lXXXX

    Description I had the error message Can not find -lGL when i run qt qmake long ago. The error messag ...

  10. C 和 CPP 混合代码cmath编译出错

    Visual Studio会将cmath内的一些列函数报错 解决方式:项目->属性->配置属性->C/C++ ->高级->编译为->选择编译为C++代码即可