Add SQL queries
Fix wrong function argument