-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer_stats_2018-Present.sql
139 lines (130 loc) · 2.43 KB
/
player_stats_2018-Present.sql
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*Create view of all solo games and urls from 2018-2022*/
drop view if exists solo_teams;
create view solo_teams as
SELECT DISTINCT
year,
player,
champion,
team,
league,
url
FROM
elixerdata
WHERE
player = 'Solo'
AND (league = 'LCS'
OR league = 'NA LCS')
and NOT (team = 'Gold Coin United'
OR team = 'Team Liquid Academy')
and year >= 2018;
select * from solo_teams;
/* Just some stats for LCS players 2018-presentish*/
drop view if exists solo_team_stats ;
create view solo_team_stats as
select
e.year,
e.player,
e.team,
e.result,
e.firstbloodkill,
e.firstbloodassist,
e.firstbloodvictim,
e.total_cs,
s.damagetaken,
s.url,
e.position,
e.champion,
e.kills,
e.deaths,
e.assists,
e.dpm,
e.gamelength,
e.earnedgoldshare,
e.damageshare
from
elixerdata e
join scrapeddata s on e.url = s.url and e.champion = s.champion
where
e.year >= '2018'
and (e.league = 'LCS' or e.league = 'NA LCS')
order by e.year asc;
select * from solo_team_stats;
/* Just some stats for LCS players 2018-presentish*/
drop view if exists solo_team_stats ;
create view solo_team_stats as
select
e.year,
e.player,
e.team,
e.result,
e.firstbloodkill,
e.firstbloodassist,
e.firstbloodvictim,
e.total_cs,
s.damagetaken,
s.url,
e.position,
e.champion,
e.kills,
e.deaths,
e.assists,
e.dpm,
e.gamelength,
e.earnedgoldshare,
e.damageshare
from
elixerdata e
join scrapeddata s on e.url = s.url and e.champion = s.champion
where (e.url, e.team) in (
SELECT
url,
team
/*league,
url,
year,
player,
champion,*/
FROM
elixerdata
WHERE
player = 'Solo'
AND (league = 'LCS'
OR league = 'NA LCS')
and NOT (team = 'Gold Coin United'
OR team = 'Team Liquid Academy')
and year >= 2018)
and e.year >= '2018'
and (e.league = 'LCS' or e.league = 'NA LCS')
order by e.year asc, e.team ;
/*
select distinct year, team, player, position from elixerdata where
(league = 'LCS'
OR league = 'NA LCS')
and NOT (team = 'Gold Coin United'
OR team = 'Team Liquid Academy')
and year >= 2018
and NOT position = 'team'
order by year, team, position;
*/
select
year,
player,
team,
result,
(sum(firstbloodkill + firstbloodassist)/sum(firstbloodkill + firstbloodassist)) as 'FB_Participation',
firstbloodkill,
firstbloodassist,
e.firstbloodvictim,
e.total_cs,
s.damagetaken,
s.url,
e.position,
e.champion,
e.kills,
e.deaths,
e.assists,
e.dpm,
e.gamelength,
e.earnedgoldshare,
e.damageshare
from solo_team_stats