Select the OrderID and the Customer Name from the Orders table that was sold by
ID: 3675156 • Letter: S
Question
Select the OrderID and the Customer Name from the Orders table that was sold by the employee with the last name of Peacock...table Orders contains categories OrderID CustomerID EmployeeID OrderDate ShipperID table Customers contains CustomerID CustomerName ContactName Address City PostalCode Country table Employees contains EmployeeID LastName FirstName BirthDate Photo Notes, so table Orders has the category EmployeeID and the table Employees contains EmployeeID and also the Employee's last name. The table Orders also contains CustomerID as well as the table Customers which contains the information of the EmployeeID of the employee that sold the order.
Explanation / Answer
select O.OrderId, C.CustomerName
from Orders O,Customers C
where O.CustomerID=C.CustomerID
and O.EmployeeID in(Select E.EmployeeID
from Employees E
where E.LastName="Peacock")
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.