ocp题库解析:1Z0-051-V9.02-第142题
ocp题库解析:1Z0-051-V9.02-第142题,完整题库请点击这里联系老师咨询了解
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.
Answer: C
试题解析:
1、首先来运行一下上面的sql语句,是可以出结果的。
2、拆分上面sql语句,首先运行子句查询出价格最高的产品的价格
3、低于价格最高的,即价格次高的产品。按题意,故选C.
精华阅读