aherntech/sparc huggingface dataset:
Database: manufactory_1
Question sequence:
how many companies are there?
What is their average revenue?
Find the names of companies whose revenue is greater than the average.
SQL query sequence:
SELECT count(*) FROM manufacturers
SELECT avg(revenue) FROM manufacturers
SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)
Final question: Find the name of companies whose revenue is greater than the average revenue of all companies.
Final SQL: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)
Database: manufactory_1
Question sequence:
how many companies are based in Austin?
show their revenues
Find the names of companies whose revenue is smaller than all of those revenues.
SQL query sequence:
SELECT count(*) FROM manufacturers WHERE headquarter  =  'Austin'
SELECT revenue FROM manufacturers WHERE headquarter  =  'Austin'
SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
Final question: Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.
Final SQL: SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
Database: manufactory_1
Question sequence:
what are the names of the companies based in Austin?
find the names of companies whose revenue is larger than the largest revenue of those companies.
return the total revenue of the resulting companies.
SQL query sequence:
SELECT name FROM manufacturers WHERE headquarter  =  'Austin'
SELECT name FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
Final question: Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.
Final SQL: SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')
Database: manufactory_1
Question sequence:
find the number of all products from each manufacture. list each company's name.
show the average price of each company’s products.
SQL query sequence:
SELECT count(*),  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
SELECT avg(T1.price),  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
Final question: Find the average prices of all products from each manufacture, and list each company's name.
Final SQL: SELECT avg(T1.price),  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
Database: manufactory_1
Question sequence:
how many different headquarter cities are there?
Find the number of different products that are from companies at each headquarter.
SQL query sequence:
SELECT count(distinct headquarter) FROM manufacturers
SELECT count(DISTINCT T1.name),  T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.Headquarter
Final question: Find the number of different products that are produced by companies at different headquarter cities.
Final SQL: SELECT count(DISTINCT T1.name),  T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.Headquarter
Database: manufactory_1
Question sequence:
find the name of all products.
which of them does Sony make.
Find the number of products that Sony does not make.
SQL query sequence:
SELECT name FROM products
SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony'
SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony')
Final question: Find number of products which Sony does not make.
Final SQL: SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony')
Database: manufactory_1
Question sequence:
Find the names of companies that produce DVD drives.
how about the companies that do not make them?
SQL query sequence:
SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive'
SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive'
Final question: Find the name of companies that do not make DVD drive.
Final SQL: SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive'
Database: manufactory_1
Question sequence:
how many products are in the record?
find the number for each manufacturer, showing the name of each company.
SQL query sequence:
SELECT count(*) FROM products
SELECT count(*) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
Final question: Find the number of products for each manufacturer, showing the name of each company.
Final SQL: SELECT count(*) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
Database: manufactory_1
Question sequence:
Select the name of all products.
which one is the most expensive?
also show its price.
how about the products with a price larger than or equal to 180?
sort the result by price (in descending order).
then order by name  (in ascending order).
SQL query sequence:
SELECT name FROM products
SELECT name FROM products ORDER BY price DESC limit 1
SELECT name, price FROM products ORDER BY price DESC limit 1
SELECT name,  price FROM products WHERE price  >=  180
SELECT name,  price FROM products WHERE price  >=  180 ORDER BY price DESC
SELECT name,  price FROM products WHERE price  >=  180 ORDER BY price DESC ,  name ASC
Final question: Select the name and price of all products with a price larger than or equal to 180, and sort first by price (in descending order), and then by name  (in ascending order).
Final SQL: SELECT name,  price FROM products WHERE price  >=  180 ORDER BY price DESC ,  name ASC
Database: manufactory_1
Question sequence:
Show the names of all manufacturers.
how many products do each of them produce?
what are their average prices?
SQL query sequence:
SELECT name FROM Manufacturers
SELECT count(*),  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name
SELECT avg(T1.Price),  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name
Final question: Select the average price of each manufacturer's products, showing the manufacturer's name.
Final SQL: SELECT avg(T1.Price),  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name
Database: manufactory_1
Question sequence:
find the name of products with a price higher than or equal to $150.
what are the names of manufacturers that produce these products?
Select the names of manufacturer whose products have an average price higher than or equal to $150.
SQL query sequence:
SELECT name FROM products WHERE price >= 150
SELECT DISTINCT T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code WHERE T1.price >= 150
SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150
Final question: Select the names of manufacturer whose products have an average price higher than or equal to $150.
Final SQL: SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150
Database: manufactory_1
Question sequence:
what is the name of the most expensive product?
how about the cheapest product?
show its price as well.
SQL query sequence:
SELECT name FROM Products ORDER BY price DESC LIMIT 1
SELECT name FROM Products ORDER BY price ASC LIMIT 1
SELECT name ,  price FROM Products ORDER BY price ASC LIMIT 1
Final question: Select the name and price of the cheapest product.
Final SQL: SELECT name ,  price FROM Products ORDER BY price ASC LIMIT 1
Database: flight_4
Question sequence:
show all different countries that have airports in the record.
could you please list the names of airports in Cuba?
also list Argentina's airports.
SQL query sequence:
SELECT distinct country FROM airports
SELECT name FROM airports WHERE country  =  'Cuba'
SELECT name FROM airports WHERE country  =  'Cuba' OR country  =  'Argentina'
Final question: Find the name of the airports located in Cuba or Argentina.
Final SQL: SELECT name FROM airports WHERE country  =  'Cuba' OR country  =  'Argentina'
Database: flight_4
Question sequence:
what are all of the airline names?
which of them start with 'Orbit'?
how many are there?
Find the country of these airlines.
SQL query sequence:
SELECT distinct name FROM airlines
SELECT distinct name FROM airlines WHERE name LIKE 'Orbit%'
SELECT count(*) FROM airlines WHERE name LIKE 'Orbit%'
SELECT DISTINCT country FROM airlines WHERE name LIKE 'Orbit%'
Final question: Find the country of the airlines whose name starts with 'Orbit'.
Final SQL: SELECT country FROM airlines WHERE name LIKE 'Orbit%'
Database: flight_4
Question sequence:
how many airports are there?
which airport has the lowest elevation?
how about the one with the highest elevation?
which country is it located in?
SQL query sequence:
SELECT count(*) FROM airports
SELECT * FROM airports ORDER BY elevation LIMIT 1
SELECT * FROM airports ORDER BY elevation DESC LIMIT 1
SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
Final question: Which country is the airport that has the highest altitude located in?
Final SQL: SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
Database: flight_4
Question sequence:
please show all airport names.
what is the total number of airports?
among them, how many contain the word 'International' in their name?
SQL query sequence:
SELECT name FROM airports
SELECT count(*) FROM airports
SELECT count(*) FROM airports WHERE name LIKE '%International%'
Final question: Find the number of airports whose name contain the word 'International'.
Final SQL: SELECT count(*) FROM airports WHERE name LIKE '%International%'
Database: flight_4
Question sequence:
what is the icao code for American Airlines?
which routes are operated by American Airlines?
please count the number of routes.
SQL query sequence:
SELECT icao FROM airlines WHERE name  =  'American Airlines'
SELECT * FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid WHERE T1.name  =  'American Airlines'
SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid WHERE T1.name  =  'American Airlines'
Final question: Find the number of routes operated by American Airlines.
Final SQL: SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid WHERE T1.name  =  'American Airlines'
Database: flight_4
Question sequence:
how many airports does each country have?
how many does Canada have?
what is the total number of routes that end there?
SQL query sequence:
SELECT count(*), country FROM airports GROUP BY country
SELECT count(*) FROM airports WHERE country  =  'Canada'
SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.dst_apid WHERE country  =  'Canada'
Final question: Find the number of routes whose destination airports are in Canada.
Final SQL: SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.dst_apid WHERE country  =  'Canada'
Database: flight_4
Question sequence:
what is the lowest elevation of all airports?
what is the name of that airport?
also show the city and country where it is located.
SQL query sequence:
SELECT min(elevation) FROM airports
SELECT name FROM airports ORDER BY elevation LIMIT 1
SELECT name ,  city ,  country FROM airports ORDER BY elevation LIMIT 1
Final question: Find the name, city, and country of the airport that has the lowest altitude.
Final SQL: SELECT name ,  city ,  country FROM airports ORDER BY elevation LIMIT 1
Database: flight_4
Question sequence:
what is the average elevation of all airports?
order the airport info by latitude from highest to lowest.
just show name, city, and country of the highest one.
SQL query sequence:
SELECT avg(elevation) FROM airports
SELECT * FROM airports ORDER BY elevation DESC
SELECT name ,  city ,  country FROM airports ORDER BY elevation DESC LIMIT 1
Final question: Find the name, city, and country of the airport that has the highest latitude.
Final SQL: SELECT name ,  city ,  country FROM airports ORDER BY elevation DESC LIMIT 1
Database: flight_4
Question sequence:
how many routes are there?
find the number of routes for each destination.
what is the name and city of the destination airport that has the most routes ending there?
SQL query sequence:
SELECT count(*) FROM routes
SELECT count(*), dst_apid FROM routes GROUP BY dst_apid
SELECT T1.name,  T1.city FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.dst_apid GROUP BY T2.dst_apid ORDER BY count(*) DESC LIMIT 1
Final question: Find the name and city of the airport which is the destination of the most number of routes.
Final SQL: SELECT T1.name,  T1.city FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.dst_apid GROUP BY T2.dst_apid ORDER BY count(*) DESC LIMIT 1
Database: flight_4
Question sequence:
Provide the names of all airlines.
Find the number of routes provided by each airline. Show airline name.
which airline operates the most routes?
what are the top 10 airlines?
SQL query sequence:
SELECT name FROM airlines
SELECT count(*), T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T1.name
SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 1
SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10
Final question: Find the names of the top 10 airlines that operate the most number of routes.
Final SQL: SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10
Database: flight_4
Question sequence:
Show the name and city of all airports.
Show the number of flight routes for each of them as a source airport.
which of them has the most routes?
SQL query sequence:
SELECT name, city FROM airports
SELECT T1.name, T1.city, count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid
SELECT T1.name, T1.city FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T2.src_apid ORDER BY count(*) DESC LIMIT 1
Final question: Find the name and city of the airport which is the source for the most number of flight routes.
Final SQL: SELECT T1.name, T1.city FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T2.src_apid ORDER BY count(*) DESC LIMIT 1
Database: flight_4
Question sequence:
how many routes does American Airlines have?
How many destinations do these routes go to?
SQL query sequence:
SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid WHERE T1.name  =  'American Airlines'
SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid WHERE T1.name  =  'American Airlines'
Final question: Find the number of different airports which are the destinations of the American Airlines.
Final SQL: SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid WHERE T1.name  =  'American Airlines'
Database: flight_4
Question sequence:
how many countries have airlines?
how many airlines does each country have?
show the one that has the most.
SQL query sequence:
SELECT count(distinct country) FROM airlines
SELECT count(*), country FROM airlines GROUP BY country
SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1
Final question: Which countries has the most number of airlines?
Final SQL: SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1
Database: flight_4
Question sequence:
what are the different active codes?
show the name of airlines whose active status is 'Y'.
Which country has the largest number of these airlines?
SQL query sequence:
SELECT distinct active FROM airlines
SELECT name FROM airlines WHERE active  =  'Y'
SELECT country FROM airlines WHERE active  =  'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Final question: Which countries has the most number of airlines whose active status is 'Y'?
Final SQL: SELECT country FROM airlines WHERE active  =  'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Database: flight_4
Question sequence:
List all countries and the number of airlines for each one.
list them in ascending order of number of airlines.
list in descending order.
SQL query sequence:
SELECT country ,  count(*) FROM airlines GROUP BY country
SELECT country ,  count(*) FROM airlines GROUP BY country ORDER BY count(*)
SELECT country ,  count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC
Final question: List all countries and their number of airlines in the descending order of number of airlines.
Final SQL: SELECT country ,  count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC
Database: flight_4
Question sequence:
how many airports are in the record?
how many airports are in each country?
order them by number of airports in decreasing order.
SQL query sequence:
SELECT count(*) FROM airports
SELECT count(*), country FROM airports GROUP BY country
SELECT count(*),  country FROM airports GROUP BY country ORDER BY count(*) DESC
Final question: How many airports are there per country? Order the countries by decreasing number of airports.
Final SQL: SELECT count(*) ,  country FROM airports GROUP BY country ORDER BY count(*) DESC
Database: flight_4
Question sequence:
how many airports does the US has?
what is the number of airports in each city in the US?
Order the cities by decreasing number of airports.
SQL query sequence:
SELECT count(*) FROM airports WHERE country  =  'United States'
SELECT count(*) ,  city FROM airports WHERE country  =  'United States' GROUP BY city
SELECT count(*) ,  city FROM airports WHERE country  =  'United States' GROUP BY city ORDER BY count(*) DESC
Final question: How many airports are there per city in the United States? Order the cities by decreasing number of airports.
Final SQL: SELECT count(*) ,  city FROM airports WHERE country  =  'United States' GROUP BY city ORDER BY count(*) DESC
Database: flight_4
Question sequence:
show all cities that have an airport.
which of them are in the United States?
just show cities that have more than 2 airports.
how about more than 3?
SQL query sequence:
SELECT city FROM airports
SELECT city FROM airports WHERE country  =  'United States'
SELECT city FROM airports WHERE country  =  'United States' GROUP BY city HAVING count(*)  >  2
SELECT city FROM airports WHERE country  =  'United States' GROUP BY city HAVING count(*)  >  3
Final question: Return the cities with more than 3 airports in the United States.
Final SQL: SELECT city FROM airports WHERE country  =  'United States' GROUP BY city HAVING count(*)  >  3
Database: flight_4
Question sequence:
which cities have more than 3 airports?
how many are there?
SQL query sequence:
SELECT city FROM airports GROUP BY city HAVING count(*)  >  3
SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*)  >  3)
Final question: How many cities are there that have more than 3 airports?
Final SQL: SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*)  >  3)
Database: flight_4
Question sequence:
list all cities.
how many airports does each city have?
just show cities that have more than one airport.
include the number of airports per city.
SQL query sequence:
SELECT city FROM airports
SELECT city ,  count(*) FROM airports GROUP BY city
SELECT city FROM airports GROUP BY city HAVING count(*)  >  1
SELECT city ,  count(*) FROM airports GROUP BY city HAVING count(*)  >  1
Final question: List the cities which have more than one airport and number of airports.
Final SQL: SELECT city ,  count(*) FROM airports GROUP BY city HAVING count(*)  >  1
Database: flight_4
Question sequence:
how many cities have more than 2 airports?
what are these cities?
sort the results by the number of airports.
SQL query sequence:
SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*)  >  2)
SELECT city FROM airports GROUP BY city HAVING count(*)  >  2
SELECT city FROM airports GROUP BY city HAVING count(*)  >  2 ORDER BY count(*)
Final question: List the cities which have more than 2 airports sorted by the number of airports.
Final SQL: SELECT city FROM airports GROUP BY city HAVING count(*)  >  2 ORDER BY count(*)
Database: flight_4
Question sequence:
list the names of all airports.
also list the number of routes that list them as the source airport.
SQL query sequence:
SELECT name FROM airports
SELECT count(*),  T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T1.name
Final question: Find the number of routes for each source airport and the airport name.
Final SQL: SELECT count(*),  T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T1.name
Database: flight_4
Question sequence:
how many routes are there?
what are their source airports? List airport names.
For each of those airports, how many routes does it have?
order the result by decreasing number of routes
SQL query sequence:
SELECT count(*) FROM routes
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid
SELECT count(*) ,  T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T1.name
SELECT count(*) ,  T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC
Final question: Find the number of routes and airport name for each source airport, order the results by decreasing number of routes.
Final SQL: SELECT count(*) ,  T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC
Database: flight_4
Question sequence:
which cities have more than one airport?
ok, which of them have exactly two?
SQL query sequence:
SELECT city FROM airports GROUP BY city HAVING count(*)  > 1
SELECT city FROM airports GROUP BY city HAVING count(*)  =  2
Final question: Find the cities which have exactly two airports.
Final SQL: SELECT city FROM airports GROUP BY city HAVING count(*)  =  2
Database: flight_4
Question sequence:
how many routes are there?
please list the number of routes for each country and airline.
SQL query sequence:
SELECT count(*) FROM routes
SELECT T1.country,  T1.name,  count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T1.country,  T1.name
Final question: For each country and airline name, how many routes are there?
Final SQL: SELECT T1.country,  T1.name,  count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T1.country,  T1.name
Database: flight_4
Question sequence:
how many airports are in Italy?
show the info of routes listing those airports as destinations.
count the total number.
SQL query sequence:
SELECT count(*) FROM airports WHERE country  =  'Italy'
SELECT * FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid  =  T2.apid WHERE T2.country  =  'Italy'
SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid  =  T2.apid WHERE T2.country  =  'Italy'
Final question: Find the number of routes with destination airports in Italy.
Final SQL: SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid  =  T2.apid WHERE T2.country  =  'Italy'