Hello,
Question: List the top 25% of employees in terms of sales. Your list should include employee number, last name, first name, total number of orders, total sales.
Here is what I have so far (not sure if my inner joins or even the query is totally correct):
select e.employee_no, e.fname, e.lname, count(o.employee_no) as order_count, sum(ol.qty * p.unit_price) as totalsales
from oes2.employee e
inner join oes2.orders o on e.employee_no = o.employee_no
inner join oes2.orderline ol on o.order_no = ol.order_no
inner join oes2.product p on ol.product_no = p.product_no
group by e.employee_no, e.fname, e.lname
order by sum(ol.qty * p.unit_price) desc
So yes. I just need to list the top 25% of the totalsales. How can I do that?
Thanks,
Mick