RienSQL
TASK #190 · Medium · Wargaming

Player Cohorts by Battle Count

Your brief
In the player_battles table each row is one battle of a player (player_id).

Split players into cohorts by their number of battles and count how many players fall into each cohort. Use these groups: 0-2, 3-5, 6-9, 10+.

Output cohort (one of the values above) and players_count (number of players in the cohort). Sort cohorts by the battle count ascending (first 0-2, then 3-5, and so on).
Expected columnscohort players_countWargaming — player battles
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
player_battlesbattle_id, player_id, nation, battle_date, exp