145.View the Exhibit and examine the structure of the CUSTOMERS table.
来源:互联网 发布:淘宝网电警棍 编辑:程序博客网 时间:2024/05/25 21:33
145.View the Exhibit and examine the structure of the CUSTOMERS table.
You issue the following SQL statement on the CUSTOMERS table to display the customers who are in the
same country as customers with the last name 'KING' and whose credit limit is less than the maximum
credit limit in countries that have customers with the last name 'KING':
SQL> SELECT cust_id,cust_last_name FROM customers
WHERE country_id IN(SELECT country_id FROM customers WHERE cust_last_name ='King')
AND cust_credit_limit < (SELECT MAX(cust_credit_limit) FROM customers WHERE country_id IN
(SELECT country_id
FROM customers
WHERE cust_last_name='King'));
Which statement is true regarding the outcome of the above query?
A.It executes and shows the required result.
B.It produces an error and the < operator should be replaced by < ALL to get the required output.
C.It produces an error and the < operator should be replaced by < ANY to get the required output.
D.It produces an error and the IN operator should be replaced by = in the WHERE clause of the main query to get the required output.
答案:A
解析:
SELECT MAX(cust_credit_limit) FROM customers WHERE country_id IN
(SELECT country_id
FROM customers
WHERE cust_last_name='King') 这个是单行子查询,所以不需要使用all和 any ,排除BC
(SELECT country_id
FROM customers
WHERE cust_last_name='King') 这个是多行子查询,不能使用=
You issue the following SQL statement on the CUSTOMERS table to display the customers who are in the
same country as customers with the last name 'KING' and whose credit limit is less than the maximum
credit limit in countries that have customers with the last name 'KING':
SQL> SELECT cust_id,cust_last_name FROM customers
WHERE country_id IN(SELECT country_id FROM customers WHERE cust_last_name ='King')
AND cust_credit_limit < (SELECT MAX(cust_credit_limit) FROM customers WHERE country_id IN
(SELECT country_id
FROM customers
WHERE cust_last_name='King'));
Which statement is true regarding the outcome of the above query?
A.It executes and shows the required result.
B.It produces an error and the < operator should be replaced by < ALL to get the required output.
C.It produces an error and the < operator should be replaced by < ANY to get the required output.
D.It produces an error and the IN operator should be replaced by = in the WHERE clause of the main query to get the required output.
答案:A
解析:
SELECT MAX(cust_credit_limit) FROM customers WHERE country_id IN
(SELECT country_id
FROM customers
WHERE cust_last_name='King') 这个是单行子查询,所以不需要使用all和 any ,排除BC
(SELECT country_id
FROM customers
WHERE cust_last_name='King') 这个是多行子查询,不能使用=
0 0
- 145.View the Exhibit and examine the structure of the CUSTOMERS table.
- 79.View the Exhibit and examine the structure of the CUSTOMERS table. In the CUSTOMERS table, the CU
- 8.View the Exhibit and examine the structure of the CUSTOMERS table.
- 54.View the Exhibit and examine the structure of the CUSTOMERS table.
- 65.View the Exhibit and examine the structure of the CUSTOMERS table.
- 110.View the Exhibit and examine the structure of the CUSTOMERS table.
- 111.View the Exhibit and examine the structure of the CUSTOMERS table.
- 115.View the Exhibit and examine the structure of the CUSTOMERS table.
- 159.View the Exhibit and examine the structure of the CUSTOMERS table.
- 93.View the Exhibit and examine the structure of the CUSTOMERS table. Using the CUSTOMERS table, y o
- 60.View the Exhibit and examine the structure of CUSTOMERS table.
- 1.View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES tables.
- 151.View the Exhibit and examine the structure of the CUSTOMERS and CUST_HISTORY tables.
- 157.View the Exhibit and examine the structure of the ORDERS and CUSTOMERS tables.
- 141.View the Exhibit and examine the structure of CUSTOMERS and GRADES tables.
- 160.View the Exhibit and examine the structure of ORDERS and CUSTOMERS tables.
- 164.View the Exhibit and examine the structure of CUSTOMERS and SALES tables.
- 11.View the Exhibit and examine the structure of the PRODUCTS table.
- 深入理解RunLoop
- Linux编译多个不同目录下的文件以及静态库、动态库的使用
- android差异化更新(增量更新)
- dispatchKeyEvent不响应Instrumentation模拟发送的按键
- tomcat 中文乱码
- 145.View the Exhibit and examine the structure of the CUSTOMERS table.
- 什么时候用assert?
- 数组中只出现一次的数字
- 关于解析emoji表情EmojiconTextView控件与超链接解析标签的冲突
- Android学习之Timer和TimerTask
- linux文件学习1
- request.getParameterMap()获得Map中的数据时
- Web前端学习笔记(2)-html5新增的结构元素
- centos6 配置Linux PHP nginx MySQL(各种百度各种添加过来)