cnatale/presto-athena-txt-2-sql huggingface dataset:
How many different captain ranks are there?
Additional table information: table: ship_1
SQL: SELECT COUNT(DISTINCT rank) FROM captain
Count the number of different ranks of captain.
Additional table information: table: ship_1
SQL: SELECT COUNT(DISTINCT rank) FROM captain
How many captains are in each rank?
Additional table information: table: ship_1
SQL: SELECT COUNT(*), rank FROM captain GROUP BY rank
Count the number of captains that have each rank.
Additional table information: table: ship_1
SQL: SELECT COUNT(*), rank FROM captain GROUP BY rank
How many captains with younger than 50 are in each rank?
Additional table information: table: ship_1
SQL: SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank
Count the number of captains younger than 50 of each rank.
Additional table information: table: ship_1
SQL: SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank
Sort all captain names by their ages from old to young.
Additional table information: table: ship_1
SQL: SELECT name FROM captain ORDER BY age DESC
What are the names of captains, sorted by age descending?
Additional table information: table: ship_1
SQL: SELECT name FROM captain ORDER BY age DESC
Find the name, class and rank of all captains.
Additional table information: table: ship_1
SQL: SELECT name, CLASS, rank FROM captain
What are the names, classes, and ranks of all captains?
Additional table information: table: ship_1
SQL: SELECT name, CLASS, rank FROM captain
Which rank is the most common among captains?
Additional table information: table: ship_1
SQL: SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1
Return the rank for which there are the fewest captains.
Additional table information: table: ship_1
SQL: SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1
Which classes have more than two captains?
Additional table information: table: ship_1
SQL: SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2
Give the classes that have more than two captains.
Additional table information: table: ship_1
SQL: SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2
Find the name of captains whose rank are either Midshipman or Lieutenant.
Additional table information: table: ship_1
SQL: SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
What are the names of captains that have either the rank Midshipman or Lieutenant?
Additional table information: table: ship_1
SQL: SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
What are the average and minimum age of captains in different class?
Additional table information: table: ship_1
SQL: SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS
Return the average and minimum age of captains in each class.
Additional table information: table: ship_1
SQL: SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS
Find the captain rank that has some captains in both Cutter and Armed schooner classes.
Additional table information: table: ship_1
SQL: SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
What are the ranks of captains that are both in the Cutter and Armed schooner classes?
Additional table information: table: ship_1
SQL: SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
Find the captain rank that has no captain in Third-rate ship of the line class.
Additional table information: table: ship_1
SQL: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?
Additional table information: table: ship_1
SQL: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
What is the name of the youngest captain?
Additional table information: table: ship_1
SQL: SELECT name FROM captain ORDER BY age NULLS FIRST LIMIT 1
Return the name of the youngest captain.
Additional table information: table: ship_1
SQL: SELECT name FROM captain ORDER BY age NULLS FIRST LIMIT 1
how many ships are there?
Additional table information: table: ship_1
SQL: SELECT COUNT(*) FROM ship
Count the number of ships.
Additional table information: table: ship_1
SQL: SELECT COUNT(*) FROM ship
Find the name, type, and flag of the ship that is built in the most recent year.
Additional table information: table: ship_1
SQL: SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1
What is the name, type, and flag of the ship that was built in the most recent year?
Additional table information: table: ship_1
SQL: SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1
Group by ships by flag, and return number of ships that have each flag.
Additional table information: table: ship_1
SQL: SELECT COUNT(*), flag FROM ship GROUP BY flag
What are the different ship flags, and how many ships have each?
Additional table information: table: ship_1
SQL: SELECT COUNT(*), flag FROM ship GROUP BY flag
Which flag is most widely used among all ships?
Additional table information: table: ship_1
SQL: SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1
Return the flag that is most common among all ships.
Additional table information: table: ship_1
SQL: SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1
List all ship names in the order of built year and class.
Additional table information: table: ship_1
SQL: SELECT name FROM ship ORDER BY built_year NULLS FIRST, CLASS NULLS FIRST
What are the names of ships, ordered by year they were built and their class?
Additional table information: table: ship_1
SQL: SELECT name FROM ship ORDER BY built_year NULLS FIRST, CLASS NULLS FIRST
Find the ship type that are used by both ships with Panama and Malta flags.
Additional table information: table: ship_1
SQL: SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
What types of ships have both ships that have Panama Flags and Malta flags?
Additional table information: table: ship_1
SQL: SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
In which year were most of ships built?
Additional table information: table: ship_1
SQL: SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1
What is the year in which most ships were built?
Additional table information: table: ship_1
SQL: SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1
Find the name of the ships that have more than one captain.
Additional table information: table: ship_1
SQL: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1
What are the names of ships that have more than one captain?
Additional table information: table: ship_1
SQL: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1
what are the names and classes of the ships that do not have any captain yet?
Additional table information: table: ship_1
SQL: SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)
Return the names and classes of ships that do not have a captain?
Additional table information: table: ship_1
SQL: SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)
Find the name of the ship that is steered by the youngest captain.
Additional table information: table: ship_1
SQL: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age NULLS FIRST LIMIT 1
What is the name of the ship that is commanded by the youngest captain?
Additional table information: table: ship_1
SQL: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age NULLS FIRST LIMIT 1
Find the name and flag of ships that are not steered by any captain with Midshipman rank.
Additional table information: table: ship_1
SQL: SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
What are the names and flags of ships that do not have a captain with the rank of Midshipman?
Additional table information: table: ship_1
SQL: SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.
Additional table information: table: ship_1
SQL: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'
What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant?
Additional table information: table: ship_1
SQL: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'
What is id of the city that hosted events in the most recent year?
Additional table information: table: city_record
SQL: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
Find the city that hosted some events in the most recent year. What is the id of this city?
Additional table information: table: city_record
SQL: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
Find the match ids of the cities that hosted competition '1994 FIFA World Cup qualification'?
Additional table information: table: city_record
SQL: SELECT match_id FROM MATCH WHERE competition = '1994 FIFA World Cup qualification'
What is the match id of the competition called '1994 FIFA World Cup qualification'?
Additional table information: table: city_record
SQL: SELECT match_id FROM MATCH WHERE competition = '1994 FIFA World Cup qualification'
Find the cities which were once a host city after 2010?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
Which cities served as a host city after 2010?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
Which city has hosted the most events?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1
Find the city that hosted the most events.
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1
What is the venue of the competition '1994 FIFA World Cup qualification' hosted by 'Nanjing ( Jiangsu )'?
Additional table information: table: city_record
SQL: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = 'Nanjing ( Jiangsu )' AND T3.competition = '1994 FIFA World Cup qualification'
Find the venue of the competition '1994 FIFA World Cup qualification' which was hosted by 'Nanjing ( Jiangsu )'.
Additional table information: table: city_record
SQL: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = 'Nanjing ( Jiangsu )' AND T3.competition = '1994 FIFA World Cup qualification'
Give me the temperature of Shanghai in January.
Additional table information: table: city_record
SQL: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = 'Shanghai'
What is the temperature of 'Shanghai' city in January?
Additional table information: table: city_record
SQL: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = 'Shanghai'
What is the host year of city 'Taizhou ( Zhejiang )'?
Additional table information: table: city_record
SQL: SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = 'Taizhou ( Zhejiang )'
IN which year did city 'Taizhou ( Zhejiang )' serve as a host city?
Additional table information: table: city_record
SQL: SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = 'Taizhou ( Zhejiang )'
Which three cities have the largest regional population?
Additional table information: table: city_record
SQL: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
What are the three largest cities in terms of regional population?
Additional table information: table: city_record
SQL: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
Which city has the lowest GDP? Please list the city name and its GDP.
Additional table information: table: city_record
SQL: SELECT city, GDP FROM city ORDER BY GDP NULLS FIRST LIMIT 1
What is the city with the smallest GDP? Return the city and its GDP.
Additional table information: table: city_record
SQL: SELECT city, GDP FROM city ORDER BY GDP NULLS FIRST LIMIT 1
Which city has the highest temperature in February?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1
In February, which city marks the highest temperature?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1
Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct
Which cities' temperature in March is lower than that in July or higher than that in Oct?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct
Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Which cities have lower temperature in March than in July and have been once host cities?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Which cities have lower temperature in March than in Dec and have never served as host cities?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Which cities have higher temperature in Feb than in Jun or have once served as host cities?
Additional table information: table: city_record
SQL: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Please give me a list of cities whose regional population is over 10000000.
Additional table information: table: city_record
SQL: SELECT city FROM city WHERE regional_population > 10000000
Which cities have regional population above 10000000?
Additional table information: table: city_record
SQL: SELECT city FROM city WHERE regional_population > 10000000
Please give me a list of cities whose regional population is over 8000000 or under 5000000.
Additional table information: table: city_record
SQL: SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
Which cities have regional population above 8000000 or below 5000000?
Additional table information: table: city_record
SQL: SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
Find the number of matches in different competitions.
Additional table information: table: city_record
SQL: SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition
For each competition, count the number of matches.
Additional table information: table: city_record
SQL: SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition
List venues of all matches in the order of their dates starting from the most recent one.
Additional table information: table: city_record
SQL: SELECT venue FROM MATCH ORDER BY date DESC
What are the venues of all the matches? Sort them in the descending order of match date.
Additional table information: table: city_record
SQL: SELECT venue FROM MATCH ORDER BY date DESC
what is the GDP of the city with the largest population.
Additional table information: table: city_record
SQL: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
Find the GDP of the city with the largest regional population.
Additional table information: table: city_record
SQL: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
What are the GDP and population of the city that already served as a host more than once?
Additional table information: table: city_record
SQL: 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
Which cities have served as host cities more than once? Return me their GDP and population.
Additional table information: table: city_record
SQL: 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
List every individual's first name, middle name and last name in alphabetical order by last name.
Additional table information: table: e_government
SQL: SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name NULLS FIRST
What are the first, middle, and last names of all individuals, ordered by last name?
Additional table information: table: e_government
SQL: SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name NULLS FIRST
List all the types of forms.
Additional table information: table: e_government
SQL: SELECT DISTINCT form_type_code FROM forms
What are the different types of forms?
Additional table information: table: e_government
SQL: SELECT DISTINCT form_type_code FROM forms
Find the name of the most popular party form.
Additional table information: table: e_government
SQL: 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
What is the name of the party form that is most common?
Additional table information: table: e_government
SQL: 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
Find the payment method and phone of the party with email 'enrico09@example.com'.
Additional table information: table: e_government
SQL: SELECT payment_method_code, party_phone FROM parties WHERE party_email = 'enrico09@example.com'
What is the payment method code and party phone of the party with the email 'enrico09@example.com'?
Additional table information: table: e_government
SQL: SELECT payment_method_code, party_phone FROM parties WHERE party_email = 'enrico09@example.com'
Find the emails of parties with the most popular party form.
Additional table information: table: e_government
SQL: 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)
What are the party emails associated with parties that used the party form that is the most common?
Additional table information: table: e_government
SQL: 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)
List all the name of organizations in order of the date formed.
Additional table information: table: e_government
SQL: SELECT organization_name FROM organizations ORDER BY date_formed ASC NULLS FIRST
What are the names of organizations, ordered by the date they were formed, ascending?
Additional table information: table: e_government
SQL: SELECT organization_name FROM organizations ORDER BY date_formed ASC NULLS FIRST
Find the name of the youngest organization.
Additional table information: table: e_government
SQL: SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
What is the name of the organization that was formed most recently?
Additional table information: table: e_government
SQL: SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
Find the last name of the latest contact individual of the organization 'Labour Party'.
Additional table information: table: e_government
SQL: 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
What is the last name of the contact individual from the Labour party organization who was contacted most recently?
Additional table information: table: e_government
SQL: 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
Find the last name of the first ever contact person of the organization with the highest UK Vat number.
Additional table information: table: e_government
SQL: 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 NULLS FIRST LIMIT 1
What is the last name of the first individual contacted from the organization with the maximum UK Vat number across all organizations?
Additional table information: table: e_government
SQL: 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 NULLS FIRST LIMIT 1
How many services are there?
Additional table information: table: e_government
SQL: SELECT COUNT(*) FROM services
Count the number of services.
Additional table information: table: e_government
SQL: SELECT COUNT(*) FROM services
Find name of the services that has never been used.
Additional table information: table: e_government
SQL: 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
What are the names of the services that have never been used?
Additional table information: table: e_government
SQL: 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
Find the name of all the cities and states.
Additional table information: table: e_government
SQL: SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
What are the names of all cities and states?
Additional table information: table: e_government
SQL: SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
How many cities are there in state 'Colorado'?
Additional table information: table: e_government
SQL: SELECT COUNT(*) FROM addresses WHERE state_province_county = 'Colorado'
Count the number of cities in the state of Colorado.
Additional table information: table: e_government
SQL: SELECT COUNT(*) FROM addresses WHERE state_province_county = 'Colorado'
Find the payment method code used by more than 3 parties.
Additional table information: table: e_government
SQL: SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3
What are the payment method codes that have been used by more than 3 parties?
Additional table information: table: e_government
SQL: SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3
Find the name of organizations whose names contain 'Party'.
Additional table information: table: e_government
SQL: SELECT organization_name FROM organizations WHERE organization_name LIKE '%Party%'
What are the names of organizations that contain the word 'Party'?
Additional table information: table: e_government
SQL: SELECT organization_name FROM organizations WHERE organization_name LIKE '%Party%'
How many distinct payment methods are used by parties?
Additional table information: table: e_government
SQL: SELECT COUNT(DISTINCT payment_method_code) FROM parties
Count the number of different payment method codes used by parties.
Additional table information: table: e_government
SQL: SELECT COUNT(DISTINCT payment_method_code) FROM parties
Which is the email of the party that has used the services the most number of times?
Additional table information: table: e_government
SQL: 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
Return the party email that has used party services the greatest number of times.
Additional table information: table: e_government
SQL: 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
Which state can address '6862 Kaitlyn Knolls' possibly be in?
Additional table information: table: e_government
SQL: SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE '%6862 Kaitlyn Knolls%'
Give the state corresponding to the line number building '6862 Kaitlyn Knolls'.
Additional table information: table: e_government
SQL: SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE '%6862 Kaitlyn Knolls%'
What is the name of organization that has the greatest number of contact individuals?
Additional table information: table: e_government
SQL: 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
Return the name of the organization which has the most contact individuals.
Additional table information: table: e_government
SQL: 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
Find the last name of the individuals that have been contact individuals of an organization.
Additional table information: table: e_government
SQL: SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id
What are the last names of individuals who have been contact individuals for an organization?
Additional table information: table: e_government
SQL: SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id
How many drivers are there?
Additional table information: table: school_bus
SQL: SELECT COUNT(*) FROM driver
Show the name, home city, and age for all drivers.
Additional table information: table: school_bus
SQL: SELECT name, home_city, age FROM driver
Show the party and the number of drivers in each party.
Additional table information: table: school_bus
SQL: SELECT party, COUNT(*) FROM driver GROUP BY party
Show the name of drivers in descending order of age.
Additional table information: table: school_bus
SQL: SELECT name FROM driver ORDER BY age DESC
Show all different home cities.
Additional table information: table: school_bus
SQL: SELECT DISTINCT home_city FROM driver
Show the home city with the most number of drivers.
Additional table information: table: school_bus
SQL: SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1
Show the party with drivers from Hartford and drivers older than 40.
Additional table information: table: school_bus
SQL: SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40
Show home city where at least two drivers older than 40 are from.
Additional table information: table: school_bus
SQL: SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2
Show all home cities except for those having a driver older than 40.
Additional table information: table: school_bus
SQL: SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40
Show the names of the drivers without a school bus.
Additional table information: table: school_bus
SQL: SELECT name FROM driver WHERE NOT driver_id IN (SELECT driver_id FROM school_bus)
Show the types of schools that have two schools.
Additional table information: table: school_bus
SQL: SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2
Show the school name and driver name for all school buses.
Additional table information: table: school_bus
SQL: 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
What is the maximum, minimum and average years spent working on a school bus?
Additional table information: table: school_bus
SQL: SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus
Show the school name and type for schools without a school bus.
Additional table information: table: school_bus
SQL: SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus)
Show the type of school and the number of buses for each type.
Additional table information: table: school_bus
SQL: SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type
How many drivers are from Hartford city or younger than 40?
Additional table information: table: school_bus
SQL: SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40
List names for drivers from Hartford city and younger than 40.
Additional table information: table: school_bus
SQL: SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40
find the name of driver who is driving the school bus with the longest working history.
Additional table information: table: school_bus
SQL: 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
How many flights have a velocity larger than 200?
Additional table information: table: flight_company
SQL: SELECT COUNT(*) FROM flight WHERE velocity > 200
List the vehicle flight number, date and pilot of all the flights, ordered by altitude.
Additional table information: table: flight_company
SQL: SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude ASC NULLS FIRST
List the id, country, city and name of the airports ordered alphabetically by the name.
Additional table information: table: flight_company
SQL: SELECT id, country, city, name FROM airport ORDER BY name NULLS FIRST
What is maximum group equity shareholding of the companies?
Additional table information: table: flight_company
SQL: SELECT MAX(group_equity_shareholding) FROM operate_company
What is the velocity of the pilot named 'Thompson'?
Additional table information: table: flight_company
SQL: SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson'
What are the names and types of the companies that have ever operated a flight?
Additional table information: table: flight_company
SQL: SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
What are the names of the airports which are not in the country 'Iceland'?
Additional table information: table: flight_company
SQL: SELECT name FROM airport WHERE country <> 'Iceland'
What are the distinct types of the companies that have operated any flights with velocity less than 200?
Additional table information: table: flight_company
SQL: SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200
What are the ids and names of the companies that operated more than one flight?
Additional table information: table: flight_company
SQL: 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
What is the id, name and IATA code of the airport that had most number of flights?
Additional table information: table: flight_company
SQL: 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
What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?
Additional table information: table: flight_company
SQL: 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'
What is the most common company type, and how many are there?
Additional table information: table: flight_company
SQL: SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
How many airports haven't the pilot 'Thompson' driven an aircraft?
Additional table information: table: flight_company
SQL: SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson')
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.
Additional table information: table: flight_company
SQL: 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'
Which of the airport names contains the word 'international'?
Additional table information: table: flight_company
SQL: SELECT name FROM airport WHERE name LIKE '%international%'
How many companies operates airlines in each airport?
Additional table information: table: flight_company
SQL: 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
how many airports are there in each country?
Additional table information: table: flight_company
SQL: SELECT COUNT(*), country FROM airport GROUP BY country
which countries have more than 2 airports?
Additional table information: table: flight_company
SQL: SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2
which pilot is in charge of the most number of flights?
Additional table information: table: flight_company
SQL: SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1
How many accounts do we have?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Accounts
Count the number of accounts.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Accounts
Show all account ids and account details.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT account_id, account_details FROM Accounts
What are the ids and details of all accounts?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT account_id, account_details FROM Accounts
How many statements do we have?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Statements
Count the number of statements.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Statements
List all statement ids and statement details.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT STATEMENT_ID, statement_details FROM Statements
What are the ids and details of all statements?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT STATEMENT_ID, statement_details FROM Statements
Show statement id, statement detail, account detail for accounts.
Additional table information: table: cre_Docs_and_Epenses
SQL: 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
What are the statement ids, statement details, and account details, for all accounts?
Additional table information: table: cre_Docs_and_Epenses
SQL: 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
Show all statement id and the number of accounts for each statement.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID
What are the different statement ids on accounts, and the number of accounts for each?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID
Show the statement id and the statement detail for the statement with most number of accounts.
Additional table information: table: cre_Docs_and_Epenses
SQL: 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
What are the statement id and statement detail for the statement that has the most corresponding accounts?
Additional table information: table: cre_Docs_and_Epenses
SQL: 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
Show the number of documents.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Documents
Count the number of documents.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Documents
List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'
What are the type come, name, and description of the document that has either the name 'Noel CV' or 'King Book'?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'
Show the ids and names of all documents.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_id, document_name FROM Documents
What are the ids and names for each of the documents?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_id, document_name FROM Documents
Find names and ids of all documents with document type code BK.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_name, document_id FROM Documents WHERE document_type_code = 'BK'
What are the names and ids of documents that have the type code BK?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_name, document_id FROM Documents WHERE document_type_code = 'BK'
How many documents are with document type code BK for each product id?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = 'BK' GROUP BY project_id
Count the number of documents with the type code BK that correspond to each product id.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = 'BK' GROUP BY project_id
Show the document name and the document date for all documents on project with details 'Graph Database project'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_name, document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'Graph Database project'
What are the names and dates for documents corresponding to project that has the details 'Graph Database project'?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_name, document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'Graph Database project'
Show project ids and the number of documents in each project.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id
How many documents correspond with each project id?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id
What is the id of the project with least number of documents?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1
Return the id of the project that has the fewest corresponding documents.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1
Show the ids for projects with at least 2 documents.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2
What are project ids of projects that have 2 or more corresponding documents?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2
List document type codes and the number of documents in each code.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code
How many documents are there of each type?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code
What is the document type code with most number of documents?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1
Return the code of the document type that is most common.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1
Show the document type code with fewer than 3 documents.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3
What are the codes corresponding to document types for which there are less than 3 documents?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3
Show the statement detail and the corresponding document name for the statement with detail 'Private Project'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.statement_details, T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project'
What are the details for statements with the details 'Private Project', and what are the names of the corresponding documents?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.statement_details, T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project'
Show all document type codes, document type names, document type descriptions.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types
What are the codes, names, and descriptions of the different document types?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types
What is the document type description for document type named Film?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_description FROM Ref_document_types WHERE document_type_name = 'Film'
Return the description of the document type name 'Film'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_type_description FROM Ref_document_types WHERE document_type_name = 'Film'
What is the document type name and the document type description and creation date for all the documents?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.document_type_name, T1.document_type_description, T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code = T2.document_type_code
Return the type name, type description, and date of creation for each document.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.document_type_name, T1.document_type_description, T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code = T2.document_type_code
Show the number of projects.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Projects
How many projects are there?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Projects
List ids and details for all projects.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT project_id, project_details FROM Projects
What are the ids and details for each project?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT project_id, project_details FROM Projects
What is the project id and detail for the project with at least two documents?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.project_id, T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING COUNT(*) > 2
Return the ids and details corresponding to projects for which there are more than two documents.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.project_id, T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING COUNT(*) > 2
What is the project detail for the project with document 'King Book'?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = 'King Book'
Give the details of the project with the document name 'King Book'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = 'King Book'
How many budget types do we have?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Ref_budget_codes