141.View the Exhibit and examine the structure of CUSTOMERS and GRADES tables.
You need to display names and grades of customers who have the highest credit limit.
WHERE (SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startval and endval;
A.SELECT custname, grade FROM customers, grades
WHERE (SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startval and endval;
B.SELECT custname, grade FROM customers, grades
WHERE (SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startval and endval
AND cust_credit_limit BETWEEN startval AND endval;
C.SELECT custname, grade FROM customers, grades
WHERE cust_credit_limit = (SELECT MAX(cust_credit_limit) FROM customers)
AND cust_credit_limit BETWEEN startval AND endval;
D.SELECT custname, grade FROM customers , grades
WHERE cust_credit_limit IN (SELECT MAX(cust_credit_limit) FROM customers)
AND MAX(cust_credit_limit) BETWEEN startval AND endval;
答案:BC
解析:首先两个表关联,如果不要笛卡尔连接的话,那么就应该有关联的条件,所以排除A,D语法有问题,排除掉
You need to display names and grades of customers who have the highest credit limit.
Which two SQL statements would accomplish the task? (Choose two.)
WHERE (SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startval and endval;
A.SELECT custname, grade FROM customers, grades
WHERE (SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startval and endval;
B.SELECT custname, grade FROM customers, grades
WHERE (SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startval and endval
AND cust_credit_limit BETWEEN startval AND endval;
C.SELECT custname, grade FROM customers, grades
WHERE cust_credit_limit = (SELECT MAX(cust_credit_limit) FROM customers)
AND cust_credit_limit BETWEEN startval AND endval;
D.SELECT custname, grade FROM customers , grades
WHERE cust_credit_limit IN (SELECT MAX(cust_credit_limit) FROM customers)
AND MAX(cust_credit_limit) BETWEEN startval AND endval;
答案:BC
解析:首先两个表关联,如果不要笛卡尔连接的话,那么就应该有关联的条件,所以排除A,D语法有问题,排除掉