locked
How to find out how many product and how much dollars of products were sold by each employee in each category? RRS feed

  • Question

  • User841325827 posted

    I am beginner in SQL and want learn SQL.

    I want to write a query in Northwind database to find out how many product and how much dollars of products were sold by each employee in each category?

    colud you help me plaese?

    Friday, February 19, 2016 5:09 PM

Answers

  • User1082734430 posted

    Hi,

    High level solution would be to join the tables - "Categories", "Products", "Order Details", "Orders" and "Employees".

    Please follow the steps -

    1) Inner join on "Categories", "Products", "Order Details", "Orders" and "Employees"

    2) Group by EmployeeID in the Orders table.

    3) Get the Sum(UnitPrice) and Count(Distinct ProductID) from OrderDetails table 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 21, 2016 5:28 PM