SELECT
statement to choose the columns employee_id
and the calculated team_size
.COUNT()
function to count the number of employees within each partition.OVER()
clause to define the window, partitioning the data by team_id
so that the count is done per team.employee_id
and their corresponding team_size
.erDiagram Employee { int employee_id int team_id }