WCA Database Question(s)

ProStar

Legend
Joined
Oct 27, 2019
Messages
6,772
Location
An uncolonized sector of the planet Mars
SS Competition Results
I've just decided to play around with the WCA database and generate some statistics based around it. Being a Mac user, I decided to utilize the WCA Statistics page's online database query.

I'm having an issue that appears to be a discrepancy in the database (although I'm sure is due to a gap in my understanding). I was looking at the total scrambles generated per year, using the below command:

SQL:
SELECT SUBSTR(competitionId, -4, 4) AS Year, COUNT(*) AS Total333Scrambles FROM Scrambles WHERE eventId = '333' GROUP BY SUBSTR(competitionId, -4, 4) ORDER BY SUBSTR(competitionId, -4, 4)

I'm operating under the assumption that the last four characters of every competition name is the year it was held in (which as far as I can tell is correct). The command generates these results:

#YearTotal333Scrambles
1201416848
2201527566
3201637309
4201752582
5201862359
6201967248
7202012188
8202111656
9202252973
10202334616

Which sums to 375345 (the expected value). My first question is: why does the scrambles table only go back to 2014? My assumption is that the table didn't exist and scramble records weren't kept before this, but it's worth asking someone who actually knows.

After I saw this, I thought this number seemed a bit low. Because of this, I decided to check the total scrambles via the results table instead, since I assumed each recorded time should require exactly one scramble (although I did consider possible discrepancies such as extras that may have been generated but never used, as I wasn't sure what qualified something to go in the scrambles table). Using this code:

SQL:
SELECT SUBSTR(competitionId, -4, 4) AS Year, COUNT(*) * 5 AS TotalResults FROM Results WHERE eventId = '333' GROUP BY SUBSTR(competitionId, -4, 4)

I multiplied the total results value by 5 because each row in the results table accounts for an entire average. This of course won't be 100% accurate (for example, the 1982 worlds did only 3 solves instead of 5), but I figured it was close enough for my purposes. I got these results from that query:

#YearTotalResults
1198295
22003650
320042355
420055735
520069740
6200718220
7200839170
8200966770
9201089370
102011110735
112012119080
122013156160
132014224815
142015287870
152016393795
162017569320
172018692940
182019774120
192020131795
202021111295
212022658700
222023463685

Which sums to 4926415 (the same as selecting the count of all 3x3 results and multiplying by 5). Even looking at just 2023, there are 34616 entries in the scrambles table, and 463685 in the results table.

So my main question is: am I misunderstanding the structure/purpose of the results and scrambles table? If so, what is the true purpose of these tables? I'm relatively confident my code itself is not to blame, as I validated all my counts and grouping as much as I could. Although I'm also far from an expert in SQL so it's quite possible I'm missing the mistake I made in my queries.

Any help would be appreciated!
 
Which sums to 375345 (the expected value). My first question is: why does the scrambles table only go back to 2014? My assumption is that the table didn't exist and scramble records weren't kept before this, but it's worth asking someone who actually knows.

Indeed. We didn't require scrambles to be sent with competition results until Jan. 2013:
 
I assumed each recorded time should require exactly one scramble (although I did consider possible discrepancies such as extras that may have been generated but never used, as I wasn't sure what qualified something to go in the scrambles table).

You're right that each time should require exactly one scramble (besides edge cases like extras), but every scramble does not require exactly one result! Most scrambles are used for an entire group of competitors which explains the discrepancy. :)
 
You're right that each time should require exactly one scramble (besides edge cases like extras), but every scramble does not require exactly one result! Most scrambles are used for an entire group of competitors which explains the discrepancy. :)

Of course! I completely missed that connection, thanks for pointing it out
 
Back
Top