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 41 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
Gracias!


aliotak

  • Member
  • Posts: 326
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

The toxic levels for lithium carbonate are close to the therapeutic levels. Signs of toxicity include fine hand tremor, polyuria, mild thirst, nausea, general discomfort, diarrhea, vomiting, drowsiness, muscular weakness, lack of coordination, ataxia, giddiness, tinnitus, and blurred vision.

Did you know?

GI conditions that will keep you out of the U.S. armed services include ulcers, varices, fistulas, esophagitis, gastritis, congenital abnormalities, inflammatory bowel disease, enteritis, colitis, proctitis, duodenal diverticula, malabsorption syndromes, hepatitis, cirrhosis, cysts, abscesses, pancreatitis, polyps, certain hemorrhoids, splenomegaly, hernias, recent abdominal surgery, GI bypass or stomach stapling, and artificial GI openings.

Did you know?

The Food and Drug Administration has approved Risperdal, an adult antipsychotic drug, for the symptomatic treatment of irritability in children and adolescents with autism. The approval is the first for the use of a drug to treat behaviors associated with autism in children. These behaviors are included under the general heading of irritability and include aggression, deliberate self-injury, and temper tantrums.

Did you know?

Astigmatism is the most common vision problem. It may accompany nearsightedness or farsightedness. It is usually caused by an irregularly shaped cornea, but sometimes it is the result of an irregularly shaped lens. Either type can be corrected by eyeglasses, contact lenses, or refractive surgery.

Did you know?

The U.S. Preventive Services Task Force recommends that all women age 65 years of age or older should be screened with bone densitometry.

For a complete list of videos, visit our video library