Fixed SQL statements to use column names