Elo Rating in Pure SQL

So, here's the idea: Why not store just the games, and calculate the ratings (only when needed) directly in the database?