Top Posters
Since Sunday
22
21
20
17
16
15
15
14
14
14
14
14
New Topic  
wrote...
Posts: 117
Rep: 8 0
2 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);
Source  Download
Database Processing: Fundamentals, Design, and Implementation
Edition: 15th
Authors:
Read 19 times
3 Replies
Replies
Answer verified by a subject expert
wrote...
Posts: 105
2 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...
2 months ago
Thank you for answering so quickly
wrote...
2 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
  405 People Browsing
 115 Signed Up Today
Your Opinion
Related Images
 783
 67
 95