Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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")

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote