Fixed db_attributes SQL syntax