![]() |
Jaci's Annual FRC Datadump 2016
Welcome to the inaugural release of my FRC datadumps :D
You can download the sql database here. It contains data about every match, stat, event, team, rank, district, award... everything. The database itself is about 13MB but it's been zipped together with some instructions and examples to bring the filesize down to about 5MB. So let's see what we can do with it.... How about seeing all the matches your team has had over 100 points? ![]() Code:
SELECT matches.key, events.short_name, match_scores.total_points, match_scores.alliance_color FROM matches![]() Code:
SELECT matches.key, match_scores.total_points, match_scores.alliance_color FROM matches![]() Code:
SELECT events.short_name, matches.key, match_scores.alliance_color, match_scores.auto_boulders_high, match_scores.teleop_boulders_high FROM match_scores Code:
SELECT events.short_name, alliances.num, teams.id FROM alliances |
Re: Jaci's Annual FRC Datadump 2016
Thanks for pulling all this together. I use R as a tool to look at data, so it will be nice to have all this available locally to mess around with.
|
Re: Jaci's Annual FRC Datadump 2016
Very impressive! Nice work. |
Re: Jaci's Annual FRC Datadump 2016
Quote:
Code:
SELECT events.short_name, alliances.num, teams.id, stats.opr FROM alliancesThanks again for putting this together. |
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Jaci, how is your name pronounced? Does it rhyme with "classy" or "lacy"? |
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Thanks for making all this data easily accessible. So here's something my team was casually tracking throughout the season: the 100% breach club. Here's the the sql for one way to get the answer:
Code:
select substr(teams.key, 4) as team, match_counts.match_countTeam Match Count 101 10 159 11 525 45 558 68 1014 30 1569 17 1750 11 1986 51 2062 28 2354 11 2767 63 2855 11 2882 10 3225 16 3238 65 3310 46 3488 10 3546 65 3683 50 3695 10 4476 12 4931 28 5254 45 5271 10 5618 27 5805 21 5905 11 5951 14 |
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
I am not an SQL expert so I was hoping someone could help me out.
Some trivia questions I was curious in: 1. Alliance with the greatest sum of team numbers; 2. Alliance with the lowest sum of team numbers; 3. Alliance with the narrowest range of team numbers; 4. Alliance with the widest range of team numbers; 5. Any Palindrome alliances during the year? (either full team numbers like 2052,525,2502 or spread across team numbers like 610,3130,16) |
Re: Jaci's Annual FRC Datadump 2016
Hmm... Franks blog post claims there were 13,303 matches played, but the matches table has only 13,302 rows.
Clearly there is something going on here and someone is hiding the data for a match that they don't want made public :D |
Re: Jaci's Annual FRC Datadump 2016
Quote:
6138+6137+6208 = 18483 (blue) 11+56+41 = 108 (red) |
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
Code:
(ac=="red") && ($3=="red"){red+=$4; next} |
Re: Jaci's Annual FRC Datadump 2016
I just did:
select count(*) from matches; which returned one less than Franks numbers. I've been doing SQL forever.... |
Re: Jaci's Annual FRC Datadump 2016
If you export the database tables, the "sqlite_sequence" table lists the number of records in each table: Code:
event_types 7 |
Re: Jaci's Annual FRC Datadump 2016
Quote:
sqlite> select a.team, b.team, c.team, max(a.team+b.team+c.team) from match_teams a join match_teams b on a.match=b.match join match_teams c on b.match = c.match where a.team <> b.team and a.team <> c.team and b.team <> c.team and a.alliance_color = b.alliance_color and b.alliance_color = c.alliance_color ; 6138|6137|6208|18483 sqlite> select a.team, b.team, c.team, min(a.team+b.team+c.team) from match_teams a join match_teams b on a.match=b.match join match_teams c on b.match = c.match where a.team <> b.team and a.team <> c.team and b.team <> c.team and a.alliance_color = b.alliance_color and b.alliance_color = c.alliance_color ; 41|11|56|108 |
Re: Jaci's Annual FRC Datadump 2016
Quote:
sqlite> select a.team, b.team, c.team, max(a.team - c.team) from match_teams a join match_teams b on a.match=b.match and a.team > b.team join match_teams c on b.match = c.match and b.team > c.team where a.alliance_color = b.alliance_color and b.alliance_color = c.alliance_color ; 6231|5536|11|6220 Narrowest: sqlite> select a.team, b.team, c.team, min(a.team - c.team) from match_teams a join match_teams b on a.match=b.match and a.team > b.team join match_teams c on b.match = c.match and b.team > c.team where a.alliance_color = b.alliance_color and b.alliance_color = c.alliance_color ; 177|176|175|2 |
Re: Jaci's Annual FRC Datadump 2016
Thank you
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
It's amazing how many tools there are to accomplish a given task. Always something new to learn. |
Re: Jaci's Annual FRC Datadump 2016
Quote:
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
I think there is a problem with jvriezen's SQL to get the max sum of team numbers on an alliance. I can't find a match where the 3 teams 6204|6191|6212 are on the same alliance. Here is my approach to answering this question:
select m.match, m.alliance_color, sum(m.team) as team_number_total from match_teams m group by m.match, m.alliance_color order by sum(m.team) desc It gives a descending order list with the winner being match 5986, blue alliance, team total 18483 (which agrees with Ether's answer). |
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
Code:
2662,444,blue,6083 |
Re: Jaci's Annual FRC Datadump 2016
Question for Ether or anyone else interested: is there a simple way using awk or other tools to get information about streaks from relational data like this? I've always resorted to writing a program (VB, T-SQL, java etc) because the SQL gets too ugly. For example: longest winning streak for each team (crossing events). It would be hard to do with this data currently because the event dates are not included but easy enough to add event_date field to the events table. To simplify my question, assuming id in the matches table was in chronological order for each team, how would you approach getting each team's longest winning streak?
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
|
Re: Jaci's Annual FRC Datadump 2016
Quote:
*********************** If the matches were sorted as you indicated (guaranteed that the matches for each team are in chronological order), which would not be too difficult to arrange, it would be a simple matter in awk or other scripting language to create arrays indexed on each team number:
Then, for each match, extend (or begin) the streak for each winner, and terminate the streak for each loser, taking care to update long_* from curr_* if curr_length[team] > long_length[team]. At the end of Einstein, close out all of the teams who won their last match (that is, curr_length>0). The trickiest/finickiest part would probably be initializing the arrays, unless you decided to brute force it and have cells for teams which no longer exist or otherwise did not compete this year. |
Re: Jaci's Annual FRC Datadump 2016
Quote:
Code:
* http://www.chiefdelphi.com/media/papers/3243 |
Re: Jaci's Annual FRC Datadump 2016
Quote:
Either TBA's missed a match or Frank's number is wrong, because I can assure you the data in the table is unaltered. |
Re: Jaci's Annual FRC Datadump 2016
1 Attachment(s)
Quote:
|
| All times are GMT -5. The time now is 02:56. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi