Top Posters
Since Sunday
79
20
16
15
12
10
10
9
9
8
8
8
New Topic  
wrote...
Posts: 191
Rep: 8 0
5 months ago
Which of the following SQL statements is a correctly stated correlated subquery?

• SELECT C1.CustName, C1.SalesRepNo
FROM CUSTOMER C1
WHERE C1.SalesRepNo IN
(SELECT S1.SalesRepNo
FROM SALESREP S1
WHERE S1.RepName = 'Smith');

• SELECT C1.CustName, C1.SalesRepNo
FROM CUSTOMER C1
WHERE C1.SalesRepNo IN
(SELECT S1.SaleRepNo
FROM SALESREP S1
WHERE S1.RepName = 'Smith')
AND C1.SalesRepNo=S1.SalesRepNo);

• SELECT C1.CustName, C1.SalesRepNo
FROM CUSTOMER C1
WHERE C1.SalesRepNo IN
(SELECT S1.SaleRepNo
FROM SALESREP S1
WHERE S1.RepName = 'Smith')
AND C1.SalesRepNoS1.SalesRepNo);

• SELECT C1.CustName, C1.SalesRepNo
FROM CUSTOMER C1
WHERE C1.SalesRepNo IN
(SELECT C2.SaleRepNo
FROM CUSTOMER C2
WHERE C1.SalesRepNo=C2.SalesRepNo);
AND C1.OrderNoC2.OrderNo);
Textbook 
Database Processing: Fundamentals, Design, and Implementation
Edition: 15th
Authors:
Read 47 times
3 Replies
Replies
Answer verified by a subject expert
wrote...
Posts: 218
5 months ago
Sign in or Sign up in seconds to unlock everything.
SELECT C1.CustName, C1.SalesRepNo
FROM CUSTOMER C1
WHERE C1.SalesRepNo IN
(SELECT C2.SaleRepNo
FROM CUSTOMER C2
WHERE C1.SalesRepNo=C2.SalesRepNo);
AND C1.OrderNoC2.OrderNo);
1
Related Topics
wrote...
5 months ago
Thank you for answering so quickly
wrote...
5 months ago
Was feeling bored, my pleasure Grinning Face with Smiling Eyes
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers.
Learn More
Improve Grades
Help Others
Save Time
Accessible 24/7
  90 People Browsing
Your Opinion
What percentage of nature vs. nurture dictates human intelligence?
Votes: 78

Related Images
 2907
 72
 117