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. 配置python的豆瓣source

    sunny@sunny-ThinkPad-T450:~$ mkdir ~/.pip sunny@sunny-ThinkPad-T450:~$ gedit ~/.pip/pip.conf [global ...

  2. split files test

    python split_upload.py   /root/github/python/s3_test/test.txt    dbelt      dumps python download_to ...

  3. Gym101128G:Game of Cards

    题意: 有P摞纸牌和一个数字k,每次可以从一摞中拿0-k张牌,拿完再剩下的牌中的第一张数字是几,就必须再拿几张,谁不能拿谁输. emmm感觉好像就是裸的SG游戏啊,数据不大,递推出每一摞牌的SG值,然 ...

  4. Mask_RCNN测试自己的模型(练习)

    # coding: utf-8 # In[323]: import osimport sysimport randomimport mathimport numpy as npimport skima ...

  5. 关于@property与@syntheszie的使用问题

    写在前面:在ARC大行其道的“现代化社会”,不少人不再对“完整的“OC”抱有它应该获得的尊重,于是浮躁成了代名词~~ 在使用ARC时,大家声明变量的过程中,往往使用@property来通过编译器,隐式 ...

  6. solr 搭建 (基于solr-5.0.0)

    1)去官网下载solr 2)去官网下载Tomcat 3)在D盘建一个文件夹(我在此建立了一个文件夹(命名为:sorl_lf)) 4)解压Tomcat(如果已经安装了Tomcat,请配置支持多个Tomc ...

  7. tomcat安装后,双击start.bat闪退的问题

    1.jdk环境变量没有配 解决方案:我的电脑-属性-高级-环境变量,新增下面三个环境变量: ①JAVA_HOME=C:\Program Files\Java\jdk1.7.0_09(就是你jdk安装的 ...

  8. 为什么丑陋的UI界面却能创造良好的用户体验?

    本文内容由Mockplus团队翻译. 官网:http://www.mockplus.cn 网站界面过于漂亮可能会影响网站的可用性,但本文中提到的5个网站界面可谓是“丑”出了新高度.这样的网站它还有可用 ...

  9. AutoComplete的extraParams动态传递参数

    AutoComplete可利用extraParams传递参数,如 extraParams:{para1:'参数1',para2:'参数2'} 但是,如需动态取值作为参数值时却无法达到期望目的,可改为配 ...

  10. spring boot配置mybatis和事务管理

    spring boot配置mybatis和事务管理 一.spring boot与mybatis的配置 1.首先,spring boot 配置mybatis需要的全部依赖如下: <!-- Spri ...