OCP 1Z0 051 142
来源:互联网 发布:网络对实体店的冲击 编辑:程序博客网 时间:2024/06/05 01:14
142. View the Exhibit and examine the structure of the PRODUCTS table.
Evaluate the following query:
SQL> SELECT prod_name
FROM products
WHERE prod_id IN (SELECT prod_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 the outcome of executing the above SQL statement?
A. It produces an error.
B. It shows the names of all products in the table.
C. It shows the names of products whose list price is the second highest in the table.
D. It shows the names of all products whose list price is less than the maximum list price.
该语句先取出MAX(prod_list_price)
然后取出<MAX(prod_list_price)的数据
在此范围内再次找到MAX(prod_list_price)
也就是第二大
Answer: C
Evaluate the following query:
SQL> SELECT prod_name
FROM products
WHERE prod_id IN (SELECT prod_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 the outcome of executing the above SQL statement?
A. It produces an error.
B. It shows the names of all products in the table.
C. It shows the names of products whose list price is the second highest in the table.
D. It shows the names of all products whose list price is less than the maximum list price.
该语句先取出MAX(prod_list_price)
然后取出<MAX(prod_list_price)的数据
在此范围内再次找到MAX(prod_list_price)
也就是第二大
SQL> SELECT prod_name 2 FROM sh.products 3 WHERE prod_id IN 4 (SELECT prod_id 5 FROM sh.products 6 WHERE prod_list_price = 7 (SELECT MAX(prod_list_price) 8 FROM sh.products 9 WHERE prod_list_price < 10 (SELECT MAX(prod_list_price) FROM sh.products)));PROD_NAME--------------------------------------------------Mini DV Camcorder with 3.5" Swivel LCD1 row selected
SQL> SELECT * 2 FROM (SELECT prod_id, prod_name, prod_list_price 3 FROM sh.products 4 ORDER BY 3 DESC) 5 WHERE rownum <= 3;PROD_ID PROD_NAME PROD_LIST_PRICE------- -------------------------------------------------- --------------- 18 Envoy Ambassador 1299.99 17 Mini DV Camcorder with 3.5" Swivel LCD 1099.99 14 17" LCD w/built-in HDTV Tuner 999.993 rows selected
Answer: C
0 0
- OCP 1Z0 051 142
- OCP 1Z0 052 142
- OCP 1Z0 053 142
- 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
- 很有启发性的一张思维导图
- 记录生活——2014年5月28日晚
- GDB调试技巧(二)
- 红黑树的实现
- 二叉树建立以及先序、中序、后序、层次遍历(JAVA 实现)
- OCP 1Z0 051 142
- JavaScript中的类与对象的本质
- wchar_t*和char*之间的互相转换的那些事
- 利用JSTL的循环输出Map中的值
- “hello world”驱动实现过程(ARM板上)
- UIButton上同时显示图片和文字的方法
- yii 添加,操作成功,但数据并没有插入到数据库中
- crontab创建定时任务执行mapreduce,并将输出Load到数据库
- 随想