r/SQL • u/Livid-Explanation215 • Jul 15 '26
SQL Server how to solve this ??
Consider a table named "Sales" with columns: SalespersonID, CustomerID, SaleDate. Write a SQL query to calculate the salesperson who made the highest number of sales each quarter.
0
Upvotes
View all comments
Show parent comment
1
u/FretBoardHavoc Jul 15 '26
Some of these you would break out from the fields in the sales table- the sales table has the sale date as a field, so SaleYear and SaleQuarter(for example) are both derivable. SalesCount is also derivable.