OCP 1Z0 051 149
来源:互联网 发布:mac 日历 广告 编辑:程序博客网 时间:2024/05/01 07:38
149. View the Exhibits and examine the structures of the COSTS and PROMOTIONS tables.
Evaluate the following SQL statement:
SQL> SELECT prod_id FROM costs
WHERE promo_id IN (SELECT promo_id FROM promotions
WHERE promo_cost < ALL
(SELECT MAX(promo_cost) FROM promotions
GROUP BY (promo_end_date-
promo_begin_date)));
What would be the outcome of the above SQL statement?
A. It displays prod IDs in the promo with the lowest cost.
B. It displays prod IDs in the promos with the lowest cost in the same time interval.
C. It displays prod IDs in the promos with the highest cost in the same time interval.
D. It displays prod IDs in the promos with cost less than the highest cost in the same time interval.
该题叙述不准确
改为<=再看
而是如下所示
Answer: D
Evaluate the following SQL statement:
SQL> SELECT prod_id FROM costs
WHERE promo_id IN (SELECT promo_id FROM promotions
WHERE promo_cost < ALL
(SELECT MAX(promo_cost) FROM promotions
GROUP BY (promo_end_date-
promo_begin_date)));
What would be the outcome of the above SQL statement?
A. It displays prod IDs in the promo with the lowest cost.
B. It displays prod IDs in the promos with the lowest cost in the same time interval.
C. It displays prod IDs in the promos with the highest cost in the same time interval.
D. It displays prod IDs in the promos with cost less than the highest cost in the same time interval.
该题叙述不准确
TEST >SELECT MAX(promo_cost) 2 FROM sh.promotions 3 GROUP BY (promo_end_date - promo_begin_date);MAX(PROMO_COST)--------------- 0 98500 0 99900 100000 99000 99300 95900 99600 9800010 rows selected.
TEST >SELECT promo_id, promo_cost 2 FROM sh.promotions 3 WHERE promo_cost < ALL 4 (SELECT MAX(promo_cost) 5 FROM sh.promotions 6 GROUP BY (promo_end_date - promo_begin_date));no rows selected
改为<=再看
TEST >SELECT promo_id, promo_cost 2 FROM sh.promotions 3 WHERE promo_cost <= ALL 4 (SELECT MAX(promo_cost) 5 FROM sh.promotions 6 GROUP BY (promo_end_date - promo_begin_date)); PROMO_ID PROMO_COST---------- ---------- 999 0 37 0 36 03 rows selected.到这儿应该比较清楚了,该语句不是计算 less than the highest cost in the same time interval.
而是如下所示
TEST >SELECT MIN(max_promo_cost) 2 FROM (SELECT MAX(promo_cost) AS max_promo_cost 3 FROM sh.promotions 4 GROUP BY (promo_end_date - promo_begin_date));MIN(MAX_PROMO_COST)------------------- 01 row selected.TEST >SELECT promo_id, promo_cost 2 FROM sh.promotions 3 WHERE promo_cost < 0;no rows selectedTEST >SELECT promo_id, promo_cost 2 FROM sh.promotions 3 WHERE promo_cost < 4 (SELECT MIN(max_promo_cost) 5 FROM (SELECT MAX(promo_cost) AS max_promo_cost 6 FROM sh.promotions 7 GROUP BY (promo_end_date - promo_begin_date)));no rows selected是小于各组最大值 里面的最小值
Answer: D
0 0
- OCP 1Z0 051 149
- OCP 1Z0 052 149
- OCP 1Z0 053 149
- OCP 1Z0 051 1
- OCP 1Z0 051 2
- OCP 1Z0 051 3
- OCP 1Z0 051 4
- OCP 1Z0 051 5
- OCP 1Z0 051 6
- OCP 1Z0 051 7
- OCP 1Z0 051 8
- OCP 1Z0 051 9
- OCP 1Z0 051 10
- OCP 1Z0 051 11
- OCP 1Z0 051 12
- OCP 1Z0 051 13
- OCP 1Z0 051 14
- OCP 1Z0 051 15
- Android开发之Navigationdrawer导航抽屉功能的实现(源代码分享)
- python中关于时间的处理
- android数据存储(一)之Shared Preferences及注意事项
- android网络编程——使用Android中的网络连接
- 搜狐一题面试题 链表的排序
- OCP 1Z0 051 149
- 温家宝在河北省兴隆县六道河中学作地理讲座
- nginx缓存
- C++课程设计(图书管理系统)
- android开发Day1
- 从网站细节入手提高易用性
- 枚举
- 【Flume NG用户指南】(1)设置
- Swift+HAporxy+Keepalived对象存储搭建