设为首页 加入收藏

TOP

ocp1Z0-051141-175题解析(一)
2014-11-24 08:04:39 来源: 作者: 【 】 浏览:0
Tags:ocp1Z0-051141-175 解析

141. View the Exhibitand examine the structure of CUSTOMERS and GRADES tables.

You need to displaynames and grades of customers who have the highest credit limit.

Which two SQL statementswould accomplish the task (Choose two.)

A. SELECT custname,grade

FROM customers, grades

WHERE (SELECTMAX(cust_credit_limit)

FROM customers) BETWEENstartval and endval;

B. SELECT custname,grade

FROM customers, grades

WHERE (SELECT MAX(cust_credit_limit)

FROM customers)

\

A. SELECT custname,grade

FROM customers, grades

WHERE (SELECTMAX(cust_credit_limit)

FROM customers) BETWEENstartval and endval;

B. SELECT custname,grade

FROM customers, grades

WHERE (SELECTMAX(cust_credit_limit)

FROM customers) BETWEENstartval and endval

AND cust_credit_limitBETWEEN startval AND endval;

C. SELECT custname,grade

FROM customers, grades

WHERE cust_credit_limit= (SELECT MAX(cust_credit_limit)

FROM customers)

AND cust_credit_limitBETWEEN startval AND endval;

D. SELECT custname,grade

FROM customers , grades

WHERE cust_credit_limitIN (SELECT MAX(cust_credit_limit)

FROM customers)

ANDMAX(cust_credit_limit) BETWEEN startval AND endval;

Answer: BC

解析:
题意:You need to display names and grades of customers whohave the highest credit limit 意思要求找出最高credit limit 但是须在startval endval 之间,执行where后的条件从右到左

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

eva luate the followingquery:

SQL> SELECT prod_name

FROM products

WHERE prod_id IN (SELECTprod_id FROM products

WHERE prod_list_price =

(SELECT MAX(prod_list_price)FROM products

WHERE prod_list_price <

(SELECT MAX(prod_list_price)FROM products)));

What would be theoutcome of executing the above SQL statement

\

A. It produces an error.

B. It shows the names ofall products in the table.

C. It shows the names ofproducts whose list price is the second highest in the table.

D. It shows the names ofall products whose list price is less than the maximum list price.

Answer: C

解析:

(SELECT MAX(prod_list_price)FROMproducts

WHERE prod_list_price<

(SELECTMAX(prod_list_price)FROM products))

从小于最大价格的结果集找最大的结果,那就是第二大的

143. View the Exhibitand examine the structure of the PROMOTIONS table.

You have to generate areport that displays the promo name and start date for all promos that startedafter

the last promo in the'INTERNET' category.

Which query would giveyou the required output

\

A. SELECT promo_name,promo_begin_date FROM promotions

WHERE promo_begin_date> ALL (SELECT MAX(promo_begin_date)

FROM promotions )AND

promo_category ='INTERNET';

B. SELECT promo_name,promo_begin_date FROM promotions

WHERE promo_begin_dateIN (SELECT promo_begin_date

FROM promotions

WHEREpromo_category='INTERNET');

C. SELECT promo_name,promo_begin_date FROM promotions

WHERE promo_begin_date> ALL (SELECT promo_begin_date

FROM promotions

WHERE promo_category ='INTERNET');

D. SELECT promo_name,promo_begin_date FROM promotions

WHERE promo_begin_date> ANY (SELECT promo_begin_date

FROM promotions

WHERE promo_category ='INTERNET');

Answer: C

解析:

(SELECT promo_begin_date

FROM promotions

WHERE promo_category ='INTERNET');

得到类别为internet的所有promo_begin_date

SELECT promo_name,promo_begin_date FROM promotions

WHERE promo_begin_date> ALL (SELECT promo_begin_date

FROM promotions

WHERE promo_category ='INTERNET');

大于所有的类别为internet的所有promo_begin_date,即大于最大的,也就是最近的

时间的比较,越大说明离当

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 1/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇oracle报错 下一篇ORA-01078与LRM-00109报错解决

评论

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

·微服务 Spring Boot (2025-12-26 18:20:10)
·如何调整 Redis 内存 (2025-12-26 18:20:07)
·MySQL 数据类型:从 (2025-12-26 18:20:03)
·Linux Shell脚本教程 (2025-12-26 17:51:10)
·Qt教程,Qt5编程入门 (2025-12-26 17:51:07)