fix sql, change test to fit my local database, fixed #46