fixed sql syntax errors
Merge https://github.com/umass-cs-326/team-jmash