]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - scripts/dashboard_report.sql
A simple dashboard report for providing high level stats...about stats!
[xonotic/xonstatdb.git] / scripts / dashboard_report.sql
1 -- count of games for the given year
2 select date_part('month', create_dt), count(*) 
3 from games 
4 where date_part('year', create_dt) = 2012 
5 group by date_part('month', create_dt) 
6 order by date_part('month', create_dt);
7
8 -- count of game types for the given year
9 select game_type_cd, count(*) 
10 from games 
11 where date_part('year', create_dt) = 2012 
12 group by game_type_cd 
13 order by count(*) desc;
14
15 -- count of unique players playing in the given month
16 select date_part('month', create_dt), count(distinct player_id)
17 from player_game_stats
18 where date_part('year', create_dt) = 2012 
19 group by date_part('month', create_dt) 
20 order by date_part('month', create_dt);
21
22 -- count of servers with the most games
23 select servers.name, count(*)
24 from servers, games
25 where servers.server_id = games.server_id
26 and date_part('year', games.create_dt) = 2012 
27 group by servers.name
28 order by count(*) desc;
29
30 -- count of maps with the most games
31 select maps.name, count(*)
32 from games, maps
33 where maps.map_id = games.map_id
34 and date_part('year', games.create_dt) = 2012 
35 group by maps.name
36 order by count(*) desc;
37
38 -- new players by month
39 select date_part('month', create_dt), count(*)
40 from players
41 where date_part('year', create_dt) = 2012
42 group by date_part('month', create_dt)
43 order by date_part('month', create_dt);