Find the names of the top 10 airlines that operate the most number of routes.
CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR)
SELECT TOP 10 T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) Question: Find the names of the top 10 airlines that operate the most number of routes. [/INST] SELECT TOP 10 T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC </s>