What are the name and id of the team offering the lowest average salary?
CREATE TABLE team (name VARCHAR, team_id VARCHAR); CREATE TABLE salary (team_id VARCHAR, salary INTEGER)
SELECT TOP 1 T1.name, T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY AVG(T2.salary)
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE team (name VARCHAR, team_id VARCHAR); CREATE TABLE salary (team_id VARCHAR, salary INTEGER) Question: What are the name and id of the team offering the lowest average salary? [/INST] SELECT TOP 1 T1.name, T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY AVG(T2.salary) </s>