db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
---|---|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the names and headquarters of all companies ordered by descending market value?
#
### SQL:
#
# SELECT company , headquarters FROM company ORDER BY market_value DESC
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show minimum, maximum, and average market value for all companies.
#
### SQL:
#
# SELECT min(market_value) , max(market_value) , avg(market_value) FROM company
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What is the minimum, maximum, and average market value for every company?
#
### SQL:
#
# SELECT min(market_value) , max(market_value) , avg(market_value) FROM company
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show all main industry for all companies.
#
### SQL:
#
# SELECT DISTINCT main_industry FROM company
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the different main industries for all companies?
#
### SQL:
#
# SELECT DISTINCT main_industry FROM company
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# List all headquarters and the number of companies in each headquarter.
#
### SQL:
#
# SELECT headquarters , count(*) FROM company GROUP BY headquarters
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# For each headquarter, what are the headquarter and how many companies are centered there?
#
### SQL:
#
# SELECT headquarters , count(*) FROM company GROUP BY headquarters
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show all main industry and total market value in each industry.
#
### SQL:
#
# SELECT main_industry , sum(market_value) FROM company GROUP BY main_industry
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the main indstries and total market value for each industry?
#
### SQL:
#
# SELECT main_industry , sum(market_value) FROM company GROUP BY main_industry
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# List the main industry with highest total market value and its number of companies.
#
### SQL:
#
# SELECT main_industry , count(*) FROM company GROUP BY main_industry ORDER BY sum(market_value) DESC LIMIT 1
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# For each main industry, what is the total number of companies for the industry with the highest total market value?
#
### SQL:
#
# SELECT main_industry , count(*) FROM company GROUP BY main_industry ORDER BY sum(market_value) DESC LIMIT 1
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show headquarters with at least two companies in the banking industry.
#
### SQL:
#
# SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING count(*) >= 2
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the headquarters with at least two companies in the banking industry?
#
### SQL:
#
# SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING count(*) >= 2
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show gas station id, location, and manager_name for all gas stations ordered by open year.
#
### SQL:
#
# SELECT station_id , LOCATION , manager_name FROM gas_station ORDER BY open_year
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the gas station ids, locations, and manager names for the gas stations ordered by opening year?
#
### SQL:
#
# SELECT station_id , LOCATION , manager_name FROM gas_station ORDER BY open_year
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# How many gas station are opened between 2000 and 2005?
#
### SQL:
#
# SELECT count(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What is the total number of gas stations that opened between 2000 and 2005?
#
### SQL:
#
# SELECT count(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show all locations and the number of gas stations in each location ordered by the count.
#
### SQL:
#
# SELECT LOCATION , count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*)
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# For each location, how many gas stations are there in order?
#
### SQL:
#
# SELECT LOCATION , count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*)
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show all headquarters with both a company in banking industry and a company in Oil and gas.
#
### SQL:
#
# SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the headquarters that have both a company in the banking and 'oil and gas' industries?
#
### SQL:
#
# SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show all headquarters without a company in banking industry.
#
### SQL:
#
# SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the headquarters without companies that are in the banking industry?
#
### SQL:
#
# SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show the company name with the number of gas station.
#
### SQL:
#
# SELECT T2.company , count(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# For each company id, what are the companies and how many gas stations does each one operate?
#
### SQL:
#
# SELECT T2.company , count(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show company name and main industry without a gas station.
#
### SQL:
#
# SELECT company , main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the main industries of the companies without gas stations and what are the companies?
#
### SQL:
#
# SELECT company , main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show the manager name for gas stations belonging to the ExxonMobil company.
#
### SQL:
#
# SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the names of the managers for gas stations that are operated by the ExxonMobil company?
#
### SQL:
#
# SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show all locations where a gas station for company with market value greater than 100 is located.
#
### SQL:
#
# SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the locations that have gas stations owned by a company with a market value greater than 100?
#
### SQL:
#
# SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# Show the manager name with most number of gas stations opened after 2000.
#
### SQL:
#
# SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What is the name of the manager with the most gas stations that opened after 2000?
#
### SQL:
#
# SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# order all gas station locations by the opening year.
#
### SQL:
#
# SELECT LOCATION FROM gas_station ORDER BY open_year
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the locations of all the gas stations ordered by opening year?
#
### SQL:
#
# SELECT LOCATION FROM gas_station ORDER BY open_year
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.
#
### SQL:
#
# SELECT rank , company , market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion , profits_billion
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What is the rank, company, and market value of every comapny in the banking industry ordered by sales and profits?
#
### SQL:
#
# SELECT rank , company , market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion , profits_billion
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.
#
### SQL:
#
# SELECT T3.location , T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3
#
### End.
|
gas_company
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# company ( Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value )
# gas_station ( Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name )
# station_company ( Station_ID, Company_ID, Rank_of_the_Year )
#
# station_company.Company_ID can be joined with company.Company_ID
# station_company.Station_ID can be joined with gas_station.Station_ID
#
### Question:
#
# What are the locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets?
#
### SQL:
#
# SELECT T3.location , T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# How many regions do we have?
#
### SQL:
#
# SELECT count(*) FROM region
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Count the number of regions.
#
### SQL:
#
# SELECT count(*) FROM region
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show all distinct region names ordered by their labels.
#
### SQL:
#
# SELECT DISTINCT region_name FROM region ORDER BY Label
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# What are the different region names, ordered by labels?
#
### SQL:
#
# SELECT DISTINCT region_name FROM region ORDER BY Label
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# How many parties do we have?
#
### SQL:
#
# SELECT count(DISTINCT party_name) FROM party
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Count the number of different parties.
#
### SQL:
#
# SELECT count(DISTINCT party_name) FROM party
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show the ministers and the time they took and left office, listed by the time they left office.
#
### SQL:
#
# SELECT minister , took_office , left_office FROM party ORDER BY left_office
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Who are the ministers, when did they take office, and when did they leave office, ordered by when they left office?
#
### SQL:
#
# SELECT minister , took_office , left_office FROM party ORDER BY left_office
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show the minister who took office after 1961 or before 1959.
#
### SQL:
#
# SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Who are the ministers who took office after 1961 or before 1959?
#
### SQL:
#
# SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show all ministers who do not belong to Progress Party.
#
### SQL:
#
# SELECT minister FROM party WHERE party_name != 'Progress Party'
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Which ministers are not a part of the Progress Party?
#
### SQL:
#
# SELECT minister FROM party WHERE party_name != 'Progress Party'
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show all ministers and parties they belong to in descending order of the time they took office.
#
### SQL:
#
# SELECT minister , party_name FROM party ORDER BY took_office DESC
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Who are the ministers and what parties do they belong to, listed descending by the times they took office?
#
### SQL:
#
# SELECT minister , party_name FROM party ORDER BY took_office DESC
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Return the minister who left office at the latest time.
#
### SQL:
#
# SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Which minister left office the latest?
#
### SQL:
#
# SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# List member names and their party names.
#
### SQL:
#
# SELECT T1.member_name , T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# What are the names of members and their corresponding parties?
#
### SQL:
#
# SELECT T1.member_name , T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show all party names and the number of members in each party.
#
### SQL:
#
# SELECT T2.party_name , count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# How many members are in each party?
#
### SQL:
#
# SELECT T2.party_name , count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# What is the name of party with most number of members?
#
### SQL:
#
# SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY count(*) DESC LIMIT 1
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Return the name of the party with the most members.
#
### SQL:
#
# SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY count(*) DESC LIMIT 1
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show all party names and their region names.
#
### SQL:
#
# SELECT T1.party_name , T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# What are the names of parties and their respective regions?
#
### SQL:
#
# SELECT T1.party_name , T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show names of parties that does not have any members.
#
### SQL:
#
# SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# What are the names of parties that have no members?
#
### SQL:
#
# SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show the member names which are in both the party with id 3 and the party with id 1.
#
### SQL:
#
# SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Which member names are shared among members in the party with the id 3 and the party with the id 1?
#
### SQL:
#
# SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show member names that are not in the Progress Party.
#
### SQL:
#
# SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name != "Progress Party"
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Which member names corresponding to members who are not in the Progress Party?
#
### SQL:
#
# SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name != "Progress Party"
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# How many party events do we have?
#
### SQL:
#
# SELECT count(*) FROM party_events
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Count the number of party events.
#
### SQL:
#
# SELECT count(*) FROM party_events
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show party names and the number of events for each party.
#
### SQL:
#
# SELECT T2.party_name , count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# How many events are there for each party?
#
### SQL:
#
# SELECT T2.party_name , count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Show all member names who are not in charge of any event.
#
### SQL:
#
# SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# What are the names of members who are not in charge of any events?
#
### SQL:
#
# SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# What are the names of parties with at least 2 events?
#
### SQL:
#
# SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING count(*) >= 2
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Return the names of parties that have two or more events.
#
### SQL:
#
# SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING count(*) >= 2
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# What is the name of member in charge of greatest number of events?
#
### SQL:
#
# SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY count(*) DESC LIMIT 1
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Return the name of the member who is in charge of the most events.
#
### SQL:
#
# SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY count(*) DESC LIMIT 1
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# find the event names that have more than 2 records.
#
### SQL:
#
# SELECT event_name FROM party_events GROUP BY event_name HAVING count(*) > 2
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Which event names were used more than twice for party events?
#
### SQL:
#
# SELECT event_name FROM party_events GROUP BY event_name HAVING count(*) > 2
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# How many Annual Meeting events happened in the United Kingdom region?
#
### SQL:
#
# SELECT count(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting"
#
### End.
|
party_people
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# region ( Region_ID, Region_name, Date, Label, Format, Catalogue )
# party ( Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name )
# member ( Member_ID, Member_Name, Party_ID, In_office )
# party_events ( Event_ID, Event_Name, Party_ID, Member_in_charge_ID )
#
# party.Region_ID can be joined with region.Region_ID
# member.Party_ID can be joined with party.Party_ID
# party_events.Member_in_charge_ID can be joined with member.Member_ID
# party_events.Party_ID can be joined with party.Party_ID
#
### Question:
#
# Count the number of Annual Meeting events that took place in the region of the United Kingdom.
#
### SQL:
#
# SELECT count(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting"
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# How many pilots are there?
#
### SQL:
#
# SELECT count(*) FROM pilot
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# List the names of pilots in ascending order of rank.
#
### SQL:
#
# SELECT Pilot_name FROM pilot ORDER BY Rank ASC
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# What are the positions and teams of pilots?
#
### SQL:
#
# SELECT POSITION , Team FROM pilot
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# List the distinct positions of pilots older than 30.
#
### SQL:
#
# SELECT DISTINCT POSITION FROM pilot WHERE Age > 30
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# Show the names of pilots from team "Bradley" or "Fordham".
#
### SQL:
#
# SELECT Pilot_name FROM pilot WHERE Team = "Bradley" OR Team = "Fordham"
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# What is the joined year of the pilot of the highest rank?
#
### SQL:
#
# SELECT Join_Year FROM pilot ORDER BY Rank ASC LIMIT 1
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.
#
### SQL:
#
# SELECT Nationality , COUNT(*) FROM pilot GROUP BY Nationality
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# Show the most common nationality of pilots.
#
### SQL:
#
# SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.
#
### SQL:
#
# SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# Show the names of pilots and models of aircrafts they have flied with.
#
### SQL:
#
# SELECT T3.Pilot_name , T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.
#
### SQL:
#
# SELECT T3.Pilot_name , T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# Show the fleet series of the aircrafts flied by pilots younger than 34
#
### SQL:
#
# SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# Show the names of pilots and the number of records they have.
#
### SQL:
#
# SELECT T2.Pilot_name , COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# Show names of pilots that have more than one record.
#
### SQL:
#
# SELECT T2.Pilot_name , COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1
#
### End.
|
pilot_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# aircraft ( Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion )
# pilot ( Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team )
# pilot_record ( Record_ID, Pilot_ID, Aircraft_ID, Date )
#
# pilot_record.Aircraft_ID can be joined with aircraft.Aircraft_ID
# pilot_record.Pilot_ID can be joined with pilot.Pilot_ID
#
### Question:
#
# List the names of pilots that do not have any record.
#
### SQL:
#
# SELECT Pilot_name FROM pilot WHERE Pilot_ID NOT IN (SELECT Pilot_ID FROM pilot_record)
#
### End.
|
cre_Doc_Control_Systems
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( document_type_code, document_type_description )
# Roles ( role_code, role_description )
# Addresses ( address_id, address_details )
# Ref_Document_Status ( document_status_code, document_status_description )
# Ref_Shipping_Agents ( shipping_agent_code, shipping_agent_name, shipping_agent_description )
# Documents ( document_id, document_status_code, document_type_code, shipping_agent_code, receipt_date, receipt_number, other_details )
# Employees ( employee_id, role_code, employee_name, other_details )
# Document_Drafts ( document_id, draft_number, draft_details )
# Draft_Copies ( document_id, draft_number, copy_number )
# Circulation_History ( document_id, draft_number, copy_number, employee_id )
# Documents_Mailed ( document_id, mailed_to_address_id, mailing_date )
#
# Documents.shipping_agent_code can be joined with Ref_Shipping_Agents.shipping_agent_code
# Documents.document_status_code can be joined with Ref_Document_Status.document_status_code
# Documents.document_type_code can be joined with Ref_Document_Types.document_type_code
# Employees.role_code can be joined with Roles.role_code
# Document_Drafts.document_id can be joined with Documents.document_id
# Draft_Copies.document_id can be joined with Document_Drafts.document_id
# Draft_Copies.draft_number can be joined with Document_Drafts.draft_number
# Circulation_History.employee_id can be joined with Employees.employee_id
# Circulation_History.document_id can be joined with Draft_Copies.document_id
# Circulation_History.draft_number can be joined with Draft_Copies.draft_number
# Circulation_History.copy_number can be joined with Draft_Copies.copy_number
# Documents_Mailed.mailed_to_address_id can be joined with Addresses.address_id
# Documents_Mailed.document_id can be joined with Documents.document_id
#
### Question:
#
# What document status codes do we have?
#
### SQL:
#
# SELECT document_status_code FROM Ref_Document_Status;
#
### End.
|
cre_Doc_Control_Systems
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( document_type_code, document_type_description )
# Roles ( role_code, role_description )
# Addresses ( address_id, address_details )
# Ref_Document_Status ( document_status_code, document_status_description )
# Ref_Shipping_Agents ( shipping_agent_code, shipping_agent_name, shipping_agent_description )
# Documents ( document_id, document_status_code, document_type_code, shipping_agent_code, receipt_date, receipt_number, other_details )
# Employees ( employee_id, role_code, employee_name, other_details )
# Document_Drafts ( document_id, draft_number, draft_details )
# Draft_Copies ( document_id, draft_number, copy_number )
# Circulation_History ( document_id, draft_number, copy_number, employee_id )
# Documents_Mailed ( document_id, mailed_to_address_id, mailing_date )
#
# Documents.shipping_agent_code can be joined with Ref_Shipping_Agents.shipping_agent_code
# Documents.document_status_code can be joined with Ref_Document_Status.document_status_code
# Documents.document_type_code can be joined with Ref_Document_Types.document_type_code
# Employees.role_code can be joined with Roles.role_code
# Document_Drafts.document_id can be joined with Documents.document_id
# Draft_Copies.document_id can be joined with Document_Drafts.document_id
# Draft_Copies.draft_number can be joined with Document_Drafts.draft_number
# Circulation_History.employee_id can be joined with Employees.employee_id
# Circulation_History.document_id can be joined with Draft_Copies.document_id
# Circulation_History.draft_number can be joined with Draft_Copies.draft_number
# Circulation_History.copy_number can be joined with Draft_Copies.copy_number
# Documents_Mailed.mailed_to_address_id can be joined with Addresses.address_id
# Documents_Mailed.document_id can be joined with Documents.document_id
#
### Question:
#
# What is the description of document status code 'working'?
#
### SQL:
#
# SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = "working";
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.