Write a query using JOINS to list the last name,first name and OrderID for every
ID: 3596403 • Letter: W
Question
Write a query using JOINS to list the last name,first name and OrderID for every customer who currently has an order for any product with IPOD in the description.
(TCO 7) Write a query using JOINS to list the last name,first name and OrderlD for every customer who currently has an order for any product with IPOD in the description SalesRep PK RepID int Customer varchar(20) varchar(20) PK CustomerlD int LastName FirstName CommissionRatedecimal(10,2) 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) UnitsOnHand int ItemClass Retail Cost PK,FK1 OrderlDint PK,FK2 PartID int char(4) decimal(10,2) decimal(10,2) Quantity intExplanation / Answer
select LastName,FirstName,OrderID from Customer JOIN Order on Customer.CusstomerID=Order.CustomerID JOIN OrderLine on Order.OrderID=OrderLine.OrderID JOIN Part on OrderLine.PartID=Part.PartID and Part.Description like '%IPOD%';
This query will join 4 tables customer,order and orderline and part with their corresponding ids matched and will checks for the part having description IPOD and will give those corresponding partid with this by matching corresponding criteria written finally it will print the required results.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.