【OCP-12c】CUUG 071题库考试原题及答案解析(23)
23.choose the best answer
View the Exhibits and examine PRODUCTS and SALES tables.
You issue the following query to display product name and the number of times the
product has been sold:
SQL>SELECT p.prod_name, i.item_cnt
FROM (SELECT prod id, COUNT(*) item_cnt
FROM sales GROUP BY prod_id) i RIGHT OUTER JOIN products p
ON i.prod_id = p.prod_id;
What happens when the above statement is executed?
A) The statement executes successfully and produces the required output.
B) The statement produces an error because a subquery in the FROM clause and outer-joins cannot be used together.
C) The statement produces an error because ITEM_CNT cannot be displayed in the outer query.
D) The statement produces an error because the GROUP BY clause cannot be used in a subquery in the FROM clause.
Answer:A
(SQL> select d.dname,e.emp_cnt
from (select deptno,count(*) emp_cnt from emp group by deptno)e right outer join dept d
on e.deptno=d.deptno;
DNAME EMP_CNT
-------------- ----------
ACCOUNTING 2
RESEARCH 4
SALES 6
OPERATIONS
TRAIN)
【OCP-12c】CUUG 071题库考试原题及答案解析(23)的更多相关文章
- 【OCP认证12c题库】CUUG 071题库考试原题及答案(28)
28.choose the best answer Evaluate the following SQL statement: SQL> SELECT promo_id, promo_categ ...
- 【OCP认证12c题库】CUUG 071题库考试原题及答案(27)
27.choose two The SQL statements executed in a user session are as follows: SQL> CREATE TABLE pro ...
- 【OCP认证12c题库】CUUG 071题库考试原题及答案(26)
26.choose two Examine the structure of the PRODUCTS table. Which two statements are true? A) EXPIRY_ ...
- 【OCP认证12c题库】CUUG 071题库考试原题及答案(25)
25. choose the best answer Evaluate the following SQL statement: ALTER TABLE hr.emp SET UNUSED (mgr_ ...
- 【OCP-12c】CUUG 071题库考试原题及答案解析(24)
24. choose the best answer In the EMPLOYEES table there are 1000 rows and employees are working in t ...
- 【OCP-12c】CUUG 071题库考试原题及答案解析(22)
5.choose the best answer Evaluate the following CREATE SEQUENCE statement: CREATE SEQUENCE seq1 STAR ...
- 【OCP-12c】CUUG 071题库考试原题及答案解析(21)
3.choose three View the Exhibit and examine the description of SALES and PROMOTIONS tables. You want ...
- 【OCP-12c】CUUG 071题库考试原题及答案解析(20)
20.choose two Examine the description of the EMP_DETAILS table given below: Which two statements are ...
- 【OCP-12c】CUUG 071题库考试原题及答案解析(19)
1.choose the best answerWhat is the primary difference between the relational database (RDB) andobje ...
随机推荐
- MySQL函数及用法示例
(一) 1.字符串函数ascii(str) 返回字符串str的第一个字符的ascii值(str是空串时返回0) mysql> select ascii('2'); -> 50 ...
- Solr Dismax查询解析器-深入分析
Solr 支持多种查询解析,给搜索引擎开发人员提供灵活的查询解析.Solr 中主要包含这几个查询解析器:标准查询解析器.DisMax 查询解析器,扩展 DisMax 查询解析器(eDisMax) Di ...
- UILabel的空格不支持tab键
今天使用模拟器测试,发现有个UITableViewCell的detailTextLabel没有完全显示字符串,结尾是省略号,字符串的值中间显示有空格,如 'Test 01'显示为'Te...' det ...
- Multiply Strings大整数乘法
[抄题]: 以字符串的形式给定两个非负整数 num1 和 num2,返回 num1 和 num2 的乘积. [暴力解法]: 时间分析: 空间分析: [思维问题]: 还要找到结果中第一位不等于0的数再添 ...
- 关于在线文本编辑器防XSS注入攻击问题
跨站脚本攻击,又称XSS代码攻击,也是一种常见的脚本注入攻击.例如在下面的界面上,很多输入框是可以随意输入内容的,特别是一些文本编辑框里面,可以输入例如<script>alert('这是一 ...
- 复利计算--web版--总结--软件工程
复利计算项目 估计用时 实际用时 时间(小时) 5.5小时 6.5小时 总共代码行 500 550 功能包含 单利/复利计算,本金计算,求投资年限,求投资项目利率估计 (计算利息和,计算时间,计算 ...
- YUI前端优化之内容篇
Excetional Performance团队总结出了一系列可以提高网站速度的方法.可以分为7大类34条.包括内容.服务器.cookie.CSS.JavaScript.图片.移动应用等七部分.一.内 ...
- 修改数据库中的内容报错:PropertyAccessException:Null value was assinged to a property of primitive type setter of
错误原因:totalTime的类型为int,数据库中为NULL,int 类型不能赋值为NULL,只能为0,所以报此异常. 解决方案:将totalTime的类型改为Integer,或者初始化为0
- UVa 1395 Slim Span (最小生成树)
题意:给定n个结点的图,求最大边的权值减去最小边的权值最小的生成树. 析:这个和最小生成树差不多,从小到大枚举左端点,对于每一个左端点,再枚举右端点,不断更新最小值.挺简单的一个题. #include ...
- Python学习-14.Python的输入输出(三)
在Python中写文件也是得先打开文件的. file=open(r'E:\temp\test.txt','a') file.write('append to file') file.close() 第 ...