Skip to content

EvilScott/soccer

Repository files navigation

Soccer on Rails

Run the Rake task after grabbing the data source and putting it here: db/soccer.sqlite

$ rake db:rebuild 

Test query with cleaned up data:

SELECT
  ht.short_name || ' ' || m.home_team_goal || ' - ' || m.away_team_goal || ' ' || at.short_name AS result,
  m.date
FROM matches m
  JOIN leagues l ON (m.league_id = l.id)
  JOIN seasons s ON (m.season_id = s.id)
  JOIN teams ht ON (m.home_team_id = ht.id)
  JOIN teams at ON (m.away_team_id = at.id)
WHERE l.name = 'England Premier League'
      AND s.name = '2015/2016'
ORDER BY m.date

About

Rails modeling soccer data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published