Build World-Cups database

48 views
Skip to first unread message

Jonathan Bergara

unread,
May 7, 2021, 3:26:58 AMMay 7
to opensport
Hi Gerald,

I'm new to ruby and i'm required to create a database for exploration in a data science class. I'm interested in yours.

I've been trying for a few hours now to get the .db file for world-cups but i always reach the same stage and error:

ruby.jpg

Gerald Bauer

unread,
May 7, 2021, 4:40:33 AMMay 7
to open...@googlegroups.com
Hello,

Thanks for trying football.db.


> I've been trying for a few hours now to get the .db file for world-cups
> but i always reach the same stage and error:

I tried a fresh install via:

   $ gem install sportdb

And than a fresh build of the world cup datasets via:

   $ sportdb new worldcup

Sorry - it's working here. I haven't checked the data in details the stats via:

   $ sportdb stats

read

    {:adapter=>"sqlite3", :database=>"./sport.db"}
     1 leagues  /  21 seasons
     21 events (league+season recs)  /  211 rounds  /  117 groups  /  0 stages
     84 teams
     900 matches


How are you building the datasets?
What command do you use? Are you using the same steps?

Note: Sorry - for now you CANNOT update the datasets (that is, running the build twice) - you
always have to start with a fresh database (and your updated datasets if desired).

   Cheers. Prost.   



Jonathan Bergara

unread,
May 13, 2021, 6:27:47 PMMay 13
to opensport
Hi Gerald, thanks for answering so quickly and sorry i couldn't get back to you sooner.

I was following the exact steps, no extra script or anything, just using the $ sportdb new worldcup command inside an empty directory.

I got a somewhat working file that was the query to build the database but not the content itself. Am i missing something? something that i should have installed and i didn't?

Jonathan Bergara

unread,
May 13, 2021, 11:00:15 PMMay 13
to opensport
So in the end i was able to generate a sport.db sized at around 816 kb,

sportdb stats.png



Everything seems "ok" but the main problem is that the base is pretty much empty, i've tried to find ways to populate the tables with the .txt provided in the github file but nothing worked. Is there a proper way to load the data into it?

Gerald Bauer

unread,
May 14, 2021, 2:28:31 AMMay 14
to open...@googlegroups.com
Hello,

> I was following the exact steps, no extra script or anything, just using
> the $ sportdb new worldcup command inside an empty directory.
>
> I got a somewhat working file that was the query to build the database but not the content itself.
> Am i missing something? something that i should have installed and i didn't?

It is hard to tell as I cannot see what is in your directory.
If you run $ sportdb new worldcup the command has kind of three steps:

Step 1 - the build scripts gets download, that is, Datafile and stored
in the (empty) directory.
Step 2- the zip archives get download and stored in the (almost empty)
directory.
Step 3- the single-file sport.db SQLite database/file gets created in
the directory and the datasets read in from the local zip archives
from Step 2.

If you get an error, please try the --verbose option e.g. in an
empty (cleared out) directory:

$ sportdb --verbose new worldcup


Cheers. Prost.


El vie, 14 may 2021 a las 0:27, Jonathan Bergara
(<jonathan...@gmail.com>) escribió:
> --
> You received this message because you are subscribed to the Google Groups "opensport" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opensport+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/opensport/8b05e2ac-5ad4-4752-8fb1-e53669bcc353n%40googlegroups.com.

Gerald Bauer

unread,
May 14, 2021, 2:33:31 AMMay 14
to open...@googlegroups.com
Hello,

> Everything seems "ok" but the main problem is that the base is pretty much empty

Not sure what you mean.  There are not that many world cups (one every 4 years).
As far as I can tell the stats on your screenshot say / reads:

  21 season, 21 events
  84 teams
  900 matches

   That is - you should now have 21 world cups in your database with 84 national teams and 900 matches in total.

   What am I missing?  Sorry.
Reply all
Reply to author
Forward
0 new messages