This topic contains a solution. Click here to go to the answer

Author Question: Which of the following SQL statements is a correctly stated correlated subquery? A) SELECT ... (Read 57 times)

Jramos095

  • Hero Member
  • *****
  • Posts: 528
Which of the following SQL statements is a correctly stated correlated subquery?
 
  A) SELECT C1.CustName, C1.SalesRepNo
  FROM CUSTOMER C1
  WHERE C1.SalesRepNo IN
   (SELECT S1.SalesRepNo
   FROM SALESREP S1
   WHERE S1.RepName = 'Smith');
  B) 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);
  C) 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);
  D) 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.OrderNo<>C2.OrderNo);

Question 2

SQL Server security roles provide a simple way to control user privileges in a database.
 
  Indicate whether the statement is true or false



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by a Subject Expert

chloejackso

  • Sr. Member
  • ****
  • Posts: 316
Answer to Question 1

D

Answer to Question 2

TRUE




Jramos095

  • Member
  • Posts: 528
Reply 2 on: Jul 7, 2018
Great answer, keep it coming :)


ashely1112

  • Member
  • Posts: 347
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

IgA antibodies protect body surfaces exposed to outside foreign substances. IgG antibodies are found in all body fluids. IgM antibodies are the first type of antibody made in response to an infection. IgE antibody levels are often high in people with allergies. IgD antibodies are found in tissues lining the abdomen and chest.

Did you know?

When intravenous medications are involved in adverse drug events, their harmful effects may occur more rapidly, and be more severe than errors with oral medications. This is due to the direct administration into the bloodstream.

Did you know?

Patients should never assume they are being given the appropriate drugs. They should make sure they know which drugs are being prescribed, and always double-check that the drugs received match the prescription.

Did you know?

More than 34,000 trademarked medication names and more than 10,000 generic medication names are in use in the United States.

Did you know?

Amoebae are the simplest type of protozoans, and are characterized by a feeding and dividing trophozoite stage that moves by temporary extensions called pseudopodia or false feet.

For a complete list of videos, visit our video library