设为首页 加入收藏

TOP

ocp1Z0-051106-140题解析(九)
2014-11-24 08:07:01 来源: 作者: 【 】 浏览:31
Tags:ocp1Z0-051106-140 解析
s it has been sold.

eva luate the followingquery:

SQL>SELECT p.prod_id,COUNT(s.prod_id)

FROM products p_____________ sales s

ON p.prod_id = s.prod_id

GROUP BY p.prod_id;

Which two JOIN optionscan be used in the blank in the above query to get the required output (Choose

two.)

\

A. JOIN

B. FULL OUTER JOIN

C. LEFT OUTER JOIN

D. RIGHT OUTER JOIN

Answer: BC

解析:

题意:You want to listeach product ID and the number of times it has been sold,需要列出每个product id 所以需要将 products表中全部列查询

引用官方文档:

■ A left outer joinreturns all the common column values from the left table in the

FROM clause.

■ A right outer joinreturns all the common column values from the right table in the

FROM clause.

■ A full outer joinreturns all the common column values from both joined tables.

133. Which twostatements are true regarding subqueries (Choose two.)

A. A subquery canretrieve zero or more rows.

B. Only two subqueriescan be placed at one level.

C. A subquery can beused only in SQL query statements.

D. A subquery can appearon either side of a comparison operator.

E. There is no limit onthe number of subquery levels in the WHERE clause of a SELECT statement.

Answer: AD

解析:

引用官方文档:

A subquery answers multiple-partquestions 所以A选项正确

B选项,可以有多个子查询在同一级上 所以B选项错误

C选项,create table zbcxy as select * from emp wheresal>(select avg(sal) from emp );

所以C选项错误

D选项 在运算符那一边结果一样 所以正确

E选项,引用官方文档:A subquery can contain another subquery. Oracle Databaseimposes no limit on the number of subquery levels in the FROM clause of the top-levelquery. You can nest up to 255 levels of subqueries in the WHERE clause.

所以E选项错误

134. Where cansubqueries be used (Choose all that apply.)

A. field names in theSELECT statement

B. the FROM clause inthe SELECT statement

C. the HAVING clause inthe SELECT statement

D. the GROUP BY clausein the SELECT statement

E. the WHERE clause inonly the SELECT statement

F. the WHERE clause inSELECT as well as all DML statements

Answer: ABCF

解析:

D选项,group by 后面只能用列名

F选项,很明显不一样

135. Which threestatements are true regarding subqueries (Choose three.)

A. Subqueries cancontain GROUP BY and ORDER BY clauses.

B. Main query andsubquery can get data from different tables.

C. Main query and subquerymust get data from the same tables.

D. Subqueries cancontain ORDER BY but not the GROUP BY clause.

E. Only one column orexpression can be compared between the main query and subquery.

F. Multiple columns orexpressions can be compared between the main query and subquery.

Answer: ABF

解析:

C选项,select * from dept where deptno=(select deptno from empwhere empno=7788);

D选项,select * from emp where deptno in (select deptno from empgroup by deptno);

E选项,select * from emp where deptno in (select deptno from empgroup by deptno);

136. View the Exhibitand examine the structure of the PRODUCTS table.

Which two tasks wouldrequire subqueries (Choose two.)

\

A. Display the minimumlist price for each product status.

B. Display all supplierswhose list price is less than 1000.

C. Display the number ofproducts whose list price is more than the average list price.

D. Display the totalnumber of products supplied by supplier 102 and have product status as'obsolete'.

E. Display all productswhose minimum list price is more than the average list price of products andhave

the status 'orderable'.

Answer: CE

解析:

C选项,查询平均价格作为子查询

E选项,the average list price of products and have the status'orderable'需要作为子查询

137. View the Exhibitsand examine PRODUCTS and SALES tables.

You issue th

首页 上一页 6 7 8 9 10 下一页 尾页 9/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇DBA手记:DBA诊断利器 - Event 100.. 下一篇Oracle 11g New 使用数据恢复指导

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·MySQL 基础入门视频 (2025-12-26 23:20:22)
·小白入门:MySQL超详 (2025-12-26 23:20:19)
·关于 MySQL 数据库学 (2025-12-26 23:20:16)
·SOLVED: Ubuntu 24.0 (2025-12-26 22:51:53)
·Linux 常用命令最全 (2025-12-26 22:51:50)