db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
city_record
select count(*) , competition from match group by competition
Question: find the number of matches in different competitions. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_...
find the number of matches in different competitions.
city_record
select count(*) , competition from match group by competition
Question: for each competition, count the number of matches. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_Cit...
for each competition, count the number of matches.
city_record
select venue from match order by date desc
Question: list venues of all matches in the order of their dates starting from the most recent one. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. h...
list venues of all matches in the order of their dates starting from the most recent one.
city_record
select venue from match order by date desc
Question: what are the venues of all the matches? sort them in the descending order of match date. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. ho...
what are the venues of all the matches? sort them in the descending order of match date.
city_record
select gdp from city order by regional_population desc limit 1
Question: what is the gdp of the city with the largest population. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Ho...
what is the gdp of the city with the largest population.
city_record
select gdp from city order by regional_population desc limit 1
Question: find the gdp of the city with the largest regional population. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_...
find the gdp of the city with the largest regional population.
city_record
select t1.gdp , t1.regional_population from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city group by t2.host_city having count(*) > 1
Question: what are the gdp and population of the city that already served as a host more than once? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. h...
what are the gdp and population of the city that already served as a host more than once?
city_record
select t1.gdp , t1.regional_population from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city group by t2.host_city having count(*) > 1
Question: which cities have served as host cities more than once? return me their gdp and population. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec....
which cities have served as host cities more than once? return me their gdp and population.
e_government
select individual_first_name , individual_middle_name , individual_last_name from individuals order by individual_last_name
Question: list every individual's first name, middle name and last name in alphabetical order by last name. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, f...
list every individual's first name, middle name and last name in alphabetical order by last name.
e_government
select individual_first_name , individual_middle_name , individual_last_name from individuals order by individual_last_name
Question: what are the first, middle, and last names of all individuals, ordered by last name? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code...
what are the first, middle, and last names of all individuals, ordered by last name?
e_government
select distinct form_type_code from forms
Question: list all the types of forms. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, form_description. ...
list all the types of forms.
e_government
select distinct form_type_code from forms
Question: what are the different types of forms? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, form_des...
what are the different types of forms?
e_government
select t1.form_name from forms as t1 join party_forms as t2 on t1.form_id = t2.form_id group by t2.form_id order by count(*) desc limit 1
Question: find the name of the most popular party form. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, f...
find the name of the most popular party form.
e_government
select t1.form_name from forms as t1 join party_forms as t2 on t1.form_id = t2.form_id group by t2.form_id order by count(*) desc limit 1
Question: what is the name of the party form that is most common? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, fo...
what is the name of the party form that is most common?
e_government
select payment_method_code , party_phone from parties where party_email = 'enrico09@example.com'
Question: find the payment method and phone of the party with email 'enrico09@example.com'. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, s...
find the payment method and phone of the party with email 'enrico09@example.com'.
e_government
select payment_method_code , party_phone from parties where party_email = 'enrico09@example.com'
Question: what is the payment method code and party phone of the party with the email 'enrico09@example.com'? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id,...
what is the payment method code and party phone of the party with the email 'enrico09@example.com'?
e_government
select t1.party_email from parties as t1 join party_forms as t2 on t1.party_id = t2.party_id where t2.form_id = (select form_id from party_forms group by form_id order by count(*) desc limit 1)
Question: find the emails of parties with the most popular party form. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_numbe...
find the emails of parties with the most popular party form.
e_government
select t1.party_email from parties as t1 join party_forms as t2 on t1.party_id = t2.party_id where t2.form_id = (select form_id from party_forms group by form_id order by count(*) desc limit 1)
Question: what are the party emails associated with parties that used the party form that is the most common? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id,...
what are the party emails associated with parties that used the party form that is the most common?
e_government
select organization_name from organizations order by date_formed asc
Question: list all the name of organizations in order of the date formed. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_nu...
list all the name of organizations in order of the date formed.
e_government
select organization_name from organizations order by date_formed asc
Question: what are the names of organizations, ordered by the date they were formed, ascending? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_cod...
what are the names of organizations, ordered by the date they were formed, ascending?
e_government
select organization_name from organizations order by date_formed desc limit 1
Question: find the name of the youngest organization. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, for...
find the name of the youngest organization.
e_government
select organization_name from organizations order by date_formed desc limit 1
Question: what is the name of the organization that was formed most recently? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, for...
what is the name of the organization that was formed most recently?
e_government
select t3.individual_last_name from organizations as t1 join organization_contact_individuals as t2 on t1.organization_id = t2.organization_id join individuals as t3 on t2.individual_id = t3.individual_id where t1.organization_name = 'labour party' order by t2.date_contact_to desc limit 1
Question: find the last name of the latest contact individual of the organization 'labour party'. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_c...
find the last name of the latest contact individual of the organization 'labour party'.
e_government
select t3.individual_last_name from organizations as t1 join organization_contact_individuals as t2 on t1.organization_id = t2.organization_id join individuals as t3 on t2.individual_id = t3.individual_id where t1.organization_name = 'labour party' order by t2.date_contact_to desc limit 1
Question: what is the last name of the contact individual from the labour party organization who was contacted most recently? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. F...
what is the last name of the contact individual from the labour party organization who was contacted most recently?
e_government
select t3.individual_last_name from organizations as t1 join organization_contact_individuals as t2 on t1.organization_id = t2.organization_id join individuals as t3 on t2.individual_id = t3.individual_id where t1.uk_vat_number = (select max(uk_vat_number) from organizations) order by t2.date_contact_to asc limit...
Question: find the last name of the first ever contact person of the organization with the highest uk vat number. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form...
find the last name of the first ever contact person of the organization with the highest uk vat number.
e_government
select t3.individual_last_name from organizations as t1 join organization_contact_individuals as t2 on t1.organization_id = t2.organization_id join individuals as t3 on t2.individual_id = t3.individual_id where t1.uk_vat_number = (select max(uk_vat_number) from organizations) order by t2.date_contact_to asc limit...
Question: what is the last name of the first individual contacted from the organization with the maximum uk vat number across all organizations? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, se...
what is the last name of the first individual contacted from the organization with the maximum uk vat number across all organizations?
e_government
select count(*) from services
Question: how many services are there? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, form_description. ...
how many services are there?
e_government
select count(*) from services
Question: count the number of services. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, form_description....
count the number of services.
e_government
select service_name from services except select t1.service_name from services as t1 join party_services as t2 on t1.service_id = t2.service_id
Question: find name of the services that has never been used. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_n...
find name of the services that has never been used.
e_government
select service_name from services except select t1.service_name from services as t1 join party_services as t2 on t1.service_id = t2.service_id
Question: what are the names of the services that have never been used? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_numb...
what are the names of the services that have never been used?
e_government
select town_city from addresses union select state_province_county from addresses
Question: find the name of all the cities and states. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, for...
find the name of all the cities and states.
e_government
select town_city from addresses union select state_province_county from addresses
Question: what are the names of all cities and states? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, fo...
what are the names of all cities and states?
e_government
select count(*) from addresses where state_province_county = 'colorado'
Question: how many cities are there in state 'colorado'? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_name, ...
how many cities are there in state 'colorado'?
e_government
select count(*) from addresses where state_province_county = 'colorado'
Question: count the number of cities in the state of colorado. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, form_...
count the number of cities in the state of colorado.
e_government
select payment_method_code from parties group by payment_method_code having count(*) > 3
Question: find the payment method code used by more than 3 parties. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, ...
find the payment method code used by more than 3 parties.
e_government
select payment_method_code from parties group by payment_method_code having count(*) > 3
Question: what are the payment method codes that have been used by more than 3 parties? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, servi...
what are the payment method codes that have been used by more than 3 parties?
e_government
select organization_name from organizations where organization_name like '%party%'
Question: find the name of organizations whose names contain 'party'. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number...
find the name of organizations whose names contain 'party'.
e_government
select organization_name from organizations where organization_name like '%party%'
Question: what are the names of organizations that contain the word 'party'? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form...
what are the names of organizations that contain the word 'party'?
e_government
select count(distinct payment_method_code) from parties
Question: how many distinct payment methods are used by parties? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_number, for...
how many distinct payment methods are used by parties?
e_government
select count(distinct payment_method_code) from parties
Question: count the number of different payment method codes used by parties. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, for...
count the number of different payment method codes used by parties.
e_government
select t1.party_email from parties as t1 join party_services as t2 on t1.party_id = t2.customer_id group by t1.party_email order by count(*) desc limit 1
Question: which is the email of the party that has used the services the most number of times? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code...
which is the email of the party that has used the services the most number of times?
e_government
select t1.party_email from parties as t1 join party_services as t2 on t1.party_id = t2.customer_id group by t1.party_email order by count(*) desc limit 1
Question: return the party email that has used party services the greatest number of times. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, s...
return the party email that has used party services the greatest number of times.
e_government
select state_province_county from addresses where line_1_number_building like '%6862 kaitlyn knolls%'
Question: which state can address '6862 kaitlyn knolls' possibly be in? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service_id, form_numb...
which state can address '6862 kaitlyn knolls' possibly be in?
e_government
select state_province_county from addresses where line_1_number_building like '%6862 kaitlyn knolls%'
Question: give the state corresponding to the line number building '6862 kaitlyn knolls'. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, ser...
give the state corresponding to the line number building '6862 kaitlyn knolls'.
e_government
select t1.organization_name from organizations as t1 join organization_contact_individuals as t2 on t1.organization_id = t2.organization_id group by t1.organization_name order by count(*) desc limit 1
Question: what is the name of organization that has the greatest number of contact individuals? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_cod...
what is the name of organization that has the greatest number of contact individuals?
e_government
select t1.organization_name from organizations as t1 join organization_contact_individuals as t2 on t1.organization_id = t2.organization_id group by t1.organization_name order by count(*) desc limit 1
Question: return the name of the organization which has the most contact individuals. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_type_code, service...
return the name of the organization which has the most contact individuals.
e_government
select distinct t1.individual_last_name from individuals as t1 join organization_contact_individuals as t2 on t1.individual_id = t2.individual_id
Question: find the last name of the individuals that have been contact individuals of an organization. | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_t...
find the last name of the individuals that have been contact individuals of an organization.
e_government
select distinct t1.individual_last_name from individuals as t1 join organization_contact_individuals as t2 on t1.individual_id = t2.individual_id
Question: what are the last names of individuals who have been contact individuals for an organization? | Tables: Addresses -> address_id, line_1_number_building, town_city, zip_postcode, state_province_county, country. Services -> service_id, service_type_code, service_name, service_descriptio. Forms -> form_id, form_...
what are the last names of individuals who have been contact individuals for an organization?
school_bus
select count(*) from driver
Question: how many drivers are there? | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = school.School_ID,
how many drivers are there?
school_bus
select name , home_city , age from driver
Question: show the name, home city, and age for all drivers. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = school.Sc...
show the name, home city, and age for all drivers.
school_bus
select party , count(*) from driver group by party
Question: show the party and the number of drivers in each party. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = scho...
show the party and the number of drivers in each party.
school_bus
select name from driver order by age desc
Question: show the name of drivers in descending order of age. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = school....
show the name of drivers in descending order of age.
school_bus
select distinct home_city from driver
Question: show all different home cities. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = school.School_ID,
show all different home cities.
school_bus
select home_city from driver group by home_city order by count(*) desc limit 1
Question: show the home city with the most number of drivers. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = school.S...
show the home city with the most number of drivers.
school_bus
select party from driver where home_city = 'hartford' and age > 40
Question: show the party with drivers from hartford and drivers older than 40. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.Sch...
show the party with drivers from hartford and drivers older than 40.
school_bus
select home_city from driver where age > 40 group by home_city having count(*) >= 2
Question: show home city where at least two drivers older than 40 are from. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School...
show home city where at least two drivers older than 40 are from.
school_bus
select home_city from driver except select home_city from driver where age > 40
Question: show all home cities except for those having a driver older than 40. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.Sch...
show all home cities except for those having a driver older than 40.
school_bus
select name from driver where driver_id not in (select driver_id from school_bus)
Question: show the names of the drivers without a school bus. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = school.S...
show the names of the drivers without a school bus.
school_bus
select type from school group by type having count(*) = 2
Question: show the types of schools that have two schools. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = school.Scho...
show the types of schools that have two schools.
school_bus
select t2.school , t3.name from school_bus as t1 join school as t2 on t1.school_id = t2.school_id join driver as t3 on t1.driver_id = t3.driver_id
Question: show the school name and driver name for all school buses. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = s...
show the school name and driver name for all school buses.
school_bus
select max(years_working) , min(years_working) , avg(years_working) from school_bus
Question: what is the maximum, minimum and average years spent working on a school bus? | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, schoo...
what is the maximum, minimum and average years spent working on a school bus?
school_bus
select school , type from school where school_id not in (select school_id from school_bus)
Question: show the school name and type for schools without a school bus. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_I...
show the school name and type for schools without a school bus.
school_bus
select t2.type , count(*) from school_bus as t1 join school as t2 on t1.school_id = t2.school_id group by t2.type
Question: show the type of school and the number of buses for each type. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID...
show the type of school and the number of buses for each type.
school_bus
select count(*) from driver where home_city = 'hartford' or age < 40
Question: how many drivers are from hartford city or younger than 40? | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID = ...
how many drivers are from hartford city or younger than 40?
school_bus
select name from driver where home_city = 'hartford' and age < 40
Question: list names for drivers from hartford city and younger than 40. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver_ID, school_bus.School_ID...
list names for drivers from hartford city and younger than 40.
school_bus
select t1.name from driver as t1 join school_bus as t2 on t1.driver_id = t2.driver_id order by years_working desc limit 1
Question: find the name of driver who is driving the school bus with the longest working history. | Tables: driver -> Driver_ID, Name, Party, Home_city, Age. school -> School_ID, Grade, School, Location, Type. school_bus -> School_ID, Driver_ID, Years_Working, If_full_time. | Joins: school_bus.Driver_ID = driver.Driver...
find the name of driver who is driving the school bus with the longest working history.
flight_company
select count(*) from flight where velocity > 200
Question: how many flights have a velocity larger than 200? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company_id. | Joins...
how many flights have a velocity larger than 200?
flight_company
select vehicle_flight_number , date , pilot from flight order by altitude asc
Question: list the vehicle flight number, date and pilot of all the flights, ordered by altitude. | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Alt...
list the vehicle flight number, date and pilot of all the flights, ordered by altitude.
flight_company
select id , country , city , name from airport order by name
Question: list the id, country, city and name of the airports ordered alphabetically by the name. | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Alt...
list the id, country, city and name of the airports ordered alphabetically by the name.
flight_company
select max(group_equity_shareholding) from operate_company
Question: what is maximum group equity shareholding of the companies? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company_i...
what is maximum group equity shareholding of the companies?
flight_company
select avg(velocity) from flight where pilot = 'thompson'
Question: what is the velocity of the pilot named 'thompson'? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company_id. | Joi...
what is the velocity of the pilot named 'thompson'?
flight_company
select t1.name , t1.type from operate_company as t1 join flight as t2 on t1.id = t2.company_id
Question: what are the names and types of the companies that have ever operated a flight? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, a...
what are the names and types of the companies that have ever operated a flight?
flight_company
select name from airport where country != 'iceland'
Question: what are the names of the airports which are not in the country 'iceland'? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airpor...
what are the names of the airports which are not in the country 'iceland'?
flight_company
select distinct t1.type from operate_company as t1 join flight as t2 on t1.id = t2.company_id where t2.velocity < 200
Question: what are the distinct types of the companies that have operated any flights with velocity less than 200? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pil...
what are the distinct types of the companies that have operated any flights with velocity less than 200?
flight_company
select t1.id , t1.name from operate_company as t1 join flight as t2 on t1.id = t2.company_id group by t1.id having count(*) > 1
Question: what are the ids and names of the companies that operated more than one flight? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, a...
what are the ids and names of the companies that operated more than one flight?
flight_company
select t1.id , t1.name , t1.iata from airport as t1 join flight as t2 on t1.id = t2.airport_id group by t2.id order by count(*) desc limit 1
Question: what is the id, name and iata code of the airport that had most number of flights? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude...
what is the id, name and iata code of the airport that had most number of flights?
flight_company
select distinct t2.pilot from airport as t1 join flight as t2 on t1.id = t2.airport_id where t1.country = 'united states' or t1.name = 'billund airport'
Question: what are the different pilot names who had piloted a flight in the country 'united states' or in the airport named 'billund airport'? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Veh...
what are the different pilot names who had piloted a flight in the country 'united states' or in the airport named 'billund airport'?
flight_company
select type , count(*) from operate_company group by type order by count(*) desc limit 1
Question: what is the most common company type, and how many are there? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company...
what is the most common company type, and how many are there?
flight_company
select count(*) from airport where id not in ( select airport_id from flight where pilot = 'thompson' );
Question: how many airports haven't the pilot 'thompson' driven an aircraft? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, co...
how many airports haven't the pilot 'thompson' driven an aircraft?
flight_company
select t2.pilot from operate_company as t1 join flight as t2 on t1.id = t2.company_id where t1.principal_activities = 'cargo' intersect select t2.pilot from operate_company as t1 join flight as t2 on t1.id = t2.company_id where t1.principal_activities = 'catering services'
Question: list the name of the pilots who have flied for both a company that mainly provide 'cargo' services and a company that runs 'catering services' activities. | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholdi...
list the name of the pilots who have flied for both a company that mainly provide 'cargo' services and a company that runs 'catering services' activities.
flight_company
select name from airport where name like '%international%'
Question: which of the airport names contains the word 'international'? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company...
which of the airport names contains the word 'international'?
flight_company
select t3.id , count(*) from operate_company as t1 join flight as t2 on t1.id = t2.company_id join airport as t3 on t2.airport_id = t3.id group by t3.id
Question: how many companies operates airlines in each airport? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company_id. | J...
how many companies operates airlines in each airport?
flight_company
select count(*) , country from airport group by country
Question: how many airports are there in each country? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company_id. | Joins: fli...
how many airports are there in each country?
flight_company
select country from airport group by country having count(*) > 2
Question: which countries have more than 2 airports? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company_id. | Joins: fligh...
which countries have more than 2 airports?
flight_company
select pilot from flight group by pilot order by count(*) desc limit 1
Question: which pilot is in charge of the most number of flights? | Tables: airport -> id, City, Country, IATA, ICAO, name. operate_company -> id, name, Type, Principal_activities, Incorporated_in, Group_Equity_Shareholding. flight -> id, Vehicle_Flight_number, Date, Pilot, Velocity, Altitude, airport_id, company_id. |...
which pilot is in charge of the most number of flights?
cre_Docs_and_Epenses
select count(*) from accounts
Question: how many accounts do we have? | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, Document_Date, Docu...
how many accounts do we have?
cre_Docs_and_Epenses
select count(*) from accounts
Question: count the number of accounts. | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, Document_Date, Docu...
count the number of accounts.
cre_Docs_and_Epenses
select account_id , account_details from accounts
Question: show all account ids and account details. | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, Documen...
show all account ids and account details.
cre_Docs_and_Epenses
select account_id , account_details from accounts
Question: what are the ids and details of all accounts? | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, Doc...
what are the ids and details of all accounts?
cre_Docs_and_Epenses
select count(*) from statements
Question: how many statements do we have? | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, Document_Date, Do...
how many statements do we have?
cre_Docs_and_Epenses
select count(*) from statements
Question: count the number of statements. | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, Document_Date, Do...
count the number of statements.
cre_Docs_and_Epenses
select statement_id , statement_details from statements
Question: list all statement ids and statement details. | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, Doc...
list all statement ids and statement details.
cre_Docs_and_Epenses
select statement_id , statement_details from statements
Question: what are the ids and details of all statements? | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, D...
what are the ids and details of all statements?
cre_Docs_and_Epenses
select t1.statement_id , t2.statement_details , t1.account_details from accounts as t1 join statements as t2 on t1.statement_id = t2.statement_id
Question: show statement id, statement detail, account detail for accounts. | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_C...
show statement id, statement detail, account detail for accounts.
cre_Docs_and_Epenses
select t1.statement_id , t2.statement_details , t1.account_details from accounts as t1 join statements as t2 on t1.statement_id = t2.statement_id
Question: what are the statement ids, statement details, and account details, for all accounts? | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document...
what are the statement ids, statement details, and account details, for all accounts?
cre_Docs_and_Epenses
select statement_id , count(*) from accounts group by statement_id
Question: show all statement id and the number of accounts for each statement. | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Typ...
show all statement id and the number of accounts for each statement.
cre_Docs_and_Epenses
select statement_id , count(*) from accounts group by statement_id
Question: what are the different statement ids on accounts, and the number of accounts for each? | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Documen...
what are the different statement ids on accounts, and the number of accounts for each?
cre_Docs_and_Epenses
select t1.statement_id , t2.statement_details from accounts as t1 join statements as t2 on t1.statement_id = t2.statement_id group by t1.statement_id order by count(*) desc limit 1
Question: show the statement id and the statement detail for the statement with most number of accounts. | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents ->...
show the statement id and the statement detail for the statement with most number of accounts.
cre_Docs_and_Epenses
select t1.statement_id , t2.statement_details from accounts as t1 join statements as t2 on t1.statement_id = t2.statement_id group by t1.statement_id order by count(*) desc limit 1
Question: what are the statement id and statement detail for the statement that has the most corresponding accounts? | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. ...
what are the statement id and statement detail for the statement that has the most corresponding accounts?
cre_Docs_and_Epenses
select count(*) from documents
Question: show the number of documents. | Tables: Ref_Document_Types -> Document_Type_Code, Document_Type_Name, Document_Type_Description. Ref_Budget_Codes -> Budget_Type_Code, Budget_Type_Description. Projects -> Project_ID, Project_Details. Documents -> Document_ID, Document_Type_Code, Project_ID, Document_Date, Docu...
show the number of documents.