minktn/spider-data huggingface dataset:
Database: products_for_hire
Question: What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20?
SQL: SELECT product_name ,  product_description FROM products_for_hire WHERE product_type_code  =  'Cutlery' AND daily_hire_cost  <  20
Database: phone_market
Question: How many phones are there?
SQL: SELECT count(*) FROM phone
Database: phone_market
Question: List the names of phones in ascending order of price.
SQL: SELECT Name FROM phone ORDER BY Price ASC
Database: phone_market
Question: What are the memories and carriers of phones?
SQL: SELECT Memory_in_G ,  Carrier FROM phone
Database: phone_market
Question: List the distinct carriers of phones with memories bigger than 32.
SQL: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G  >  32
Database: phone_market
Question: Show the names of phones with carrier either "Sprint" or "TMobile".
SQL: SELECT Name FROM phone WHERE Carrier  =  "Sprint" OR Carrier  =  "TMobile"
Database: phone_market
Question: What is the carrier of the most expensive phone?
SQL: SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1
Database: phone_market
Question: Show different carriers of phones together with the number of phones with each carrier.
SQL: SELECT Carrier ,  COUNT(*) FROM phone GROUP BY Carrier
Database: phone_market
Question: Show the most frequently used carrier of the phones.
SQL: SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1
Database: phone_market
Question: Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.
SQL: SELECT Carrier FROM phone WHERE Memory_in_G  <  32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G  >  64
Database: phone_market
Question: Show the names of phones and the districts of markets they are on.
SQL: SELECT T3.Name ,  T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID
Database: phone_market
Question: Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.
SQL: SELECT T3.Name ,  T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID ORDER BY T2.Ranking
Database: phone_market
Question: Show the names of phones that are on market with number of shops greater than 50.
SQL: SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID WHERE T2.Num_of_shops  >  50
Database: phone_market
Question: For each phone, show its names and total number of stocks.
SQL: SELECT T2.Name ,  sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID  =  T2.Phone_ID GROUP BY T2.Name
Database: phone_market
Question: Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.
SQL: SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID  =  T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock)  >=  2000 ORDER BY sum(T1.Num_of_stock) DESC
Database: phone_market
Question: List the names of phones that are not on any market.
SQL: SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market)
Database: gas_company
Question: How many gas companies are there?
SQL: SELECT count(*) FROM company
Database: gas_company
Question: What is the total number of companies?
SQL: SELECT count(*) FROM company
Database: gas_company
Question: List the company name and rank for all companies in the decreasing order of their sales.
SQL: SELECT company ,  rank FROM company ORDER BY Sales_billion DESC
Database: gas_company
Question: What is the name and rank of every company ordered by descending number of sales?
SQL: SELECT company ,  rank FROM company ORDER BY Sales_billion DESC
Database: gas_company
Question: Show the company name and the main industry for all companies whose headquarters are not from USA.
SQL: SELECT company ,  main_industry FROM company WHERE headquarters != 'USA'
Database: gas_company
Question: What are the companies and main industries of all companies that are not headquartered in the United States?
SQL: SELECT company ,  main_industry FROM company WHERE headquarters != 'USA'
Database: gas_company
Question: Show all company names and headquarters in the descending order of market value.
SQL: SELECT company ,  headquarters FROM company ORDER BY market_value DESC
Database: gas_company
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
Database: gas_company
Question: Show minimum, maximum, and average market value for all companies.
SQL: SELECT min(market_value) ,  max(market_value) ,  avg(market_value) FROM company
Database: gas_company
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
Database: gas_company
Question: Show all main industry for all companies.
SQL: SELECT DISTINCT main_industry FROM company
Database: gas_company
Question: What are the different main industries for all companies?
SQL: SELECT DISTINCT main_industry FROM company
Database: gas_company
Question: List all headquarters and the number of companies in each headquarter.
SQL: SELECT headquarters ,  count(*) FROM company GROUP BY headquarters
Database: gas_company
Question: For each headquarter, what are the headquarter and how many companies are centered there?
SQL: SELECT headquarters ,  count(*) FROM company GROUP BY headquarters
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
Question: How many gas station are opened between 2000 and 2005?
SQL: SELECT count(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005
Database: gas_company
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
Database: gas_company
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(*)
Database: gas_company
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(*)
Database: gas_company
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'
Database: gas_company
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'
Database: gas_company
Question: Show all headquarters without a company in banking industry.
SQL: SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry  =  'Banking'
Database: gas_company
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'
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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)
Database: gas_company
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)
Database: gas_company
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'
Database: gas_company
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'
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
Question: order all gas station locations by the opening year.
SQL: SELECT LOCATION FROM gas_station ORDER BY open_year
Database: gas_company
Question: What are the locations of all the gas stations ordered by opening year?
SQL: SELECT LOCATION FROM gas_station ORDER BY open_year
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: gas_company
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
Database: party_people
Question: How many regions do we have?
SQL: SELECT count(*) FROM region
Database: party_people
Question: Count the number of regions.
SQL: SELECT count(*) FROM region
Database: party_people
Question: Show all distinct region names ordered by their labels.
SQL: SELECT DISTINCT region_name FROM region ORDER BY Label
Database: party_people
Question: What are the different region names, ordered by labels?
SQL: SELECT DISTINCT region_name FROM region ORDER BY Label
Database: party_people
Question: How many parties do we have?
SQL: SELECT count(DISTINCT party_name) FROM party
Database: party_people
Question: Count the number of different parties.
SQL: SELECT count(DISTINCT party_name) FROM party
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
Question: Show all ministers who do not belong to Progress Party.
SQL: SELECT minister FROM party WHERE party_name != 'Progress Party'
Database: party_people
Question: Which ministers are not a part of the Progress Party?
SQL: SELECT minister FROM party WHERE party_name != 'Progress Party'
Database: party_people
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
Database: party_people
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
Database: party_people
Question: Return the minister who left office at the latest time.
SQL: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
Database: party_people
Question: Which minister left office the latest?
SQL: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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)
Database: party_people
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)
Database: party_people
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
Database: party_people
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
Database: party_people
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"
Database: party_people
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"
Database: party_people
Question: How many party events do we have?
SQL: SELECT count(*) FROM party_events
Database: party_people
Question: Count the number of party events.
SQL: SELECT count(*) FROM party_events
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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
Database: party_people
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"
Database: party_people
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"
Database: pilot_record
Question: How many pilots are there?
SQL: SELECT count(*) FROM pilot
Database: pilot_record
Question: List the names of pilots in ascending order of rank.
SQL: SELECT Pilot_name FROM pilot ORDER BY Rank ASC
Database: pilot_record
Question: What are the positions and teams of pilots?
SQL: SELECT POSITION ,  Team FROM pilot
Database: pilot_record
Question: List the distinct positions of pilots older than 30.
SQL: SELECT DISTINCT POSITION FROM pilot WHERE Age  >  30
Database: pilot_record
Question: Show the names of pilots from team "Bradley" or "Fordham".
SQL: SELECT Pilot_name FROM pilot WHERE Team  =  "Bradley" OR Team  =  "Fordham"
Database: pilot_record
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
Database: pilot_record
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
Database: pilot_record
Question: Show the most common nationality of pilots.
SQL: SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
Database: pilot_record
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
Database: pilot_record
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
Database: pilot_record
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
Database: pilot_record
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
Database: pilot_record
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
Database: pilot_record
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
Database: pilot_record
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)
Database: cre_Doc_Control_Systems
Question: List the employees who have not showed up in any circulation history of documents. List the employee's name.
SQL: SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id
Database: company_1
Question: List all department names ordered by their starting date.
SQL: SELECT dname FROM department ORDER BY mgr_start_date
Database: company_1
Question: find all dependent names who have a spouse relation with some employee.
SQL: SELECT Dependent_name FROM dependent WHERE relationship  =  'Spouse'
Database: company_1
Question: how many female dependents are there?
SQL: SELECT count(*) FROM dependent WHERE sex  =  'F'
Database: company_1
Question: Find the names of departments that are located in Houston.
SQL: SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber  =  t2.dnumber WHERE t2.dlocation  =  'Houston'
Database: company_1
Question: Return the first names and last names of employees who earn more than 30000 in salary.
SQL: SELECT fname ,  lname FROM employee WHERE salary  >  30000
Database: company_1
Question: Find the number of employees of each gender whose salary is lower than 50000.
SQL: SELECT count(*) ,  sex FROM employee WHERE salary  <  50000 GROUP BY sex
Database: company_1
Question: list the first and last names, and the addresses of all employees in the ascending order of their birth date.
SQL: SELECT fname ,  lname ,  address FROM employee ORDER BY Bdate
Database: local_govt_in_alabama
Question: what are the event details of the services that have the type code 'Marriage'?
SQL: SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID  =  T2.Service_ID WHERE T2.Service_Type_Code  =  'Marriage'
Database: local_govt_in_alabama
Question: What are the ids and details of events that have more than one participants?
SQL: SELECT T1.event_id ,  T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID  =  T2.Event_ID GROUP BY T1.Event_ID HAVING count(*)  >  1
Database: local_govt_in_alabama
Question: How many events have each participants attended? List the participant id, type and the number.
SQL: SELECT T1.Participant_ID ,  T1.Participant_Type_Code ,  count(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID  =  T2.Participant_ID GROUP BY T1.Participant_ID
Database: local_govt_in_alabama
Question: What are all the the participant ids, type code and details?
SQL: SELECT Participant_ID ,  Participant_Type_Code ,  Participant_Details FROM  Participants
Database: local_govt_in_alabama
Question: How many participants belong to the type 'Organizer'?
SQL: SELECT count(*) FROM participants WHERE participant_type_code  =  'Organizer'
Database: local_govt_in_alabama
Question: List the type of the services in alphabetical order.
SQL: SELECT service_type_code FROM services ORDER BY service_type_code
Database: local_govt_in_alabama
Question: List the service id and details for the events.
SQL: SELECT service_id ,  event_details FROM EVENTS
Database: local_govt_in_alabama
Question: How many events had participants whose details had the substring 'Dr.'
SQL: SELECT count(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID  =  T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'
Database: local_govt_in_alabama
Question: What is the most common participant type?
SQL: SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count(*) DESC LIMIT 1
Database: local_govt_in_alabama
Question: Which service id and type has the least number of participants?
SQL: SELECT T3.service_id ,  T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID  =  T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID   =  T3.Event_ID JOIN services AS T4 ON T3.service_id  =  T4.service_id GROUP BY T3.service_id ORDER BY count(*) ASC LIMIT 1
Database: local_govt_in_alabama
Question: What is the id of the event with the most participants?
SQL: SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY count(*) DESC LIMIT 1
Database: local_govt_in_alabama
Question: Which events id does not have any participant with detail 'Kenyatta Kuhn'?
SQL: SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID  =  T2.Participant_ID WHERE Participant_Details  =  'Kenyatta Kuhn'
Database: local_govt_in_alabama
Question: Which services type had both successful and failure event details?
SQL: SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id  =  T2.service_id WHERE T2.event_details  =  'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id  =  T2.service_id WHERE T2.event_details  =  'Fail'
Database: local_govt_in_alabama
Question: How many events did not have any participants?
SQL: SELECT count(*) FROM EVENTS WHERE event_id NOT IN (SELECT event_id FROM Participants_in_Events)
Database: local_govt_in_alabama
Question: What are all the distinct participant ids who attended any events?
SQL: SELECT count(DISTINCT participant_id) FROM participants_in_Events
Database: formula_1
Question: What is the name of the race held most recently?
SQL: SELECT name FROM races ORDER BY date DESC LIMIT 1
Database: formula_1
Question: What is the name of the race that occurred most recently?
SQL: SELECT name FROM races ORDER BY date DESC LIMIT 1
Database: formula_1
Question: What is the name and date of the most recent race?
SQL: SELECT name ,  date FROM races ORDER BY date DESC LIMIT 1
Database: formula_1
Question: What is the name and date of the race that occurred most recently?
SQL: SELECT name ,  date FROM races ORDER BY date DESC LIMIT 1
Database: formula_1
Question: Find the names of all races held in 2017.
SQL: SELECT name FROM races WHERE YEAR = 2017
Database: formula_1
Question: What are the names of all the races that occurred in the year 2017?
SQL: SELECT name FROM races WHERE YEAR = 2017
Database: formula_1
Question: Find the distinct names of all races held between 2014 and 2017?
SQL: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
Database: formula_1
Question: What are the unique names of all race held between 2014 and 2017?
SQL: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
Database: formula_1
Question: List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
SQL: SELECT DISTINCT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
Database: formula_1
Question: What are the forenames and surnames of all unique drivers who had a lap time of less than 93000 milliseconds?
SQL: SELECT DISTINCT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
Database: formula_1
Question: Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?
SQL: SELECT DISTINCT T1.driverid ,  T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds >  100000
Database: formula_1
Question: What are the different driver ids and nationalities of all drivers who had a laptime of more than 100000 milliseconds?
SQL: SELECT DISTINCT T1.driverid ,  T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds >  100000
Database: formula_1
Question: What are the forename and surname of the driver who has the smallest laptime?
SQL: SELECT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
Database: formula_1
Question: What is the forename and surname of the driver with the shortest laptime?
SQL: SELECT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
Database: formula_1
Question: What is the id and family name of the driver who has the longest laptime?
SQL: SELECT T1.driverid ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
Database: formula_1
Question: What is the id and last name of the driver with the longest laptime?
SQL: SELECT T1.driverid ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
Database: formula_1
Question: What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?
SQL: SELECT T1.driverid ,  T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION  =  '1' GROUP BY T1.driverid HAVING count(*)  >=  2
Database: formula_1
Question: What is the id, first name, and last name of the driver who was in the first position for laptime at least twice?
SQL: SELECT T1.driverid ,  T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION  =  '1' GROUP BY T1.driverid HAVING count(*)  >=  2
Database: formula_1
Question: How many drivers participated in the race Australian Grand Prix held in 2009?
SQL: SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
Database: formula_1
Question: How many drivers were in the Australian Grand Prix held in 2009?
SQL: SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
Database: formula_1
Question: How many drivers did not participate in the races held in 2009?
SQL: SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )
Database: formula_1
Question: How many drivers did not race in 2009?
SQL: SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )
Database: formula_1
Question: Give me a list of names and years of races that had any driver whose forename is Lewis?
SQL: SELECT T2.name ,  T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
Database: formula_1
Question: What are the names and years of all races that had a driver with the last name Lewis?
SQL: SELECT T2.name ,  T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
Database: formula_1
Question: Find the forename and surname of drivers whose nationality is German?
SQL: SELECT forename ,  surname FROM drivers WHERE nationality = "German"
Database: formula_1
Question: What is the first and last name of all the German drivers?
SQL: SELECT forename ,  surname FROM drivers WHERE nationality = "German"
Database: formula_1
Question: Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?
SQL: SELECT T2.driverid ,  T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid  =  T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid ,  T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid  =  T3.driverid WHERE T1.name = "Chinese Grand Prix"
Database: formula_1
Question: What is the id and first name of all the drivers who participated in the Australian Grand Prix and the Chinese Grand Prix?
SQL: SELECT T2.driverid ,  T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid  =  T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid ,  T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid  =  T3.driverid WHERE T1.name = "Chinese Grand Prix"
Database: formula_1
Question: What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?
SQL: SELECT T3.forename ,  T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename ,  T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
Database: formula_1
Question: What are the first and last names of all drivers who participated in the Australian Grand Prix but not the Chinese Grand Prix?
SQL: SELECT T3.forename ,  T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename ,  T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
Database: formula_1
Question: Find all the forenames of distinct drivers who was in position 1 as standing and won?
SQL: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
Database: formula_1
Question: What are all the different first names of the drivers who are in position as standing and won?
SQL: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
Database: formula_1
Question: Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?
SQL: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
Database: formula_1
Question: What are the first names of the different drivers who won in position 1 as driver standing and had more than 20 points?
SQL: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
Database: formula_1
Question: What are the numbers of constructors for different nationalities?
SQL: SELECT count(*) ,  nationality FROM constructors GROUP BY nationality
Database: formula_1
Question: For each nationality, how many different constructors are there?
SQL: SELECT count(*) ,  nationality FROM constructors GROUP BY nationality
Database: formula_1
Question: What are the numbers of races for each constructor id?
SQL: SELECT count(*) ,  constructorid FROM constructorStandings GROUP BY constructorid
Database: formula_1
Question: For each constructor id, how many races are there?
SQL: SELECT count(*) ,  constructorid FROM constructorStandings GROUP BY constructorid
Database: formula_1
Question: What are the names of races that were held after 2017 and the circuits were in the country of Spain?
SQL: SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
Database: formula_1
Question: What are the names of the races held after 2017 in Spain?
SQL: SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
Database: formula_1
Question: What are the unique names of races that held after 2000 and the circuits were in Spain?
SQL: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
Database: formula_1
Question: What are the names of all races held after 2000 in Spain?
SQL: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
Database: formula_1
Question: Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.
SQL: SELECT DISTINCT driverid ,  STOP FROM pitstops WHERE duration  <  (SELECT max(duration) FROM pitstops WHERE raceid  =  841)
Database: formula_1
Question: What is the id and stop number for each driver that has a shorter pit stop than the driver in the race with id 841?
SQL: SELECT DISTINCT driverid ,  STOP FROM pitstops WHERE duration  <  (SELECT max(duration) FROM pitstops WHERE raceid  =  841)
Database: formula_1
Question: Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?
SQL: SELECT DISTINCT driverid ,  STOP FROM pitstops WHERE duration  >  (SELECT min(duration) FROM pitstops WHERE raceid  =  841)
Database: formula_1
Question: What are the different ids and stop durations of all the drivers whose stop lasted longer than the driver in the race with the id 841?
SQL: SELECT DISTINCT driverid ,  STOP FROM pitstops WHERE duration  >  (SELECT min(duration) FROM pitstops WHERE raceid  =  841)
Database: formula_1
Question: List the forenames of all distinct drivers in alphabetical order?
SQL: SELECT DISTINCT forename FROM drivers ORDER BY forename ASC
Database: formula_1
Question: What are the first names of all the different drivers in alphabetical order?
SQL: SELECT DISTINCT forename FROM drivers ORDER BY forename ASC
Database: formula_1
Question: List the names of all distinct races in reversed  lexicographic order?
SQL: SELECT DISTINCT name FROM races ORDER BY name DESC
Database: formula_1
Question: What are the different names of all the races in reverse alphabetical order?
SQL: SELECT DISTINCT name FROM races ORDER BY name DESC
Database: formula_1
Question: What are the names of races held between 2009 and 2011?
SQL: SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
Database: formula_1
Question: What are the names of all races held between 2009 and 2011?
SQL: SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
Database: formula_1
Question: What are the names of races held after 12:00:00 or before 09:00:00?
SQL: SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
Database: formula_1
Question: What are the names of all races that occurred after 12:00:00 or before 09:00:00?
SQL: SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
Database: formula_1
Question: What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?
SQL: SELECT T1.forename ,  T1.surname ,  T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  >  8 UNION SELECT T1.forename ,  T1.surname ,  T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  >  5
Database: formula_1
Question: What are the drivers' first names,last names, and ids for all those that had more than 8 stops or participated in more than 5 races?
SQL: SELECT T1.forename ,  T1.surname ,  T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  >  8 UNION SELECT T1.forename ,  T1.surname ,  T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  >  5
Database: formula_1
Question: What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?
SQL: SELECT T1.surname ,  T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  =  11 INTERSECT SELECT T1.surname ,  T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  >  5
Database: formula_1
Question: What are the last names and ids of all drivers who had 11 pit stops and participated in more than 5 races?
SQL: SELECT T1.surname ,  T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  =  11 INTERSECT SELECT T1.surname ,  T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  >  5
Database: formula_1
Question: What is the id and last name of the driver who participated in the most races after 2010?
SQL: SELECT T1.driverid ,  T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid  =  T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1
Database: formula_1
Question: What are the names of circuits that belong to UK or Malaysia?
SQL: SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia"
Database: formula_1
Question: What are the names of all the circuits that are in the UK or Malaysia?
SQL: SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia"
Database: formula_1
Question: Find the id and location of circuits that belong to France or Belgium?
SQL: SELECT circuitid ,  LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
Database: formula_1
Question: What are the ids and locations of all circuits in France or Belgium?
SQL: SELECT circuitid ,  LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
Database: formula_1
Question: Find the names of Japanese constructors that have once earned more than 5 points?
SQL: SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
Database: formula_1
Question: What are the names of all the Japanese constructors that have earned more than 5 points?
SQL: SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
Database: formula_1
Question: What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
SQL: SELECT avg(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
Database: formula_1
Question: What is the average fastest lap speed for the Monaco Grand Prix in 2008?
SQL: SELECT avg(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
Database: formula_1
Question: What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
SQL: SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
Database: formula_1
Question: What is the maximum fastest lap speed in the Monaco Grand Prix in 2008?
SQL: SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
Database: formula_1
Question: What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?
SQL: SELECT max(T2.fastestlapspeed) ,  T1.name ,  T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year
Database: formula_1
Question: For each race name, What is the maximum fastest lap speed for races after 2004 ordered by year?
SQL: SELECT max(T2.fastestlapspeed) ,  T1.name ,  T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year