-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmetaStatistics.sql
More file actions
50 lines (23 loc) · 1 KB
/
Copy pathmetaStatistics.sql
File metadata and controls
50 lines (23 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
-- Meta analysis (e.g. matches analysed, total players)
-- Richard Kelson
-- June 2021
USE AOE2
------------------------------------------------------------------------------------
-- general counts of the entire analysis
DROP VIEW IF EXISTS totalCounts
GO
CREATE VIEW totalCounts AS SELECT
(SELECT COUNT(DISTINCT match_id) FROM matches) AS matchesAnalysed, -- total matches analysed
(SELECT COUNT(DISTINCT profile_id) FROM leaderboard) AS playersAnalysed -- total players analysed
GO
------------------------------------------------------------------------------------
-- rating (ELO) distribution of players globally
DROP TABLE IF EXISTS ratingDistribution
GO
SELECT rating, COUNT(*) AS frequency
INTO ratingDistribution
FROM leaderboard
GROUP BY rating
ORDER BY rating ASC
------------------------------------------------------------------------------------
--Biggest civ wins (i.e. which civ matchup has greatest departure from 50% win rate)