cnatale/presto-athena-txt-2-sql huggingface dataset:
What are the names of modern rooms that have a base price lower than $160 and two beds.
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern'
Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.
Additional table information: table: inn_1
SQL: SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2
What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people.
Additional table information: table: inn_1
SQL: SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2
Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.
Additional table information: table: inn_1
SQL: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC LIMIT 1
Which room has the largest number of reservations?
Additional table information: table: inn_1
SQL: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC LIMIT 1
How many kids stay in the rooms reserved by ROY SWEAZY?
Additional table information: table: inn_1
SQL: SELECT kids FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'
Find the number of kids staying in the rooms reserved by a person called ROY SWEAZ.
Additional table information: table: inn_1
SQL: SELECT kids FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'
How many times does ROY SWEAZY has reserved a room.
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'
Find the number of times ROY SWEAZY has reserved a room.
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'
Which room has the highest rate? List the room's full name, rate, check in and check out date.
Additional table information: table: inn_1
SQL: SELECT T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1
Return the name, rate, check in and check out date for the room with the highest rate.
Additional table information: table: inn_1
SQL: SELECT T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1
How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?
Additional table information: table: inn_1
SQL: SELECT Adults FROM Reservations WHERE CheckIn = '2010-10-23' AND FirstName = 'CONRAD' AND LastName = 'SELBIG'
Find the number of adults for the room reserved and checked in by CONRAD SELBIG on Oct 23, 2010.
Additional table information: table: inn_1
SQL: SELECT Adults FROM Reservations WHERE CheckIn = '2010-10-23' AND FirstName = 'CONRAD' AND LastName = 'SELBIG'
How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?
Additional table information: table: inn_1
SQL: SELECT Kids FROM Reservations WHERE CheckIn = '2010-09-21' AND FirstName = 'DAMIEN' AND LastName = 'TRACHSEL'
Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on  Sep 21, 2010.
Additional table information: table: inn_1
SQL: SELECT Kids FROM Reservations WHERE CheckIn = '2010-09-21' AND FirstName = 'DAMIEN' AND LastName = 'TRACHSEL'
How many king beds are there?
Additional table information: table: inn_1
SQL: SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King'
Find the total number of king beds available.
Additional table information: table: inn_1
SQL: SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King'
List the names and decor of rooms that have a king bed. Sort the list by their price.
Additional table information: table: inn_1
SQL: SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice NULLS FIRST
What are the names and decor of rooms with a king bed? Sort them by their price
Additional table information: table: inn_1
SQL: SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice NULLS FIRST
Which room has cheapest base price? List the room's name and the base price.
Additional table information: table: inn_1
SQL: SELECT roomName, basePrice FROM Rooms ORDER BY basePrice ASC NULLS FIRST LIMIT 1
What are the room name and base price of the room with the lowest base price?
Additional table information: table: inn_1
SQL: SELECT roomName, basePrice FROM Rooms ORDER BY basePrice ASC NULLS FIRST LIMIT 1
What is the decor of room Recluse and defiance?
Additional table information: table: inn_1
SQL: SELECT decor FROM Rooms WHERE roomName = 'Recluse and defiance'
Return the decor of the room named 'Recluse and defiance'.
Additional table information: table: inn_1
SQL: SELECT decor FROM Rooms WHERE roomName = 'Recluse and defiance'
What is the average base price of different bed type? List bed type and average base price.
Additional table information: table: inn_1
SQL: SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
For each bed type, find the average base price of different bed type.
Additional table information: table: inn_1
SQL: SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
What is the total number of people who could stay in the modern rooms in this inn?
Additional table information: table: inn_1
SQL: SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern'
How many people in total can stay in the modern rooms of this inn?
Additional table information: table: inn_1
SQL: SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern'
What kind of decor has the least number of reservations?
Additional table information: table: inn_1
SQL: SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY COUNT(T2.decor) ASC NULLS FIRST LIMIT 1
What is the least popular kind of decor?
Additional table information: table: inn_1
SQL: SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY COUNT(T2.decor) ASC NULLS FIRST LIMIT 1
List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids.
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids
How many times the number of adults and kids staying in a room reached the maximum capacity of the room?
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids
Find the first and last names of people who payed more than the rooms' base prices.
Additional table information: table: inn_1
SQL: SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0
What are the first and last names of people who payed more than the rooms' base prices?
Additional table information: table: inn_1
SQL: SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0
How many rooms are there?
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM Rooms
What is the total number of rooms available in this inn?
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM Rooms
Find the number of rooms with a king bed.
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM Rooms WHERE bedType = 'King'
How many rooms have a king bed?
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM Rooms WHERE bedType = 'King'
Find the number of rooms for each bed type.
Additional table information: table: inn_1
SQL: SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType
What are the number of rooms for each bed type?
Additional table information: table: inn_1
SQL: SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType
Find the name of the room with the maximum occupancy.
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1
What is the name of the room that can accommodate the most people?
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1
Find the id and name of the most expensive base price room.
Additional table information: table: inn_1
SQL: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1
Which room has the highest base price?
Additional table information: table: inn_1
SQL: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1
List the type of bed and name of all traditional rooms.
Additional table information: table: inn_1
SQL: SELECT roomName, bedType FROM Rooms WHERE decor = 'traditional'
What are the bed type and name of all the rooms with traditional decor?
Additional table information: table: inn_1
SQL: SELECT roomName, bedType FROM Rooms WHERE decor = 'traditional'
Find the number of rooms with king bed for each decor type.
Additional table information: table: inn_1
SQL: SELECT decor, COUNT(*) FROM Rooms WHERE bedType = 'King' GROUP BY decor
How many rooms have king beds? Report the number for each decor type.
Additional table information: table: inn_1
SQL: SELECT decor, COUNT(*) FROM Rooms WHERE bedType = 'King' GROUP BY decor
Find the average and minimum price of the rooms in different decor.
Additional table information: table: inn_1
SQL: SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor
What is the average minimum and price of the rooms for each different decor.
Additional table information: table: inn_1
SQL: SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor
List the name of all rooms sorted by their prices.
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms ORDER BY basePrice NULLS FIRST
Sort all the rooms according to the price. Just report the room names.
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms ORDER BY basePrice NULLS FIRST
Find the number of rooms with price higher than 120 for different decor.
Additional table information: table: inn_1
SQL: SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor
How many rooms cost more than 120, for each different decor?
Additional table information: table: inn_1
SQL: SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor
For each bed type, find the average room price.
Additional table information: table: inn_1
SQL: SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
What is the average base price of rooms, for each bed type?
Additional table information: table: inn_1
SQL: SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
List the name of rooms with king or queen bed.
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms WHERE bedType = 'King' OR bedType = 'Queen'
What are the names of rooms that have either king or queen bed?
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms WHERE bedType = 'King' OR bedType = 'Queen'
How many different types of beds are there?
Additional table information: table: inn_1
SQL: SELECT COUNT(DISTINCT bedType) FROM Rooms
Find the number of distinct bed types available in this inn.
Additional table information: table: inn_1
SQL: SELECT COUNT(DISTINCT bedType) FROM Rooms
Find the name and id of the top 3 expensive rooms.
Additional table information: table: inn_1
SQL: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3
What are the name and id of the three highest priced rooms?
Additional table information: table: inn_1
SQL: SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3
Find the name of rooms whose price is higher than the average price.
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms)
What are the name of rooms that cost more than the average.
Additional table information: table: inn_1
SQL: SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms)
Find the number of rooms that do not have any reservation.
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations)
How many rooms have not had any reservation yet?
Additional table information: table: inn_1
SQL: SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations)
Return the name and number of reservations made for each of the rooms.
Additional table information: table: inn_1
SQL: SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room
For each room, find its name and the number of times reservations were made for it.
Additional table information: table: inn_1
SQL: SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room
Find the names of rooms that have been reserved for more than 60 times.
Additional table information: table: inn_1
SQL: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60
What are the names of rooms whose reservation frequency exceeds 60 times?
Additional table information: table: inn_1
SQL: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60
Find the name of rooms whose base price is between 120 and 150.
Additional table information: table: inn_1
SQL: SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150
Which rooms cost between 120 and 150? Give me the room names.
Additional table information: table: inn_1
SQL: SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150
Find the name of rooms booked by some customers whose first name contains ROY.
Additional table information: table: inn_1
SQL: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'
What are the name of rooms booked by customers whose first name has 'ROY' in part?
Additional table information: table: inn_1
SQL: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'
what are the details of the cmi masters that have the cross reference code 'Tax'?
Additional table information: table: local_govt_mdm
SQL: SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax'
What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.
Additional table information: table: local_govt_mdm
SQL: SELECT T1.cmi_cross_ref_id, T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING COUNT(*) >= 1
How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n
Additional table information: table: local_govt_mdm
SQL: SELECT T2.cmi_cross_ref_id, T2.master_customer_id, COUNT(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id
What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.
Additional table information: table: local_govt_mdm
SQL: SELECT T1.source_system_code, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id NULLS FIRST
Wat is the tax source system code and master customer id of the taxes related to each parking fine id?
Additional table information: table: local_govt_mdm
SQL: SELECT T1.source_system_code, T1.master_customer_id, T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id
What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?
Additional table information: table: local_govt_mdm
SQL: SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details <> 'Schmidt ,  Kertzmann and Lubowitz'
What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'?
Additional table information: table: local_govt_mdm
SQL: SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax'
How many different source system code for the cmi cross references are there?
Additional table information: table: local_govt_mdm
SQL: SELECT COUNT(DISTINCT source_system_code) FROM CMI_cross_references
List all information about customer master index, and sort them by details in descending order.
Additional table information: table: local_govt_mdm
SQL: SELECT * FROM customer_master_index ORDER BY cmi_details DESC
List the council tax ids and their related cmi cross references of all the parking fines.
Additional table information: table: local_govt_mdm
SQL: SELECT council_tax_id, cmi_cross_ref_id FROM parking_fines
How many council taxes are collected for renting arrears ?
Additional table information: table: local_govt_mdm
SQL: SELECT COUNT(*) FROM rent_arrears
What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?
Additional table information: table: local_govt_mdm
SQL: SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb ,  Becker and Wyman'
Which cmi cross reference id is not related to any parking taxes?
Additional table information: table: local_govt_mdm
SQL: SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines
Which distinct source system code includes the substring 'en'?
Additional table information: table: local_govt_mdm
SQL: SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%'
How many parties are there?
Additional table information: table: party_host
SQL: SELECT COUNT(*) FROM party
Count the number of parties.
Additional table information: table: party_host
SQL: SELECT COUNT(*) FROM party
List the themes of parties in ascending order of number of hosts.
Additional table information: table: party_host
SQL: SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC NULLS FIRST
What are the themes of parties ordered by the number of hosts in ascending manner?
Additional table information: table: party_host
SQL: SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC NULLS FIRST
What are the themes and locations of parties?
Additional table information: table: party_host
SQL: SELECT Party_Theme, LOCATION FROM party
Give me the theme and location of each party.
Additional table information: table: party_host
SQL: SELECT Party_Theme, LOCATION FROM party
Show the first year and last year of parties with theme 'Spring' or 'Teqnology'.
Additional table information: table: party_host
SQL: SELECT First_year, Last_year FROM party WHERE Party_Theme = 'Spring' OR Party_Theme = 'Teqnology'
What are the first year and last year of the parties whose theme is 'Spring' or 'Teqnology'?
Additional table information: table: party_host
SQL: SELECT First_year, Last_year FROM party WHERE Party_Theme = 'Spring' OR Party_Theme = 'Teqnology'
What is the average number of hosts for parties?
Additional table information: table: party_host
SQL: SELECT AVG(Number_of_hosts) FROM party
Compute the average number of hosts for parties.
Additional table information: table: party_host
SQL: SELECT AVG(Number_of_hosts) FROM party
What is the location of the party with the most hosts?
Additional table information: table: party_host
SQL: SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
Which party had the most hosts? Give me the party location.
Additional table information: table: party_host
SQL: SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
Show different nationalities along with the number of hosts of each nationality.
Additional table information: table: party_host
SQL: SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality
How many hosts does each nationality have? List the nationality and the count.
Additional table information: table: party_host
SQL: SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality
Show the most common nationality of hosts.
Additional table information: table: party_host
SQL: SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
Which nationality has the most hosts?
Additional table information: table: party_host
SQL: SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
Show the nations that have both hosts older than 45 and hosts younger than 35.
Additional table information: table: party_host
SQL: SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35
Which nations have both hosts of age above 45 and hosts of age below 35?
Additional table information: table: party_host
SQL: SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35
Show the themes of parties and the names of the party hosts.
Additional table information: table: party_host
SQL: SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID
For each party, return its theme and the name of its host.
Additional table information: table: party_host
SQL: SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID
Show the locations of parties and the names of the party hosts in ascending order of the age of the host.
Additional table information: table: party_host
SQL: SELECT T3.Location, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age NULLS FIRST
For each party, find its location and the name of its host. Sort the result in ascending order of the age of the host.
Additional table information: table: party_host
SQL: SELECT T3.Location, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age NULLS FIRST
Show the locations of parties with hosts older than 50.
Additional table information: table: party_host
SQL: SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50
Which parties have hosts of age above 50? Give me the party locations.
Additional table information: table: party_host
SQL: SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50
Show the host names for parties with number of hosts greater than 20.
Additional table information: table: party_host
SQL: SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20
Which parties have more than 20 hosts? Give me the host names for these parties.
Additional table information: table: party_host
SQL: SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20
Show the name and the nationality of the oldest host.
Additional table information: table: party_host
SQL: SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1
What are the name and the nationality of the host of the highest age?
Additional table information: table: party_host
SQL: SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1
List the names of hosts who did not serve as a host of any party in our record.
Additional table information: table: party_host
SQL: SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host)
What are the names of hosts who did not host any party in our record?
Additional table information: table: party_host
SQL: SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host)
How many regions do we have?
Additional table information: table: storm_record
SQL: SELECT COUNT(*) FROM region
Count the number of regions.
Additional table information: table: storm_record
SQL: SELECT COUNT(*) FROM region
Show all region code and region name sorted by the codes.
Additional table information: table: storm_record
SQL: SELECT region_code, region_name FROM region ORDER BY region_code NULLS FIRST
What are the codes and names for all regions, sorted by codes?
Additional table information: table: storm_record
SQL: SELECT region_code, region_name FROM region ORDER BY region_code NULLS FIRST
List all region names in alphabetical order.
Additional table information: table: storm_record
SQL: SELECT region_name FROM region ORDER BY region_name NULLS FIRST
What are the names of the regions in alphabetical order?
Additional table information: table: storm_record
SQL: SELECT region_name FROM region ORDER BY region_name NULLS FIRST
Show names for all regions except for Denmark.
Additional table information: table: storm_record
SQL: SELECT region_name FROM region WHERE region_name <> 'Denmark'
Return the names of all regions other than Denmark.
Additional table information: table: storm_record
SQL: SELECT region_name FROM region WHERE region_name <> 'Denmark'
How many storms had death records?
Additional table information: table: storm_record
SQL: SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0
Count the number of storms in which at least 1 person died.
Additional table information: table: storm_record
SQL: SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0
List name, dates active, and number of deaths for all storms with at least 1 death.
Additional table information: table: storm_record
SQL: SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1
What are the names, dates active, and number of deaths for storms that had 1 or more death?
Additional table information: table: storm_record
SQL: SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1
Show the average and maximum damage for all storms with max speed higher than 1000.
Additional table information: table: storm_record
SQL: SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000
What is the average and maximum damage in millions for storms that had a max speed over 1000?
Additional table information: table: storm_record
SQL: SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000
What is the total number of deaths and damage for all storms with a max speed greater than the average?
Additional table information: table: storm_record
SQL: SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)
Return the total number of deaths and total damange in millions for storms that had a max speed greater than the average.
Additional table information: table: storm_record
SQL: SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)
List name and damage for all storms in a descending order of max speed.
Additional table information: table: storm_record
SQL: SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC
What are the names and damage in millions for storms, ordered by their max speeds descending?
Additional table information: table: storm_record
SQL: SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC
How many regions are affected?
Additional table information: table: storm_record
SQL: SELECT COUNT(DISTINCT region_id) FROM affected_region
Count the number of different affected regions.
Additional table information: table: storm_record
SQL: SELECT COUNT(DISTINCT region_id) FROM affected_region
Show the name for regions not affected.
Additional table information: table: storm_record
SQL: SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region)
What are the names of regions that were not affected?
Additional table information: table: storm_record
SQL: SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region)
Show the name for regions and the number of storms for each region.
Additional table information: table: storm_record
SQL: SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
How many storms occured in each region?
Additional table information: table: storm_record
SQL: SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
List the name for storms and the number of affected regions for each storm.
Additional table information: table: storm_record
SQL: SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id
How many regions were affected by each storm?
Additional table information: table: storm_record
SQL: SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id
What is the storm name and max speed which affected the greatest number of regions?
Additional table information: table: storm_record
SQL: SELECT T1.name, T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY COUNT(*) DESC LIMIT 1
Return the name and max speed of the storm that affected the most regions.
Additional table information: table: storm_record
SQL: SELECT T1.name, T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY COUNT(*) DESC LIMIT 1
Show the name of storms which don't have affected region in record.
Additional table information: table: storm_record
SQL: SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region)
What are the names of storms that did not affect any regions?
Additional table information: table: storm_record
SQL: SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region)
Show storm name with at least two regions and 10 cities affected.
Additional table information: table: storm_record
SQL: SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10
What are the names of storms that both affected two or more regions and affected a total of 10 or more cities?
Additional table information: table: storm_record
SQL: SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10
Show all storm names except for those with at least two affected regions.
Additional table information: table: storm_record
SQL: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2
What are the names of storms that did not affect two or more regions?
Additional table information: table: storm_record
SQL: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2
What are the region names affected by the storm with a number of deaths of least 10?
Additional table information: table: storm_record
SQL: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10
Return the names of the regions affected by storms that had a death count of at least 10.
Additional table information: table: storm_record
SQL: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10
Show all storm names affecting region 'Denmark'.
Additional table information: table: storm_record
SQL: SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark'
What are the names of the storms that affected Denmark?
Additional table information: table: storm_record
SQL: SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark'
Show the region name with at least two storms.
Additional table information: table: storm_record
SQL: SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING COUNT(*) >= 2
What are the names of regions with two or more storms?
Additional table information: table: storm_record
SQL: SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING COUNT(*) >= 2
Find the names of the regions which were affected by the storm that killed the greatest number of people.
Additional table information: table: storm_record
SQL: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1
What are the names of regions that were affected by the storm in which the most people died?
Additional table information: table: storm_record
SQL: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1
Find the name of the storm that affected both Afghanistan and Albania regions.
Additional table information: table: storm_record
SQL: SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania'
What are the names of the storms that affected both the regions of Afghanistan and Albania?
Additional table information: table: storm_record
SQL: SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania'
How many counties are there in total?
Additional table information: table: election
SQL: SELECT COUNT(*) FROM county
Count the total number of counties.
Additional table information: table: election
SQL: SELECT COUNT(*) FROM county
Show the county name and population of all counties.
Additional table information: table: election
SQL: SELECT County_name, Population FROM county
What are the name and population of each county?
Additional table information: table: election
SQL: SELECT County_name, Population FROM county
Show the average population of all counties.
Additional table information: table: election
SQL: SELECT AVG(Population) FROM county
On average how large is the population of the counties?
Additional table information: table: election
SQL: SELECT AVG(Population) FROM county
Return the maximum and minimum population among all counties.
Additional table information: table: election
SQL: SELECT MAX(Population), MIN(Population) FROM county
What are the maximum and minimum population of the counties?
Additional table information: table: election
SQL: SELECT MAX(Population), MIN(Population) FROM county
Show all the distinct districts for elections.
Additional table information: table: election
SQL: SELECT DISTINCT District FROM election
What are the distinct districts for elections?
Additional table information: table: election
SQL: SELECT DISTINCT District FROM election
Show the zip code of the county with name 'Howard'.
Additional table information: table: election
SQL: SELECT Zip_code FROM county WHERE County_name = 'Howard'
What is the zip code the county named 'Howard' is located in?
Additional table information: table: election
SQL: SELECT Zip_code FROM county WHERE County_name = 'Howard'
Show the delegate from district 1 in election.
Additional table information: table: election
SQL: SELECT Delegate FROM election WHERE District = 1
Who is the delegate of district 1 in the elections?
Additional table information: table: election
SQL: SELECT Delegate FROM election WHERE District = 1
Show the delegate and committee information of elections.
Additional table information: table: election
SQL: SELECT Delegate, Committee FROM election
What are the delegate and committee information for each election record?
Additional table information: table: election
SQL: SELECT Delegate, Committee FROM election
How many distinct governors are there?
Additional table information: table: election
SQL: SELECT COUNT(DISTINCT Governor) FROM party
Count the number of distinct governors.
Additional table information: table: election
SQL: SELECT COUNT(DISTINCT Governor) FROM party
Show the lieutenant governor and comptroller from the democratic party.
Additional table information: table: election
SQL: SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = 'Democratic'
Who are the lieutenant governor and comptroller from the democratic party?
Additional table information: table: election
SQL: SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = 'Democratic'
In which distinct years was the governor 'Eliot Spitzer'?
Additional table information: table: election
SQL: SELECT DISTINCT YEAR FROM party WHERE Governor = 'Eliot Spitzer'
Find the distinct years when the governor was named 'Eliot Spitzer'.
Additional table information: table: election
SQL: SELECT DISTINCT YEAR FROM party WHERE Governor = 'Eliot Spitzer'
Show all the information about election.
Additional table information: table: election
SQL: SELECT * FROM election
Return all the information for each election record.
Additional table information: table: election
SQL: SELECT * FROM election
Show the delegates and the names of county they belong to.
Additional table information: table: election
SQL: SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District
What are the delegate and name of the county they belong to, for each county?
Additional table information: table: election
SQL: SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District
Which delegates are from counties with population smaller than 100000?
Additional table information: table: election
SQL: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000
Find the delegates who are from counties with population below 100000.
Additional table information: table: election
SQL: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000
How many distinct delegates are from counties with population larger than 50000?
Additional table information: table: election
SQL: SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000
Count the number of distinct delegates who are from counties with population above 50000.
Additional table information: table: election
SQL: SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000
What are the names of the county that the delegates on 'Appropriations' committee belong to?
Additional table information: table: election
SQL: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = 'Appropriations'
Which county do the delegates on 'Appropriations' committee belong to? Give me the county names.
Additional table information: table: election
SQL: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = 'Appropriations'
Show the delegates and the names of the party they belong to.
Additional table information: table: election
SQL: SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID
For each delegate, find the names of the party they are part of.
Additional table information: table: election
SQL: SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID
Who were the governors of the parties associated with delegates from district 1?
Additional table information: table: election
SQL: SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1
Find the parties associated with the delegates from district 1. Who served as governors of the parties?
Additional table information: table: election
SQL: SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1
Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?
Additional table information: table: election
SQL: SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2
Find the parties associated with the delegates from district 1 or 2. Who served as comptrollers of the parties?
Additional table information: table: election
SQL: SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2
Return all the committees that have delegates from Democratic party.
Additional table information: table: election
SQL: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Democratic'
Which committees have delegates from the Democratic party?
Additional table information: table: election
SQL: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Democratic'
Show the name of each county along with the corresponding number of delegates from that county.
Additional table information: table: election
SQL: SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id
For each county, find the name of the county and the number of delegates from that county.
Additional table information: table: election
SQL: SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id
Show the name of each party and the corresponding number of delegates from that party.
Additional table information: table: election
SQL: SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party
For each party, return the name of the party and the number of delegates from that party.
Additional table information: table: election
SQL: SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party
Return the names of all counties sorted by population in ascending order.
Additional table information: table: election
SQL: SELECT County_name FROM county ORDER BY Population ASC NULLS FIRST
Sort the names of all counties in ascending order of population.
Additional table information: table: election
SQL: SELECT County_name FROM county ORDER BY Population ASC NULLS FIRST
Return the names of all counties sorted by county name in descending alphabetical order.
Additional table information: table: election
SQL: SELECT County_name FROM county ORDER BY County_name DESC
Sort the names of all counties in descending alphabetical order.
Additional table information: table: election
SQL: SELECT County_name FROM county ORDER BY County_name DESC
Show the name of the county with the biggest population.
Additional table information: table: election
SQL: SELECT County_name FROM county ORDER BY Population DESC LIMIT 1
Which county has the largest population? Give me the name of the county.
Additional table information: table: election
SQL: SELECT County_name FROM county ORDER BY Population DESC LIMIT 1
Show the 3 counties with the smallest population.
Additional table information: table: election
SQL: SELECT County_name FROM county ORDER BY Population ASC NULLS FIRST LIMIT 3
What are the 3 counties that have the smallest population? Give me the county names.
Additional table information: table: election
SQL: SELECT County_name FROM county ORDER BY Population ASC NULLS FIRST LIMIT 3
Show the names of counties that have at least two delegates.
Additional table information: table: election
SQL: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2
Which counties have two or more delegates? Give me the county names.
Additional table information: table: election
SQL: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2
Show the name of the party that has at least two records.
Additional table information: table: election
SQL: SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2
Which party has two or more records?
Additional table information: table: election
SQL: SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2
Show the name of the party that has the most delegates.
Additional table information: table: election
SQL: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1
Which party has the largest number of delegates?
Additional table information: table: election
SQL: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1
Show the people that have been governor the most times.
Additional table information: table: election
SQL: SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1
Which people severed as governor most frequently?
Additional table information: table: election
SQL: SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1
Show the people that have been comptroller the most times and the corresponding number of times.
Additional table information: table: election
SQL: SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1
Which people severed as comptroller most frequently? Give me the name of the person and the frequency count.
Additional table information: table: election
SQL: SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1
What are the names of parties that do not have delegates in election?
Additional table information: table: election
SQL: SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election)
Which parties did not have any delegates in elections?
Additional table information: table: election
SQL: SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election)
What are the names of parties that have both delegates on 'Appropriations' committee and
Additional table information: table: election
SQL: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = 'Appropriations' INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = 'Economic Matters'