I have a question about the following query.
I understand most parts of the following query, but I don't understand ' * 10000/count(*) Over() ' part.
Why would we multiply '1000/Count(*)'? and what does Over() do at the end of the query?
Select SalesPersonID, Sum(TotalDue) as TotalSales,
NTILe(10) Over (Order by Sum(TotalDue)) * 10000/Count(*) Over() as Bonus
where SalesPersonID is not null
group by SalesPersonID
order by TotalSales;