1 -- count of games for the given year
2 select date_part('month', create_dt), count(*)
4 where date_part('year', create_dt) = 2012
5 group by date_part('month', create_dt)
6 order by date_part('month', create_dt);
8 -- count of game types for the given year
9 select game_type_cd, count(*)
11 where date_part('year', create_dt) = 2012
13 order by count(*) desc;
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);
22 -- count of servers with the most games
23 select servers.name, count(*)
25 where servers.server_id = games.server_id
26 and date_part('year', games.create_dt) = 2012
28 order by count(*) desc;
30 -- count of maps with the most games
31 select maps.name, count(*)
33 where maps.map_id = games.map_id
34 and date_part('year', games.create_dt) = 2012
36 order by count(*) desc;
38 -- new players by month
39 select date_part('month', create_dt), count(*)
41 where date_part('year', create_dt) = 2012
42 group by date_part('month', create_dt)
43 order by date_part('month', create_dt);