Using a subquery, list the firstname and lastname of all customers with an order
ID: 3596407 • Letter: U
Question
Using a subquery, list the firstname and lastname of all customers with an order that has not shipped.
(TCO 7) Using a subquery, list the firstname and lastname of all customers with an order that has not shipped SalesRep PK ReplD int Customer PK CustomerlD int LastName FirstName CommissionRatedecimal(10,2) varchar(20) varchar(20) LastName varchar(20) FirstName varchar(20) Street City State Zipcode Balance varchar(20) varchar(20) char(2) char(5) decimal(10,2) int Order PK OrderlD int FK1 ReplD FK1 CustomerlD int OrderDate date ShipDate date Part PK PartID int OrderLine Description varchar(20) UnitsOnHandint ItemClass Retail Cost PK,FK1 OrderlDint PK,FK2 PartlD int char(4) decimal(10,2) decimal(10,2) Quantity intExplanation / Answer
select LastName,FirstName from Customer c,Order o where c.CustomerID=o.CustomerID and CustomerID in (select CustomerID from Order where Shipdate IS NULL);
The above query will print the required result. First the subquery will give the customerID's of those orders which doesn't shipped yet and for those customerID's the corresponding Lastname and Firstname will be printed because of outer query.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.