Reimplements score with SQL