View the Exhibit and examine the structure of the CUSTOMERS table.
Which two tasks would require subqueries or joins to be executed in a single statement? (Choose two.)
A.
listing of customers who do not have a credit limit and were born before 1980
B.
finding the number of customers, in each city, whose marital status is ‘married’
C.
finding the average credit limit of male customers residing in ‘Tokyo’ or ‘Sydney’
D.
listing of those customers whose credit limit is the same as the credit limit of customers residing in the city ‘Tokyo’
E.
finding the number of customers, in each city, whose credit limit is more than the average credit limit of all the customers
I didnt understand this can anyone explain ??????????
for example, E:
select cust_city,count(*) from customers
where cust_credit_limit > (select avg(cust_credit_limit) from customers)
group by cust_city
For Example, D:
select cust_id from customers where cust_cerdit_limit in (select cust_credit_limit from customers where cust_city=’Tokyo’;
858235 470974Soon after study some with the weblog posts on your personal internet site now, we genuinely like your way of blogging. I bookmarked it to my bookmark internet internet site list and are checking back soon. Pls consider my web-site likewise and make me aware in case you agree. 674992
With the first three statements you are trying to answer a question with two parts, but only one unknown.
1) Customers who do not have a credit limit (unknown) and were born before 1980 (known).
2) Number of customers in each city (unknown) and whose marital status is married (known).
3) Average credit limit of male customers (unknown) residing in Tokyo or Sydney (known).
The last two questions have two parts, but also two unknowns.
4) Number of customers who’s credit limit is (unknown) the same as the credit limit of customers residing in the city of Tokyo (also unknown).
5) Number of customers in each city (unknown) whose credit limit is more than the average of the credit limit of all the customers (also unknown).
Hello TestTaker,
this is a nice and handy way to test if you need a sub-query.
Thanks
A.
SELECT cust_id
FROM customers
WHERE cust_credit_limit IS NULL
AND cust_year_of_birth (SELECT AVG(cust_credit_limit
FROM customers);