Question ID 4810 | You work as a database administrator at ABC.com. You study the exhibit carefully.
Exhibit:
You want to update the CUST_INCOME_LEVEL and CUST_CREDIT_LIMIT columns for the customer with the CUST_ID 2360. You want the value for the CUST_INCOME_LEVEL to have the same value as that of the customer with the CUST_ID 2560 and the CUST_CREDIT_LIMIT to have the same value as that of the customer with CUST_ID 2566.
Which UPDATE statement will accomplish the task?
|
Option A | A. UPDATE customers
SET (cust_income_level,cust_credit_limit) = (SELECT
cust_income_level, cust_credit_limit
FROM customers
WHERE cust_id IN (2560, 2566)
WHERE cust_id=2360;
|
Option B | B. UPDATE customers
SET (cust_income_level,cust_credit_limit) = (SELECT cust_income_level, cust_credit_limit
FROM customers
WHERE cust_id = 2560 AND cust_id = 2566)
WHERE cust_id=2360;
|
Option C | C. UPDATE customers
SET (cust_income_level,cust_credit_limit) = (SELECT
cust_income_level, cust_credit_limit
FROM customers
WHERE cust_id = 2560 OR cust_id = 2566)
WHERE cust_id=2360;
|
Option D | D. UPDATE customers
SET cust_income_level = (SELECT cust_income_level
FROM customers
WHERE cust_id = 2560),
cust_credit_limit = (SELECT cust_credit_limit
FROM customers
WHERE cust_id = 2566)
WHERE cust_id=2360;
|
Correct Answer | D |
Question ID 4811 | See the exhibit and examine the structure of the CUSTOMERS and GRADES tables:
Exhibit:
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.)
|
Option A | A. 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;
|
Option B | B. 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;
|
Option C | 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;
|
Option D | D. SELECT custname, grade
FROM customers, grades
WHERE (SELECT MAX(cust_credit_limit)
FROM customers) BETWEEN startval and endval;
|
Correct Answer | A,C |