added sql, created temp table