question

tish1579 avatar image
tish1579 asked

Orders placed by a particular employee

Hi I am new to SQL and I was asked a question by a friend (who is new aswell). We would like to know the commands/syntax where the output would be all the orders processed by a particular employee. We can assume two tables, employees and orders. Employees has the following columns - Empid, Empname, EmpDOB and Orders has the following columns - Orderid, Empid, Orderdate. Is this enough data to answer this quesion and if yes what is the answer. Thanks.
joins
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Wilfred van Dijk avatar image
Wilfred van Dijk answered
SELECT e.Empname , o.Orderid , o.Orderdate FROM Employees e JOIN Orders o ON e.Empid = o.Empid WHERE e.Empid = #### replace #### with the employee number
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tish1579 avatar image tish1579 commented ·
Thanks. I ran the query and it works fine.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.