Database: company_office

Question: What are the maximum and minimum sales of the companies whose industries are not "Banking".
SQL: SELECT max(Sales_billion) ,  min(Sales_billion) FROM Companies WHERE Industry != "Banking"

Question: Find the stories of the building with the largest height.
SQL: SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1

Question: List the name of a building along with the name of a company whose office is in the building.
SQL: SELECT T3.name ,  T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id  =  T2.id JOIN Companies AS T3 ON T1.company_id  =  T3.id

Question: Show the names of the buildings that have more than one company offices.
SQL: SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id  =  T2.id JOIN Companies AS T3 ON T1.company_id  =  T3.id GROUP BY T1.building_id HAVING COUNT(*)  >  1

Question: Show the name of the building that has the most company offices.
SQL: SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id  =  T2.id JOIN Companies AS T3 ON T1.company_id  =  T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1

Question: Please show the names of the buildings whose status is "on-hold", in ascending order of stories.
SQL: SELECT name FROM buildings WHERE Status  =  "on-hold" ORDER BY Stories ASC

Question: Please show the industries of companies in descending order of the number of companies.
SQL: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC

Question: List the industry shared by the most companies.
SQL: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1

Question: List the names of buildings that have no company office.
SQL: SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations)

Question: Show the industries shared by companies whose headquarters are "USA" and companies whose headquarters are "China".
SQL: SELECT Industry FROM Companies WHERE Headquarters  =  "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters  =  "China"

Question: Find the number of companies whose industry is "Banking" or "Conglomerate",
SQL: SELECT count(*) FROM Companies WHERE Industry  =  "Banking" OR Industry  =  "Conglomerate"