Find the name and id of the good with the highest average rank.
CREATE TABLE review (i_id VARCHAR, rank INTEGER); CREATE TABLE item (title VARCHAR, i_id VARCHAR)
SELECT TOP 1 T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rank) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE review (i_id VARCHAR, rank INTEGER); CREATE TABLE item (title VARCHAR, i_id VARCHAR) Question: Find the name and id of the good with the highest average rank. [/INST] SELECT TOP 1 T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rank) DESC </s>