{"question": "Find the id and city of the student address with the highest average monthly rental.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T2.address_id, T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1"} {"question": "Show the names of the drivers without a school bus.\nAdditional table information: table: school_bus", "answer": "SELECT name FROM driver WHERE NOT driver_id IN (SELECT driver_id FROM school_bus)"} {"question": "List name and damage for all storms in a descending order of max speed.\nAdditional table information: table: storm_record", "answer": "SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC"} {"question": "Please show the categories of the music festivals with count more than 1.\nAdditional table information: table: music_4", "answer": "SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1"} {"question": "what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.\nAdditional table information: table: manufacturer", "answer": "SELECT MAX(num_of_shops), AVG(Num_of_Factories) FROM manufacturer WHERE open_year < 1990"} {"question": "Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL')"} {"question": "What are the first and last names of the artist who perfomed the song 'Badlands'?\nAdditional table information: table: music_2", "answer": "SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Badlands'"} {"question": "Which club has the most members majoring in '600'?\nAdditional table information: table: club_1", "answer": "SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = '600' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the average prominence of the mountains in country 'Morocco'?\nAdditional table information: table: mountain_photos", "answer": "SELECT AVG(prominence) FROM mountain WHERE country = 'Morocco'"} {"question": "How many students and instructors are in each department?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT T2.id), COUNT(DISTINCT T3.id), T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name"} {"question": "For each city, what is the highest latitude for its stations?\nAdditional table information: table: bike_1", "answer": "SELECT city, MAX(lat) FROM station GROUP BY city"} {"question": "What campuses are located in Northridge, Los Angeles or in San Francisco, San Francisco?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE LOCATION = 'Northridge' AND county = 'Los Angeles' UNION SELECT campus FROM campuses WHERE LOCATION = 'San Francisco' AND county = 'San Francisco'"} {"question": "List the ids of the problems from the product 'voluptatem' that are reported after 1995?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = 'voluptatem' AND T1.date_problem_reported > '1995'"} {"question": "Find the number of rooms with price higher than 120 for different decor.\nAdditional table information: table: inn_1", "answer": "SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor"} {"question": "What are the distinct classes that races can have?\nAdditional table information: table: race_track", "answer": "SELECT DISTINCT CLASS FROM race"} {"question": "List the names of all distinct races in reversed lexicographic order?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT name FROM races ORDER BY name DESC"} {"question": "What are the different types of vocals?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT TYPE FROM vocals"} {"question": "List the names of wrestlers that have not been eliminated.\nAdditional table information: table: wrestler", "answer": "SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination)"} {"question": "What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)"} {"question": "What is the average longitude of stations that never had bike availability more than 10?\nAdditional table information: table: bike_1", "answer": "SELECT AVG(long) FROM station WHERE NOT id IN (SELECT station_id FROM status GROUP BY station_id HAVING MAX(bikes_available) > 10)"} {"question": "Show the date of the tallest perpetrator.\nAdditional table information: table: perpetrator", "answer": "SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1"} {"question": "Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.\nAdditional table information: table: mountain_photos", "answer": "SELECT name, prominence FROM mountain EXCEPT SELECT T1.name, T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma'"} {"question": "What are the names of all stations with a latitude smaller than 37.5?\nAdditional table information: table: bike_1", "answer": "SELECT name FROM station WHERE lat < 37.5"} {"question": "Find the code of the document type 'Paper'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT document_type_code FROM Ref_document_types WHERE document_type_name = 'Paper'"} {"question": "Find the first and last names of all the female (sex is F) students who have president votes.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = 'F'"} {"question": "Which studios have never worked with the director Walter Hill?\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = 'Walter Hill'"} {"question": "Show the account id and the number of transactions for each account\nAdditional table information: table: customers_card_transactions", "answer": "SELECT account_id, COUNT(*) FROM Financial_transactions GROUP BY account_id"} {"question": "Show all card type codes.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT DISTINCT card_type_code FROM Customers_Cards"} {"question": "Sort the list of names and costs of all procedures in the descending order of cost.\nAdditional table information: table: hospital_1", "answer": "SELECT name, cost FROM procedures ORDER BY cost DESC"} {"question": "list all female (sex is F) candidate names in the alphabetical order.\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name NULLS FIRST"} {"question": "Which part has the least chargeable amount? List the part id and amount.\nAdditional table information: table: assets_maintenance", "answer": "SELECT part_id, chargeable_amount FROM Parts ORDER BY chargeable_amount ASC NULLS FIRST LIMIT 1"} {"question": "Find the delegates who are from counties with population below 100000.\nAdditional table information: table: election", "answer": "SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000"} {"question": "Count the number of actors.\nAdditional table information: table: musical", "answer": "SELECT COUNT(*) FROM actor"} {"question": "Show the number of audience in year 2008 or 2010.\nAdditional table information: table: entertainment_awards", "answer": "SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010"} {"question": "What is the description of the club named 'Tennis Club'?\nAdditional table information: table: club_1", "answer": "SELECT clubdesc FROM club WHERE clubname = 'Tennis Club'"} {"question": "Sort all the distinct product names in alphabetical order.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT DISTINCT product_name FROM product ORDER BY product_name NULLS FIRST"} {"question": "How many international and domestic passengers are there in the airport London Heathrow?\nAdditional table information: table: aircraft", "answer": "SELECT International_Passengers, Domestic_Passengers FROM airport WHERE Airport_Name = 'London Heathrow'"} {"question": "What are the names of products whose availability equals to 1?\nAdditional table information: table: products_for_hire", "answer": "SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1"} {"question": "Find the ship type that are used by both ships with Panama and Malta flags.\nAdditional table information: table: ship_1", "answer": "SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'"} {"question": "What are the names of wines with scores higher than 90?\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE WHERE score > 90"} {"question": "List the names of states that have more than 2 parks.\nAdditional table information: table: baseball_1", "answer": "SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2"} {"question": "What are the hometowns of gymnasts and the corresponding number of gymnasts?\nAdditional table information: table: gymnast", "answer": "SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown"} {"question": "How many drivers did not race in 2009?\nAdditional table information: table: formula_1", "answer": "SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009)"} {"question": "Count the number of tracks that are of the media type 'AAC audio file'.\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = 'AAC audio file'"} {"question": "Find the name of airports whose altitude is between -50 and 50.\nAdditional table information: table: flight_4", "answer": "SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50"} {"question": "What is the name and city of the airport from most of the routes start?\nAdditional table information: table: flight_4", "answer": "SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the most frequent status of bookings?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the titles and average ratings for all movies that have the lowest average rating?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) NULLS FIRST LIMIT 1"} {"question": "Find the name of the genre that is most frequent across all tracks.\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "On which day was the order placed whose shipment tracking number is 3452?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452"} {"question": "How many problems did the product called 'voluptatem' have in record?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = 'voluptatem'"} {"question": "Find the average access count of documents with the least popular structure.\nAdditional table information: table: document_management", "answer": "SELECT AVG(access_count) FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "How many events have each participants attended? List the participant id, type and the number.\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT T1.Participant_ID, T1.Participant_Type_Code, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID"} {"question": "Which member names are shared among members in the party with the id 3 and the party with the id 1?\nAdditional table information: table: party_people", "answer": "SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1"} {"question": "What are all the company names that have a book published by Alyson?\nAdditional table information: table: culture_company", "answer": "SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson'"} {"question": "What are the full names and hire dates for employees in the same department as someone with the first name Clara, not including Clara?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = 'Clara') AND first_name <> 'Clara'"} {"question": "What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details NULLS FIRST"} {"question": "What are the names of shops in ascending order of open year?\nAdditional table information: table: device", "answer": "SELECT Shop_Name FROM shop ORDER BY Open_Year ASC NULLS FIRST"} {"question": "What are the carriers of devices whose software platforms are not 'Android'?\nAdditional table information: table: device", "answer": "SELECT Carrier FROM device WHERE Software_Platform <> 'Android'"} {"question": "What are the types of vocals used in the song 'Demon Kitty Rag'?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Demon Kitty Rag'"} {"question": "Count the number of tracks that are part of the rock genre.\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Rock'"} {"question": "What are characteristic names used at least twice across all products?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2"} {"question": "What are the different customer ids, and how many cards does each one hold?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id"} {"question": "Which faculty members are playing either Canoeing or Kayaking? Tell me their first names.\nAdditional table information: table: activity_1", "answer": "SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'"} {"question": "What is the gender of the teacher with last name 'Medhurst'?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT gender FROM TEACHERS WHERE last_name = 'Medhurst'"} {"question": "How many architects are female?\nAdditional table information: table: architecture", "answer": "SELECT COUNT(*) FROM architect WHERE gender = 'female'"} {"question": "What is the total number of professors with a Ph.D. ?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.'"} {"question": "List the name and assets of each company in ascending order of company name.\nAdditional table information: table: company_office", "answer": "SELECT name, Assets_billion FROM Companies ORDER BY name ASC NULLS FIRST"} {"question": "Find the name of tracks which are in Movies playlist but not in music playlist.\nAdditional table information: table: store_1", "answer": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'"} {"question": "How many stores are there?\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM store"} {"question": "Show all storm names except for those with at least two affected regions.\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Show ids for all the male faculty.\nAdditional table information: table: activity_1", "answer": "SELECT FacID FROM Faculty WHERE Sex = 'M'"} {"question": "Return the names of parties that have two or more events.\nAdditional table information: table: party_people", "answer": "SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2"} {"question": "List all the services in the alphabetical order.\nAdditional table information: table: insurance_fnol", "answer": "SELECT service_name FROM services ORDER BY service_name NULLS FIRST"} {"question": "Show names of cities and names of counties they are in.\nAdditional table information: table: county_public_safety", "answer": "SELECT T1.Name, T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID"} {"question": "What is the average score of submissions?\nAdditional table information: table: workshop_paper", "answer": "SELECT AVG(Scores) FROM submission"} {"question": "What is the total number of customers who use banks in New York City?\nAdditional table information: table: loan_1", "answer": "SELECT SUM(no_of_customers) FROM bank WHERE city = 'New York City'"} {"question": "What are the names of shops that have more than a single kind of device in stock?\nAdditional table information: table: device", "answer": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1"} {"question": "List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.\nAdditional table information: table: train_station", "answer": "SELECT name, LOCATION FROM station ORDER BY Annual_entry_exit NULLS FIRST, Annual_interchanges NULLS FIRST"} {"question": "Which physicians are affiliated with either Surgery or Psychiatry department? Give me their names.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' OR T3.name = 'Psychiatry'"} {"question": "What are the names of customers with credit score less than the average credit score across customers?\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer WHERE credit_score < (SELECT AVG(credit_score) FROM customer)"} {"question": "Find the maximum and total number of followers of all users.\nAdditional table information: table: twitter_1", "answer": "SELECT MAX(followers), SUM(followers) FROM user_profiles"} {"question": "What is the structure of the document with the least number of accesses?\nAdditional table information: table: document_management", "answer": "SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which members of 'Bootup Baltimore' major in '600'? Give me their first names and last names.\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.major = '600'"} {"question": "What are the public schools and what are their locations?\nAdditional table information: table: university_basketball", "answer": "SELECT school, LOCATION FROM university WHERE affiliation = 'Public'"} {"question": "Count the number of services.\nAdditional table information: table: e_government", "answer": "SELECT COUNT(*) FROM services"} {"question": "Which store owns most items?\nAdditional table information: table: sakila_1", "answer": "SELECT store_id FROM inventory GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of the students who took classes in 2009 or 2010?\nAdditional table information: table: college_2", "answer": "SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010"} {"question": "How many different types of sports do we offer?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(DISTINCT sportname) FROM Sportsinfo"} {"question": "Find the wineries that have at least four wines.\nAdditional table information: table: wine_1", "answer": "SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4"} {"question": "What the full names, ids of each employee and the name of the country they are in?\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T1.last_name, T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id"} {"question": "What are the first names of all Accounting professors who teach and what are the classrooms of the courses they teach?\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'"} {"question": "Find all members of 'Bootup Baltimore' whose major is '600'. Show the first name and last name.\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.major = '600'"} {"question": "Find the total credits of all classes offered by each department.\nAdditional table information: table: college_1", "answer": "SELECT SUM(T1.crs_credit), T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code"} {"question": "What roles did staff members play between '2003-04-19 15:06:20' and '2016-03-15 00:33:18'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18'"} {"question": "How many kinds of enzymes are there?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT COUNT(*) FROM enzyme"} {"question": "What are the student ids for those on scholarship in major number 600?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'"} {"question": "Which locations have 2 or more cinemas with capacity over 300?\nAdditional table information: table: cinema", "answer": "SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2"} {"question": "Show the times of elimination by 'Punk' or 'Orton'.\nAdditional table information: table: wrestler", "answer": "SELECT TIME FROM elimination WHERE Eliminated_By = 'Punk' OR Eliminated_By = 'Orton'"} {"question": "Count the number of different payment method codes used by parties.\nAdditional table information: table: e_government", "answer": "SELECT COUNT(DISTINCT payment_method_code) FROM parties"} {"question": "Find the names of songs whose genre is modern or language is English.\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song WHERE genre_is = 'modern' OR languages = 'english'"} {"question": "What is the number of days that had an average humity above 50 and an average visibility above 8?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8"} {"question": "What is the type of vocables that appears most frequently?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many dorms are in the database?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM dorm"} {"question": "What is the average salary for each job title?\nAdditional table information: table: hr_1", "answer": "SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title"} {"question": "Find the distinct student first names of all students that have grade point at least 3.8 in one course.\nAdditional table information: table: college_3", "answer": "SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1, GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8"} {"question": "Show the average, maximum, minimum enrollment of all schools.\nAdditional table information: table: school_finance", "answer": "SELECT AVG(enrollment), MAX(enrollment), MIN(enrollment) FROM school"} {"question": "What is the average latitude and longitude of the starting points of all trips?\nAdditional table information: table: bike_1", "answer": "SELECT AVG(T1.lat), AVG(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id"} {"question": "What is the name of the album that has the track Ball to the Wall?\nAdditional table information: table: store_1", "answer": "SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = 'Balls to the Wall'"} {"question": "What are the total points for all gymnasts, ordered by total points descending?\nAdditional table information: table: gymnast", "answer": "SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC"} {"question": "Find the different billing countries for all invoices.\nAdditional table information: table: chinook_1", "answer": "SELECT DISTINCT (BillingCountry) FROM INVOICE"} {"question": "How many exhibitions have a attendance more than 100 or have a ticket price below 10?\nAdditional table information: table: theme_gallery", "answer": "SELECT COUNT(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10"} {"question": "Give me the name and description of the location with code x.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_name, location_description FROM Ref_locations WHERE location_code = 'x'"} {"question": "Count the number of exhibitions that happened in or after 2005.\nAdditional table information: table: theme_gallery", "answer": "SELECT COUNT(*) FROM exhibition WHERE YEAR >= 2005"} {"question": "What is the total count of enzymes?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT COUNT(*) FROM enzyme"} {"question": "Find the major that is studied by the most female students.\nAdditional table information: table: voter_2", "answer": "SELECT Major FROM STUDENT WHERE Sex = 'F' GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many different types of beds are there?\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(DISTINCT bedType) FROM Rooms"} {"question": "Count the number of programs broadcast for each time section of a day.\nAdditional table information: table: program_share", "answer": "SELECT COUNT(*), time_of_day FROM broadcast GROUP BY time_of_day"} {"question": "In which year did the least people enter hall of fame?\nAdditional table information: table: baseball_1", "answer": "SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Find the first and last name of all the students of age 18 who have vice president votes.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18"} {"question": "What is the primary conference of the school that has the lowest acc percent score in the competition?\nAdditional table information: table: university_basketball", "answer": "SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent NULLS FIRST LIMIT 1"} {"question": "Find the number of routes and airport name for each source airport, order the results by decreasing number of routes.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY COUNT(*) DESC"} {"question": "What is the type of interaction for the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'"} {"question": "What are the product id and product type of the cheapest product?\nAdditional table information: table: department_store", "answer": "SELECT product_id, product_type_code FROM products ORDER BY product_price NULLS FIRST LIMIT 1"} {"question": "Show the reign and days held of wrestlers.\nAdditional table information: table: wrestler", "answer": "SELECT Reign, Days_held FROM wrestler"} {"question": "Find the name of all students who were in the tryout sorted in alphabetic order.\nAdditional table information: table: soccer_2", "answer": "SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName NULLS FIRST"} {"question": "What are the different account ids that have made financial transactions, as well as how many transactions correspond to each?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT account_id, COUNT(*) FROM Financial_transactions GROUP BY account_id"} {"question": "Find the name and country of origin for all artists who have release at least one song of resolution above 900.\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING COUNT(*) >= 1"} {"question": "what are the event details of the services that have the type code 'Marriage'?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage'"} {"question": "What are the names of regions that were not affected?\nAdditional table information: table: storm_record", "answer": "SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region)"} {"question": "What is the average time span of contact channels in the database?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels"} {"question": "How many dorms have amenities?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(DISTINCT dormid) FROM has_amenity"} {"question": "Find the names of schools that have some students playing in goalie and mid positions.\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'"} {"question": "Find the name of product that is produced by both companies Creative Labs and Sony.\nAdditional table information: table: manufactory_1", "answer": "SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T2.name = 'Sony'"} {"question": "What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T3.Visit_Date FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Vincent' OR T2.Tourist_Details = 'Vivian'"} {"question": "Find the total number of catalog contents.\nAdditional table information: table: product_catalog", "answer": "SELECT COUNT(*) FROM catalog_contents"} {"question": "What is the city with the most customers?\nAdditional table information: table: driving_school", "answer": "SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the ids and details for each project?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT project_id, project_details FROM Projects"} {"question": "What are the names of all the stores in the largest district by population?\nAdditional table information: table: store_product", "answer": "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)"} {"question": "Which enzyme names have the substring 'ALA'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name FROM enzyme WHERE name LIKE '%ALA%'"} {"question": "Show the teams that have both wrestlers eliminated by 'Orton' and wrestlers eliminated by 'Benjamin'.\nAdditional table information: table: wrestler", "answer": "SELECT Team FROM Elimination WHERE Eliminated_By = 'Orton' INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = 'Benjamin'"} {"question": "What are the cities no customers live in?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id)"} {"question": "What are the names of the technicians by ascending order of quality rank for the machine they are assigned?\nAdditional table information: table: machine_repair", "answer": "SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank NULLS FIRST"} {"question": "Show names of actors that have appeared in musical with name 'The Phantom of the Opera'.\nAdditional table information: table: musical", "answer": "SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID WHERE T2.Name = 'The Phantom of the Opera'"} {"question": "What is the code of the category that the product with the name 'flax' belongs to?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_category_code FROM products WHERE product_name = 'flax'"} {"question": "For each county, find the name of the county and the number of delegates from that county.\nAdditional table information: table: election", "answer": "SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id"} {"question": "Show the id, name of each editor and the number of journal committees they are on.\nAdditional table information: table: journal_committee", "answer": "SELECT T1.editor_id, T1.Name, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.editor_id"} {"question": "Which classes have more than two captains?\nAdditional table information: table: ship_1", "answer": "SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2"} {"question": "Return the name of the youngest captain.\nAdditional table information: table: ship_1", "answer": "SELECT name FROM captain ORDER BY age NULLS FIRST LIMIT 1"} {"question": "Show the name, street address, and number of floors for all buildings ordered by the number of floors.\nAdditional table information: table: protein_institute", "answer": "SELECT name, street_address, floors FROM building ORDER BY floors NULLS FIRST"} {"question": "How many routes end in a Canadian airport?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'"} {"question": "Show all allergies with type food.\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = 'food'"} {"question": "Find the titles of all movies directed by steven spielberg.\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE director = 'Steven Spielberg'"} {"question": "What are the names and ids of artists with 3 or more albums, listed in alphabetical order?\nAdditional table information: table: chinook_1", "answer": "SELECT T2.Name, T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name NULLS FIRST"} {"question": "Find the phone number of all the customers and staff.\nAdditional table information: table: customer_complaints", "answer": "SELECT phone_number FROM customers UNION SELECT phone_number FROM staff"} {"question": "What is the total amount of all payments?\nAdditional table information: table: sakila_1", "answer": "SELECT SUM(amount) FROM payment"} {"question": "Find the number of vocal types used in song 'Demon Kitty Rag'?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Demon Kitty Rag'"} {"question": "Who has friends that are older than the average age? Print their friends and their ages as well\nAdditional table information: table: network_2", "answer": "SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person)"} {"question": "What are the names of the activities Mark Giuliano is involved in\nAdditional table information: table: activity_1", "answer": "SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = 'Mark' AND T1.lname = 'Giuliano'"} {"question": "What is the name of the institution that 'Matthias Blume' belongs to?\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = 'Matthias' AND t1.lname = 'Blume'"} {"question": "What are the dates for the documents with both 'GV' type and 'SF' type expenses?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'"} {"question": "Show the height of the mountain climbed by the climber with the maximum points.\nAdditional table information: table: climbing", "answer": "SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1"} {"question": "What are the chip model and screen mode of the phone with hardware model name 'LG-P760'?\nAdditional table information: table: phone_1", "answer": "SELECT chip_model, screen_mode FROM phone WHERE Hardware_Model_name = 'LG-P760'"} {"question": "List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1"} {"question": "Show student ids who are female and play football.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = 'Football'"} {"question": "List the vehicle flight number, date and pilot of all the flights, ordered by altitude.\nAdditional table information: table: flight_company", "answer": "SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude ASC NULLS FIRST"} {"question": "What instrument is used the most?\nAdditional table information: table: music_2", "answer": "SELECT instrument FROM instruments GROUP BY instrument ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the id and name of customers whose address contains WY state and do not use credit card for payment.\nAdditional table information: table: department_store", "answer": "SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE '%WY%' AND payment_method_code <> 'Credit Card'"} {"question": "How many distinct birth places are there?\nAdditional table information: table: body_builder", "answer": "SELECT COUNT(DISTINCT Birth_Place) FROM people"} {"question": "Find the average unit price of tracks from the Rock genre.\nAdditional table information: table: chinook_1", "answer": "SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Rock'"} {"question": "Find the names of the students who are in the position of striker and got a yes tryout decision.\nAdditional table information: table: soccer_2", "answer": "SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'"} {"question": "What are the names of players whose training hours is between 500 and 1500?\nAdditional table information: table: soccer_2", "answer": "SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500"} {"question": "List the state in the US with the most invoices.\nAdditional table information: table: store_1", "answer": "SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = 'USA' GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the type of the services in alphabetical order.\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT service_type_code FROM services ORDER BY service_type_code NULLS FIRST"} {"question": "find the names of people who are taller than 200 or lower than 190.\nAdditional table information: table: candidate_poll", "answer": "SELECT name FROM people WHERE height > 200 OR height < 190"} {"question": "What is the date of birth for the staff member named Janessa Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT date_of_birth FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'"} {"question": "What are the names of all instructors in the Comp. Sci. department?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'"} {"question": "What are the last names of students studying major 50?\nAdditional table information: table: voter_2", "answer": "SELECT LName FROM STUDENT WHERE Major = 50"} {"question": "Find number of products which Sony does not make.\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T2.name = 'Sony')"} {"question": "Find the total population of the top 3 districts with the largest area.\nAdditional table information: table: store_product", "answer": "SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3"} {"question": "Show all the distinct product names with price higher than the average.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS)"} {"question": "Find the average age of students living in each dorm and the name of dorm.\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name"} {"question": "How many leagues are there in England?\nAdditional table information: table: soccer_1", "answer": "SELECT COUNT(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = 'England'"} {"question": "How many languages are in these films?\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(DISTINCT language_id) FROM film"} {"question": "Which problems were reported by the staff named Dameon Frami or Jolie Weber? Give me the ids of the problems.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Dameon' AND T2.staff_last_name = 'Frami' UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Jolie' AND T2.staff_last_name = 'Weber'"} {"question": "Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance"} {"question": "How many gymnasts are from each hometown?\nAdditional table information: table: gymnast", "answer": "SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown"} {"question": "Find the total amount of loans provided by bank branches in the state of New York.\nAdditional table information: table: loan_1", "answer": "SELECT SUM(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York'"} {"question": "Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE.\nAdditional table information: table: college_3", "answer": "SELECT T2.Dname, T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = 'INTRODUCTION TO COMPUTER SCIENCE'"} {"question": "What are the open dates and years for the shop named Apple?\nAdditional table information: table: device", "answer": "SELECT Open_Date, Open_Year FROM shop WHERE Shop_Name = 'Apple'"} {"question": "Find the name and checking balance of the account with the lowest saving balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance NULLS FIRST LIMIT 1"} {"question": "Find the names of procedures which physician John Wen was trained in.\nAdditional table information: table: hospital_1", "answer": "SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "What is the average and total transaction amount?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT AVG(transaction_amount), SUM(transaction_amount) FROM Financial_transactions"} {"question": "What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'"} {"question": "Give me ids for all the trip that took place in a zip code area with average mean temperature above 60.\nAdditional table information: table: bike_1", "answer": "SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING AVG(T2.mean_temperature_f) > 60"} {"question": "Which film has the highest rental rate? And what is the rate?\nAdditional table information: table: sakila_1", "answer": "SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1"} {"question": "Show the delegates and the names of county they belong to.\nAdditional table information: table: election", "answer": "SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District"} {"question": "What are the names of all directors who have made one movie except for the director named NULL?\nAdditional table information: table: movie_1", "answer": "SELECT director FROM Movie WHERE director <> 'null' GROUP BY director HAVING COUNT(*) = 1"} {"question": "List the type of bed and name of all traditional rooms.\nAdditional table information: table: inn_1", "answer": "SELECT roomName, bedType FROM Rooms WHERE decor = 'traditional'"} {"question": "What is the language that was used most often in songs with resolution above 500?\nAdditional table information: table: music_1", "answer": "SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which cities have 2 to 4 parks?\nAdditional table information: table: baseball_1", "answer": "SELECT city FROM park GROUP BY city HAVING COUNT(*) BETWEEN 2 AND 4"} {"question": "How many medicines are offered by each trade name?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT trade_name, COUNT(*) FROM medicine GROUP BY trade_name"} {"question": "What are the names and buildings of the deparments, sorted by budget descending?\nAdditional table information: table: college_2", "answer": "SELECT dept_name, building FROM department ORDER BY budget DESC"} {"question": "What are the catalog entry names of the products with next entry ID above 8?\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8"} {"question": "What is each customer's move in date, and the corresponding customer id and details?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id"} {"question": "List roles that have more than one employee. List the role description and number of employees.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT Roles.role_description, COUNT(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING COUNT(Employees.employee_id) > 1"} {"question": "What are the maximum scores the team Boston Red Stockings got when the team won in postseason?\nAdditional table information: table: baseball_1", "answer": "SELECT MAX(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'"} {"question": "What is the school color of the school with the largest enrollment?\nAdditional table information: table: school_player", "answer": "SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1"} {"question": "Find the country that has the most stadiums.\nAdditional table information: table: swimming", "answer": "SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many students have cat allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Has_allergy WHERE Allergy = 'Cat'"} {"question": "How many sports do we have?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(DISTINCT sportname) FROM Sportsinfo"} {"question": "For each director, what are the titles and ratings for all the movies they reviewed?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> 'null' GROUP BY director"} {"question": "What are the classes of races that have two or more corresponding races?\nAdditional table information: table: race_track", "answer": "SELECT CLASS FROM race GROUP BY CLASS HAVING COUNT(*) >= 2"} {"question": "What are the names of the ships that are not from the United States?\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship WHERE Nationality <> 'United States'"} {"question": "What is the description of the club 'Pen and Paper Gaming'?\nAdditional table information: table: club_1", "answer": "SELECT clubdesc FROM club WHERE clubname = 'Pen and Paper Gaming'"} {"question": "Which member names corresponding to members who are not in the Progress Party?\nAdditional table information: table: party_people", "answer": "SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> 'Progress Party'"} {"question": "Show different tourist attractions' names, ids, and the corresponding number of visits.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T2.Tourist_Attraction_ID, COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID"} {"question": "What is the country of the airport with the highest elevation?\nAdditional table information: table: flight_4", "answer": "SELECT country FROM airports ORDER BY elevation DESC LIMIT 1"} {"question": "What are the ids and details of all statements?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT STATEMENT_ID, statement_details FROM Statements"} {"question": "Which marketing region has the most drama workshop groups? Give me the region code.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the first name and gender of the students who have allergy to milk but can put up with cats?\nAdditional table information: table: allergy_1", "answer": "SELECT fname, sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = 'Milk' EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = 'Cat')"} {"question": "Count the number of female Professors we have.\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = 'Professor'"} {"question": "Find the number of distinct stages in claim processing.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT COUNT(*) FROM claims_processing_stages"} {"question": "What is the type of the document whose description starts with the word 'Initial'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'"} {"question": "Which districts have at least two addresses?\nAdditional table information: table: sakila_1", "answer": "SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2"} {"question": "What is the least common faculty rank?\nAdditional table information: table: college_3", "answer": "SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Find the zip code in which the average mean visibility is lower than 10.\nAdditional table information: table: bike_1", "answer": "SELECT zip_code FROM weather GROUP BY zip_code HAVING AVG(mean_visibility_miles) < 10"} {"question": "What is the average fee on a CSU campus in 2005?\nAdditional table information: table: csu_1", "answer": "SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005"} {"question": "Which city does has most number of customers?\nAdditional table information: table: driving_school", "answer": "SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many vocal types are used in the song 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'"} {"question": "What are the names of instructors who didn't teach?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches)"} {"question": "Find the state and country of all cities with post code starting with 4.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE '4%'"} {"question": "Which guests have apartment bookings with status code 'Confirmed'? Return their first names and last names.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.guest_first_name, T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = 'Confirmed'"} {"question": "Find the name of captains whose rank are either Midshipman or Lieutenant.\nAdditional table information: table: ship_1", "answer": "SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'"} {"question": "List the project details of the projects which did not hire any staff for a researcher role.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher')"} {"question": "Find the names of the items that did not receive any review.\nAdditional table information: table: epinions_1", "answer": "SELECT title FROM item WHERE NOT i_id IN (SELECT i_id FROM review)"} {"question": "What are the campuses that had between 600 and 1000 faculty members in 2004?\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004"} {"question": "What is the total number of clubs that have less than 10 medals in total?\nAdditional table information: table: sports_competition", "answer": "SELECT COUNT(*) FROM club_rank WHERE Total < 10"} {"question": "Show the names of editors of age either 24 or 25.\nAdditional table information: table: journal_committee", "answer": "SELECT Name FROM editor WHERE Age = 24 OR Age = 25"} {"question": "List name, dates active, and number of deaths for all storms with at least 1 death.\nAdditional table information: table: storm_record", "answer": "SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1"} {"question": "find the name of driver who is driving the school bus with the longest working history.\nAdditional table information: table: school_bus", "answer": "SELECT t1.name FROM driver AS t1 JOIN school_bus AS t2 ON t1.driver_id = t2.driver_id ORDER BY years_working DESC LIMIT 1"} {"question": "Which job titles correspond to jobs with salaries over 9000?\nAdditional table information: table: hr_1", "answer": "SELECT job_title FROM jobs WHERE min_salary > 9000"} {"question": "What is the maximum and mininum number of stars a rating can receive?\nAdditional table information: table: movie_1", "answer": "SELECT MAX(stars), MIN(stars) FROM Rating"} {"question": "Give the class of races that is most common.\nAdditional table information: table: race_track", "answer": "SELECT CLASS FROM race GROUP BY CLASS ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the number of students who did not enroll in any course.\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(*) FROM Students WHERE NOT student_id IN (SELECT student_id FROM Student_Course_Enrolment)"} {"question": "What are the name and phone of the customer with the most ordered product quantity?\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY SUM(T3.order_quantity) DESC LIMIT 1"} {"question": "How many faculty members do we have for each rank and gender?\nAdditional table information: table: activity_1", "answer": "SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex"} {"question": "Which cities have higher temperature in Feb than in Jun or have once served as host cities?\nAdditional table information: table: city_record", "answer": "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"} {"question": "Show the id and salary of Mark Young.\nAdditional table information: table: flight_1", "answer": "SELECT eid, salary FROM Employee WHERE name = 'Mark Young'"} {"question": "Show the minimum, maximum, average price for all products.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products"} {"question": "List the ids, names and market shares of all browsers.\nAdditional table information: table: browser_web", "answer": "SELECT id, name, market_share FROM browser"} {"question": "What are the albums produced in year 2010?\nAdditional table information: table: music_2", "answer": "SELECT * FROM Albums WHERE YEAR = 2010"} {"question": "What is the phone number of the performer Ashley?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = 'Ashley'"} {"question": "How many events are there for each party?\nAdditional table information: table: party_people", "answer": "SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id"} {"question": "Show the membership level with most number of members.\nAdditional table information: table: shop_membership", "answer": "SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average enrollment number?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(enr) FROM College"} {"question": "Find the room number of the rooms which can sit 50 to 100 students and their buildings.\nAdditional table information: table: college_2", "answer": "SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100"} {"question": "What are the songs in volumes that have resulted in a nomination at music festivals?\nAdditional table information: table: music_4", "answer": "SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = 'Nominated'"} {"question": "How many different roles are there in the club 'Bootup Baltimore'?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = 'Bootup Baltimore'"} {"question": "What are the student ids for all male students?\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Student WHERE Sex = 'M'"} {"question": "What are the names of teams that do no have match season record?\nAdditional table information: table: match_season", "answer": "SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season)"} {"question": "Show all publishers which do not have a book in 1989.\nAdditional table information: table: culture_company", "answer": "SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989"} {"question": "What are the names of artists who are Male and are from UK?\nAdditional table information: table: music_1", "answer": "SELECT artist_name FROM artist WHERE country = 'UK' AND gender = 'Male'"} {"question": "What are the names of colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students?\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM College WHERE enr < 13000 AND state = 'AZ' UNION SELECT cName FROM College WHERE enr > 15000 AND state = 'LA'"} {"question": "How many restaurant is the Sandwich type restaurant?\nAdditional table information: table: restaurant_1", "answer": "SELECT COUNT(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'"} {"question": "Find the number of rooms with more than 50 capacity for each building.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*), building FROM classroom WHERE capacity > 50 GROUP BY building"} {"question": "What are the card numbers of members from Kentucky?\nAdditional table information: table: shop_membership", "answer": "SELECT card_number FROM member WHERE Hometown LIKE '%Kentucky%'"} {"question": "What are the emails and phone numbers of all customers, sorted by email address and phone number?\nAdditional table information: table: customer_complaints", "answer": "SELECT email_address, phone_number FROM customers ORDER BY email_address NULLS FIRST, phone_number NULLS FIRST"} {"question": "How many products have the color description 'red' and the characteristic name 'slow'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'slow'"} {"question": "Which schools do not have any player? Give me the school locations.\nAdditional table information: table: school_player", "answer": "SELECT LOCATION FROM school WHERE NOT School_ID IN (SELECT School_ID FROM Player)"} {"question": "Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games.\nAdditional table information: table: game_1", "answer": "SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = 'Call of Destiny' INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = 'Works of Widenius')"} {"question": "What is the most common amenity in the dorms?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List all info about all people.\nAdditional table information: table: candidate_poll", "answer": "SELECT * FROM people"} {"question": "How many registed students do each course have? List course name and the number of their registered students?\nAdditional table information: table: student_assessment", "answer": "SELECT T3.course_name, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id"} {"question": "For each payment method, how many payments were made?\nAdditional table information: table: driving_school", "answer": "SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code"} {"question": "How many times does ROY SWEAZY has reserved a room.\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'"} {"question": "Find courses that ran in Fall 2009 and in Spring 2010.\nAdditional table information: table: college_2", "answer": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "What are the names of all movies that were made after 2000 or reviewed by Brittany Harris?\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000"} {"question": "List the customer event id and the corresponding move in date and property id.\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT customer_event_id, date_moved_in, property_id FROM customer_events"} {"question": "Find names and times of trains that run through stations for the local authority Chiltern.\nAdditional table information: table: station_weather", "answer": "SELECT t3.name, t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = 'Chiltern'"} {"question": "Show all the distinct buildings that have faculty rooms.\nAdditional table information: table: activity_1", "answer": "SELECT DISTINCT building FROM Faculty"} {"question": "Find the most prominent max page size among all the products.\nAdditional table information: table: store_product", "answer": "SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the origins from which more than 1 train starts.\nAdditional table information: table: station_weather", "answer": "SELECT origin FROM train GROUP BY origin HAVING COUNT(*) > 1"} {"question": "How many kinds of different ratings are listed?\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(DISTINCT rating) FROM film"} {"question": "How many camera lenses are not used in taking any photos?\nAdditional table information: table: mountain_photos", "answer": "SELECT COUNT(*) FROM camera_lens WHERE NOT id IN (SELECT camera_lens_id FROM photos)"} {"question": "What are all company names that have a corresponding movie directed in the year 1999?\nAdditional table information: table: culture_company", "answer": "SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999"} {"question": "Find the first name of students who is older than 20.\nAdditional table information: table: dorm_1", "answer": "SELECT fname FROM student WHERE age > 20"} {"question": "List the names of wrestlers and the teams in elimination in descending order of days held.\nAdditional table information: table: wrestler", "answer": "SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC"} {"question": "How many assessment notes are there in total?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT COUNT(*) FROM ASSESSMENT_NOTES"} {"question": "List the themes of parties in ascending order of number of hosts.\nAdditional table information: table: party_host", "answer": "SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC NULLS FIRST"} {"question": "Find the name of project that continues for the longest time.\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM projects ORDER BY hours DESC LIMIT 1"} {"question": "Show the census ranking of cities whose status are not 'Village'.\nAdditional table information: table: farm", "answer": "SELECT Census_Ranking FROM city WHERE Status <> 'Village'"} {"question": "How many airports are there per country? Order the countries by decreasing number of airports.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC"} {"question": "What are the names of all of Bob's friends?\nAdditional table information: table: network_2", "answer": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'"} {"question": "Show the official names of the cities that have hosted more than one competition.\nAdditional table information: table: farm", "answer": "SELECT T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT(*) > 1"} {"question": "Please list all album titles in alphabetical order.\nAdditional table information: table: chinook_1", "answer": "SELECT Title FROM ALBUM ORDER BY Title NULLS FIRST"} {"question": "Find id of the candidate whose email is stanley.monahan@example.org?\nAdditional table information: table: student_assessment", "answer": "SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = 'stanley.monahan@example.org'"} {"question": "Show all ages and corresponding number of students.\nAdditional table information: table: allergy_1", "answer": "SELECT age, COUNT(*) FROM Student GROUP BY age"} {"question": "What are the procedures that cost more than 1000 or are specialized in by physician John Wen?\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM procedures WHERE cost > 1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "What are the different regions of clubs in ascending alphabetical order?\nAdditional table information: table: sports_competition", "answer": "SELECT DISTINCT Region FROM club ORDER BY Region ASC NULLS FIRST"} {"question": "What is the the phone number of Nancy Edwards?\nAdditional table information: table: store_1", "answer": "SELECT phone FROM employees WHERE first_name = 'Nancy' AND last_name = 'Edwards'"} {"question": "Return the different countries for artists.\nAdditional table information: table: theme_gallery", "answer": "SELECT DISTINCT country FROM artist"} {"question": "Find the name of all customers.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers"} {"question": "What is the race class with most number of races.\nAdditional table information: table: race_track", "answer": "SELECT CLASS FROM race GROUP BY CLASS ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names, classes, and ranks of all captains?\nAdditional table information: table: ship_1", "answer": "SELECT name, CLASS, rank FROM captain"} {"question": "How many different FDA approval statuses exist for medicines?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT COUNT(DISTINCT FDA_approved) FROM medicine"} {"question": "Which student are enrolled in at least two courses? Give me the student ID and personal name.\nAdditional table information: table: e_learning", "answer": "SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2"} {"question": "Who performed the song named 'Badlands'? Show the first name and the last name.\nAdditional table information: table: music_2", "answer": "SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Badlands'"} {"question": "Show the company name and the main industry for all companies whose headquarters are not from USA.\nAdditional table information: table: gas_company", "answer": "SELECT company, main_industry FROM company WHERE headquarters <> 'USA'"} {"question": "What are the names of actors who are not 20 years old?\nAdditional table information: table: musical", "answer": "SELECT Name FROM actor WHERE Age <> 20"} {"question": "Give me the star rating descriptions of the hotels that cost more than 10000.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000"} {"question": "Give me the start station and end station for the trips with the three oldest id.\nAdditional table information: table: bike_1", "answer": "SELECT start_station_name, end_station_name FROM trip ORDER BY id NULLS FIRST LIMIT 3"} {"question": "What are the names of all students who successfully tried out for the position of striker?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'"} {"question": "Which employees do not authorize destruction for any document? Give me their employee ids.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "List the 3 highest salaries of the players in 2001?\nAdditional table information: table: baseball_1", "answer": "SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3"} {"question": "Return the characters for actors, ordered by age descending.\nAdditional table information: table: musical", "answer": "SELECT Character FROM actor ORDER BY age DESC"} {"question": "How many members are there?\nAdditional table information: table: decoration_competition", "answer": "SELECT COUNT(*) FROM member"} {"question": "What are the schools that were either founded before 1850 or are public?\nAdditional table information: table: university_basketball", "answer": "SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'"} {"question": "What are the names of customers who never made an order.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id"} {"question": "List the names of technicians in ascending order of age.\nAdditional table information: table: machine_repair", "answer": "SELECT Name FROM technician ORDER BY Age ASC NULLS FIRST"} {"question": "What are the names of all movies that received 3 or 4 stars?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4"} {"question": "For each city, return the highest latitude among its stations.\nAdditional table information: table: bike_1", "answer": "SELECT city, MAX(lat) FROM station GROUP BY city"} {"question": "What are names of stations that have average bike availability above 10 and are not located in San Jose city?\nAdditional table information: table: bike_1", "answer": "SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING AVG(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = 'San Jose'"} {"question": "How many companies were created by Andy?\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(*) FROM manufacturers WHERE founder = 'Andy'"} {"question": "Find the name and address of the customers who have both New and Pending orders.\nAdditional table information: table: department_store", "answer": "SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'New' INTERSECT SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Pending'"} {"question": "Show the party that has the most people.\nAdditional table information: table: debate", "answer": "SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the maximum level of managers in countries that are not 'Australia'?\nAdditional table information: table: railway", "answer": "SELECT MAX(LEVEL) FROM manager WHERE Country <> 'Australia\t'"} {"question": "How many accounts have a savings balance above the average savings balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings)"} {"question": "What are the last names of staff with email addressed containing the substring 'wrau'?\nAdditional table information: table: customer_complaints", "answer": "SELECT last_name FROM staff WHERE email_address LIKE '%wrau%'"} {"question": "Find the location of the club 'Pen and Paper Gaming'.\nAdditional table information: table: club_1", "answer": "SELECT clublocation FROM club WHERE clubname = 'Pen and Paper Gaming'"} {"question": "Who are the members of the club named 'Hopkins Student Enterprises'? Show the last name.\nAdditional table information: table: club_1", "answer": "SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises'"} {"question": "Count the number of authors.\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(*) FROM authors"} {"question": "What are the names of representatives with more than 10000 votes in election?\nAdditional table information: table: election_representative", "answer": "SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000"} {"question": "What is the address for the customer with id 10?\nAdditional table information: table: department_store", "answer": "SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10"} {"question": "How many movie directors are there?\nAdditional table information: table: culture_company", "answer": "SELECT COUNT(DISTINCT director) FROM movie"} {"question": "What are the names of customers who have taken both Mortgage and Auto loans?\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'"} {"question": "How many different classes are there?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT class_code) FROM CLASS"} {"question": "How many addresses are there in country USA?\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT COUNT(*) FROM addresses WHERE country = 'USA'"} {"question": "Find the first name and major of the students who are not allegry to soy.\nAdditional table information: table: allergy_1", "answer": "SELECT fname, major FROM Student WHERE NOT StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = 'Soy')"} {"question": "Return the ids of documents that do not have expenses.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses"} {"question": "Find the number of checking accounts for each account name.\nAdditional table information: table: small_bank_1", "answer": "SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name"} {"question": "List the addresses of all the course authors or tutors.\nAdditional table information: table: e_learning", "answer": "SELECT address_line_1 FROM Course_Authors_and_Tutors"} {"question": "Find the first names of all professors in the Accounting department who is teaching some course and the class room.\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'"} {"question": "Show the musical nominee with award 'Bob Fosse' or 'Cleavant Derricks'.\nAdditional table information: table: musical", "answer": "SELECT Nominee FROM musical WHERE Award = 'Tony Award' OR Award = 'Cleavant Derricks'"} {"question": "Who has written a paper that has the word 'Functional' in its title? Return the first names of the authors.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE '%Functional%'"} {"question": "List the company name and rank for all companies in the decreasing order of their sales.\nAdditional table information: table: gas_company", "answer": "SELECT company, rank FROM company ORDER BY Sales_billion DESC"} {"question": "Show all sport name and the number of students.\nAdditional table information: table: game_1", "answer": "SELECT sportname, COUNT(*) FROM Sportsinfo GROUP BY sportname"} {"question": "For each zip code, what is the average mean temperature for all dates that start with '8'?\nAdditional table information: table: bike_1", "answer": "SELECT zip_code, AVG(mean_temperature_f) FROM weather WHERE date LIKE '8/%' GROUP BY zip_code"} {"question": "Show the names of aircrafts that are associated with both an airport named 'London Heathrow' and an airport named 'London Gatwick'\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Heathrow' INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick'"} {"question": "How many home games did the team Boston Red Stockings play from 1990 to 2000 in total?\nAdditional table information: table: baseball_1", "answer": "SELECT SUM(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000"} {"question": "Please show the team that has the most number of technicians.\nAdditional table information: table: machine_repair", "answer": "SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List all the dates of enrollment and completion of students.\nAdditional table information: table: e_learning", "answer": "SELECT date_of_enrolment, date_of_completion FROM Student_Course_Enrolment"} {"question": "How many transactions correspond to each invoice number?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT invoice_number, COUNT(*) FROM Financial_transactions GROUP BY invoice_number"} {"question": "Show the most common type code across products.\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What products are sold at the store named Miramichi?\nAdditional table information: table: store_product", "answer": "SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = 'Miramichi'"} {"question": "How many different status codes of things are there?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT COUNT(DISTINCT Status_of_Thing_Code) FROM Timed_Status_of_Things"} {"question": "Find the name of customer who has the highest amount of loans.\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1"} {"question": "What are the first names of students, ordered by age from greatest to least?\nAdditional table information: table: college_3", "answer": "SELECT Fname FROM STUDENT ORDER BY Age DESC"} {"question": "Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)"} {"question": "List all the information about course authors and tutors in alphabetical order of the personal name.\nAdditional table information: table: e_learning", "answer": "SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name NULLS FIRST"} {"question": "What are the names of the people who have no friends who are students?\nAdditional table information: table: network_2", "answer": "SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'"} {"question": "Sort the company names in descending order of the company's market value.\nAdditional table information: table: company_office", "answer": "SELECT name FROM Companies ORDER BY Market_Value_billion DESC"} {"question": "What are the ids and full names of customers who hold two or more cards?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2"} {"question": "Show the party with drivers from Hartford and drivers older than 40.\nAdditional table information: table: school_bus", "answer": "SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40"} {"question": "What is the name of the course that has the most student enrollment?\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How old is each student and how many students are each age?\nAdditional table information: table: allergy_1", "answer": "SELECT age, COUNT(*) FROM Student GROUP BY age"} {"question": "Find the names of the channels that are broadcast in the morning.\nAdditional table information: table: program_share", "answer": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning'"} {"question": "Which buildings do not have any company office? Give me the building names.\nAdditional table information: table: company_office", "answer": "SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM Office_locations)"} {"question": "What are the names of catalog entries with level number 8?\nAdditional table information: table: product_catalog", "answer": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = '8'"} {"question": "For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'"} {"question": "What are the majors of male (sex is M) students?\nAdditional table information: table: voter_2", "answer": "SELECT Major FROM STUDENT WHERE Sex = 'M'"} {"question": "how many female dependents are there?\nAdditional table information: table: company_1", "answer": "SELECT COUNT(*) FROM dependent WHERE sex = 'F'"} {"question": "Show all city with a branch opened in 2001 and a branch with more than 100 membership.\nAdditional table information: table: shop_membership", "answer": "SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100"} {"question": "What are the GDP and population of the city that already served as a host more than once?\nAdditional table information: table: city_record", "answer": "SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING COUNT(*) > 1"} {"question": "Show the names of all the clients with no booking.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID"} {"question": "Show all distinct region names ordered by their labels.\nAdditional table information: table: party_people", "answer": "SELECT DISTINCT region_name FROM region ORDER BY Label NULLS FIRST"} {"question": "What is the maximum and minimum height of all players?\nAdditional table information: table: soccer_1", "answer": "SELECT MAX(weight), MIN(weight) FROM Player"} {"question": "What is the installation date for each ending station on all the trips?\nAdditional table information: table: bike_1", "answer": "SELECT T1.id, T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id"} {"question": "Find the id and local authority of the station whose maximum precipitation is higher than 50.\nAdditional table information: table: station_weather", "answer": "SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING MAX(t1.precipitation) > 50"} {"question": "How many students are there in each major?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), major FROM student GROUP BY major"} {"question": "Find the number of routes operated by American Airlines.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'"} {"question": "What are the names for tracks without a race in class 'GT'.\nAdditional table information: table: race_track", "answer": "SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id WHERE T1.class = 'GT'"} {"question": "List the name of film studio that have the most number of films.\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the poll resource associated with the most candidates.\nAdditional table information: table: candidate_poll", "answer": "SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the first name, GPA, and phone number of the students with the top 5 GPAs?\nAdditional table information: table: college_1", "answer": "SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5"} {"question": "Find the captain rank that has no captain in Third-rate ship of the line class.\nAdditional table information: table: ship_1", "answer": "SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'"} {"question": "Please show the most common age of editors.\nAdditional table information: table: journal_committee", "answer": "SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "display the department name and number of employees in each of the department.\nAdditional table information: table: hr_1", "answer": "SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name"} {"question": "List the names of players in ascending order of votes.\nAdditional table information: table: riding_club", "answer": "SELECT Player_name FROM player ORDER BY Votes ASC NULLS FIRST"} {"question": "How many distinct currency codes are there for all drama workshop groups?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups"} {"question": "Which products have problems reported by both the staff named Lacey Bosco and the staff named Kenton Champlin?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T2.product_name FROM problems AS T1, product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = 'Lacey' AND T3.staff_last_name = 'Bosco' INTERSECT SELECT T2.product_name FROM problems AS T1, product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = 'Kenton' AND T3.staff_last_name = 'Champlin'"} {"question": "How many different cities do have some airport in the country of Greenland?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland'"} {"question": "How many customers are there in the customer type with the most customers?\nAdditional table information: table: customer_complaints", "answer": "SELECT COUNT(*) FROM customers GROUP BY customer_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Give the address of the staff member who has the first name Elsa.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa'"} {"question": "What is the average price of wines produced in appelations in Sonoma County?\nAdditional table information: table: wine_1", "answer": "SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma'"} {"question": "What is the total number of hours for all projects?\nAdditional table information: table: scientist_1", "answer": "SELECT SUM(hours) FROM projects"} {"question": "Which gender makes up the majority of the staff?\nAdditional table information: table: assets_maintenance", "answer": "SELECT gender FROM staff GROUP BY gender ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of patients' prescriptions physician John Dorian made.\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = 'John Dorian'"} {"question": "What are the names of manufacturers with revenue greater than the average of all revenues?\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM manufacturers WHERE revenue > (SELECT AVG(revenue) FROM manufacturers)"} {"question": "Show the budget type code and description and the corresponding document id.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code"} {"question": "Show id, first and last names for all customers with at least two cards.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2"} {"question": "What is the reviewer name, film title, movie rating, and rating date for every movie ordered by reviewer name, movie title, then finally rating?\nAdditional table information: table: movie_1", "answer": "SELECT T3.name, T2.title, T1.stars, T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name NULLS FIRST, T2.title NULLS FIRST, T1.stars NULLS FIRST"} {"question": "What are the ids of the problems that are from the product 'voluptatem' and are reported after 1995?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = 'voluptatem' AND T1.date_problem_reported > '1995'"} {"question": "How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id.\nAdditional table information: table: insurance_policies", "answer": "SELECT COUNT(*), T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1"} {"question": "How many employees does each role have? List role description, id and number of employees.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT T1.role_description, T2.role_code, COUNT(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code"} {"question": "Who is the friend of Zach with longest year relationship?\nAdditional table information: table: network_2", "answer": "SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach')"} {"question": "List all product names in ascending order of price.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_Name FROM Products ORDER BY Product_Price ASC NULLS FIRST"} {"question": "Find the name of the user who has the largest number of followers.\nAdditional table information: table: twitter_1", "answer": "SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1"} {"question": "What is the department name of the students with lowest gpa belongs to?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa NULLS FIRST LIMIT 1"} {"question": "Count the number of different teams involved in match season.\nAdditional table information: table: match_season", "answer": "SELECT COUNT(DISTINCT Team) FROM match_season"} {"question": "How many companies are there?\nAdditional table information: table: company_office", "answer": "SELECT COUNT(*) FROM Companies"} {"question": "Find the author for each submission and list them in ascending order of submission score.\nAdditional table information: table: workshop_paper", "answer": "SELECT Author FROM submission ORDER BY Scores ASC NULLS FIRST"} {"question": "What is the id of the project with least number of documents?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Return the order ids and details for orderes with two or more invoices.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING COUNT(*) > 2"} {"question": "What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Christop' AND T2.staff_last_name = 'Berge' INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Ashley' AND T2.staff_last_name = 'Medhurst'"} {"question": "Which stadium name contains the substring 'Bank'?\nAdditional table information: table: game_injury", "answer": "SELECT name FROM stadium WHERE name LIKE '%Bank%'"} {"question": "Return the dates of ceremony corresponding to music festivals that had the category 'Best Song' and result 'Awarded'.\nAdditional table information: table: music_4", "answer": "SELECT Date_of_ceremony FROM music_festival WHERE Category = 'Best Song' AND RESULT = 'Awarded'"} {"question": "Show the name of technicians aged either 36 or 37\nAdditional table information: table: machine_repair", "answer": "SELECT Name FROM technician WHERE Age = 36 OR Age = 37"} {"question": "What are the first year and last year of the parties whose theme is 'Spring' or 'Teqnology'?\nAdditional table information: table: party_host", "answer": "SELECT First_year, Last_year FROM party WHERE Party_Theme = 'Spring' OR Party_Theme = 'Teqnology'"} {"question": "Who are the ministers who took office after 1961 or before 1959?\nAdditional table information: table: party_people", "answer": "SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959"} {"question": "Count the number of devices.\nAdditional table information: table: device", "answer": "SELECT COUNT(*) FROM device"} {"question": "What are the SSN and names of scientists working on the project with the most hours?\nAdditional table information: table: scientist_1", "answer": "SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)"} {"question": "What are all the different product names, and how many complains has each received?\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name"} {"question": "How many aircrafts have distance between 1000 and 5000?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000"} {"question": "Find the number of distinct amenities.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM dorm_amenity"} {"question": "List the dates of enrollment and completion of the student with personal name 'Karson'.\nAdditional table information: table: e_learning", "answer": "SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = 'Karson'"} {"question": "What is the average price for products?\nAdditional table information: table: solvency_ii", "answer": "SELECT AVG(Product_Price) FROM Products"} {"question": "Find the first names of all instructors who have taught some course and the course code.\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num"} {"question": "Count the number of distinct product types.\nAdditional table information: table: department_store", "answer": "SELECT COUNT(DISTINCT product_type_code) FROM products"} {"question": "Return the number of companies created by Andy.\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(*) FROM manufacturers WHERE founder = 'Andy'"} {"question": "What are the first names of student who only took one course?\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1"} {"question": "Please list the countries and years of film market estimations.\nAdditional table information: table: film_rank", "answer": "SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID"} {"question": "Find the last names of faculties in building Barton in alphabetic order.\nAdditional table information: table: college_3", "answer": "SELECT Lname FROM FACULTY WHERE Building = 'Barton' ORDER BY Lname NULLS FIRST"} {"question": "What kind of decor has the least number of reservations?\nAdditional table information: table: inn_1", "answer": "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"} {"question": "What are the different cities where students live?\nAdditional table information: table: student_assessment", "answer": "SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id"} {"question": "What is the title of the newest movie?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE YEAR = (SELECT MAX(YEAR) FROM Movie)"} {"question": "Show the home city with the most number of drivers.\nAdditional table information: table: school_bus", "answer": "SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the first name and major of the students who are able to consume soy?\nAdditional table information: table: allergy_1", "answer": "SELECT fname, major FROM Student WHERE NOT StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = 'Soy')"} {"question": "How many customers do we have?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT COUNT(*) FROM CUSTOMERS"} {"question": "Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING COUNT(*) > 2 UNION SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = (SELECT MAX(Amount_Claimed) FROM Claims)"} {"question": "Find the names of stadiums whose capacity is smaller than the average capacity.\nAdditional table information: table: swimming", "answer": "SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium)"} {"question": "Show the names of editors that are on at least two journal committees.\nAdditional table information: table: journal_committee", "answer": "SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2"} {"question": "What are the first and last names for all customers?\nAdditional table information: table: driving_school", "answer": "SELECT first_name, last_name FROM Customers"} {"question": "Show the member name and hometown who registered a branch in 2016.\nAdditional table information: table: shop_membership", "answer": "SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016"} {"question": "How many clubs does 'Linda Smith' belong to?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Linda' AND t3.lname = 'Smith'"} {"question": "Show the name of each party and the corresponding number of delegates from that party.\nAdditional table information: table: election", "answer": "SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party"} {"question": "How many actors are there?\nAdditional table information: table: musical", "answer": "SELECT COUNT(*) FROM actor"} {"question": "What are the names of all the Japanese constructors that have earned more than 5 points?\nAdditional table information: table: formula_1", "answer": "SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = 'Japanese' AND T2.points > 5"} {"question": "What is the first and last name of all students who play Football or Lacrosse?\nAdditional table information: table: game_1", "answer": "SELECT T2.lname, T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = 'Football' OR T1.SportName = 'Lacrosse'"} {"question": "How many classes are professor whose last name is Graztevski has?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski'"} {"question": "Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY SUM(room_count) DESC LIMIT 1"} {"question": "List the id and type of each thing, and the details of the organization that owns it.\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT T1.thing_id, T1.type_of_Thing_Code, T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id"} {"question": "List the amount and donor name for the largest amount of donation.\nAdditional table information: table: school_finance", "answer": "SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1"} {"question": "List the names of people that are not employed by any company\nAdditional table information: table: company_employee", "answer": "SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM employment)"} {"question": "What are the first names for students who have an 'a' in their first name?\nAdditional table information: table: college_3", "answer": "SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'"} {"question": "What are the names of all products that are not the most frequently-used maximum page size?\nAdditional table information: table: store_product", "answer": "SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What are the average and minimum weights for people of each sex?\nAdditional table information: table: candidate_poll", "answer": "SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex"} {"question": "Which manufacturer has the most number of shops? List its name and year of opening.\nAdditional table information: table: manufacturer", "answer": "SELECT open_year, name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1"} {"question": "Which vocal type has the band mate with first name 'Solveig' played the most?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = 'Solveig' GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many lesson does customer with first name Ray took?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Ray'"} {"question": "Find the name and price of the product that has been ordered the greatest number of times.\nAdditional table information: table: customer_deliveries", "answer": "SELECT t1.product_name, t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the states with the most invoices?\nAdditional table information: table: store_1", "answer": "SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = 'USA' GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the dates of enrollment and completion of the student with family name 'Zieme' and personal name 'Bernie'.\nAdditional table information: table: e_learning", "answer": "SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = 'Zieme' AND T2.personal_name = 'Bernie'"} {"question": "Show the name and opening year for three churches that opened most recently.\nAdditional table information: table: wedding", "answer": "SELECT name, open_date FROM church ORDER BY open_date DESC LIMIT 3"} {"question": "What is the complete description of the researcher role.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'"} {"question": "Find the id of instructors who didn't teach any courses?\nAdditional table information: table: college_2", "answer": "SELECT id FROM instructor EXCEPT SELECT id FROM teaches"} {"question": "What are the titles of papers published by 'Jeremy Gibbons'?\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Jeremy' AND t1.lname = 'Gibbons'"} {"question": "What are the names of all aircrafts that can cover more distances than average?\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Aircraft WHERE distance > (SELECT AVG(distance) FROM Aircraft)"} {"question": "What are the names of products with category 'Spices'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_name FROM products WHERE product_category_code = 'Spices'"} {"question": "For each constructor id, how many races are there?\nAdditional table information: table: formula_1", "answer": "SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid"} {"question": "Who is the person whose age is below 30?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE age < 30"} {"question": "For each origin, how many flights came from there?\nAdditional table information: table: flight_1", "answer": "SELECT origin, COUNT(*) FROM Flight GROUP BY origin"} {"question": "What are the names for the 3 branches that have the most memberships?\nAdditional table information: table: shop_membership", "answer": "SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3"} {"question": "List all player names who have an overall rating higher than the average.\nAdditional table information: table: soccer_1", "answer": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > (SELECT AVG(overall_rating) FROM Player_Attributes)"} {"question": "Which fault log included the most number of faulty parts? List the fault log id, description and record time.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.fault_log_entry_id, T1.fault_description, T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which studios have an average gross of over 4500000?\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film GROUP BY Studio HAVING AVG(Gross_in_dollar) >= 4500000"} {"question": "What is the name of each dorm that has a TV Lounge but no study rooms?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'"} {"question": "Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.\nAdditional table information: table: pilot_record", "answer": "SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005"} {"question": "What is the type of the document named 'David CV'?\nAdditional table information: table: document_management", "answer": "SELECT document_type_code FROM documents WHERE document_name = 'David CV'"} {"question": "Find the names of all races held in 2017.\nAdditional table information: table: formula_1", "answer": "SELECT name FROM races WHERE YEAR = 2017"} {"question": "What are the the full names and ids for all customers, and how many accounts does each have?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id"} {"question": "Which clubs have one or more members from the city with code 'BAL'? Give me the names of the clubs.\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = 'BAL'"} {"question": "Show name, opening year, and capacity for each cinema.\nAdditional table information: table: cinema", "answer": "SELECT name, openning_year, capacity FROM cinema"} {"question": "How many distinct types of accounts are there?\nAdditional table information: table: loan_1", "answer": "SELECT COUNT(DISTINCT acc_type) FROM customer"} {"question": "Count the number of characteristics of the 'flax' product.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'flax'"} {"question": "For each type of store, how many of them are there?\nAdditional table information: table: store_product", "answer": "SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE"} {"question": "What is the description of role code ED?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT role_description FROM ROLES WHERE role_code = 'ED'"} {"question": "What are ids of the faculty members who not only participate in an activity but also advise a student.\nAdditional table information: table: activity_1", "answer": "SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student"} {"question": "What are the different film Directors?\nAdditional table information: table: film_rank", "answer": "SELECT DISTINCT Director FROM film"} {"question": "Count the number of different software platforms.\nAdditional table information: table: device", "answer": "SELECT COUNT(DISTINCT Software_Platform) FROM device"} {"question": "Return the apartment number with the largest number of bedrooms.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1"} {"question": "What are the first names and birthdates of the professors in charge of ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT DISTINCT T1.EMP_FNAME, T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = 'ACCT-211'"} {"question": "How many students are advised by each rank of faculty? List the rank and the number of students.\nAdditional table information: table: activity_1", "answer": "SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank"} {"question": "How many eliminations did each team have?\nAdditional table information: table: wrestler", "answer": "SELECT Team, COUNT(*) FROM elimination GROUP BY Team"} {"question": "Show different teams in eliminations and the number of eliminations from each team.\nAdditional table information: table: wrestler", "answer": "SELECT Team, COUNT(*) FROM elimination GROUP BY Team"} {"question": "What are department ids for departments with managers managing more than 3 employees?\nAdditional table information: table: hr_1", "answer": "SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4"} {"question": "What is the title of the course with Differential Geometry as a prerequisite?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry')"} {"question": "How many different instruments does the musician with the last name 'Heilo' use?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = 'Heilo'"} {"question": "List the names of shops that have no devices in stock.\nAdditional table information: table: device", "answer": "SELECT Shop_Name FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM stock)"} {"question": "What are the valid from and valid to dates for the card with the number 4560596484842?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT date_valid_from, date_valid_to FROM Customers_cards WHERE card_number = '4560596484842'"} {"question": "Report the distinct president vote and the vice president vote.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD"} {"question": "Which grade is studying in classroom 103?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT grade FROM list WHERE classroom = 103"} {"question": "Find the number of courses provided in each semester and year.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*), semester, YEAR FROM SECTION GROUP BY semester, YEAR"} {"question": "What document types have more than 2 corresponding documents?\nAdditional table information: table: document_management", "answer": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 2"} {"question": "Which company started the earliest the maintenance contract? Show the company name.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC NULLS FIRST LIMIT 1"} {"question": "What are the names and account balances for customers who have taken a total amount of more than 5000 in loans?\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name, T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING SUM(T2.amount) > 5000"} {"question": "Give the color of the grape whose wine products have the highest average price?\nAdditional table information: table: wine_1", "answer": "SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1"} {"question": "Which advisors are advising more than 2 students?\nAdditional table information: table: voter_2", "answer": "SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2"} {"question": "What is the date when the document 'Marry CV' was stored?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT date_stored FROM All_documents WHERE Document_name = 'Marry CV'"} {"question": "what is the number of different channel owners?\nAdditional table information: table: program_share", "answer": "SELECT COUNT(DISTINCT OWNER) FROM channel"} {"question": "What is the total checking balance in all accounts?\nAdditional table information: table: small_bank_1", "answer": "SELECT SUM(balance) FROM checking"} {"question": "List the personal names and family names of all the students in alphabetical order of family name.\nAdditional table information: table: e_learning", "answer": "SELECT personal_name, family_name FROM Students ORDER BY family_name NULLS FIRST"} {"question": "List all the login names and family names of course author and tutors.\nAdditional table information: table: e_learning", "answer": "SELECT login_name, family_name FROM Course_Authors_and_Tutors"} {"question": "What are the last names of individuals who have been contact individuals for an organization?\nAdditional table information: table: e_government", "answer": "SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id"} {"question": "What are the codes and names for all regions, sorted by codes?\nAdditional table information: table: storm_record", "answer": "SELECT region_code, region_name FROM region ORDER BY region_code NULLS FIRST"} {"question": "Find the average rating star for each movie that received at least 2 ratings.\nAdditional table information: table: movie_1", "answer": "SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2"} {"question": "What is the id of the reviewer whose name includes the word 'Mike'?\nAdditional table information: table: movie_1", "answer": "SELECT rID FROM Reviewer WHERE name LIKE '%Mike%'"} {"question": "What are the dates that have the 5 highest cloud cover rates and what are the rates?\nAdditional table information: table: bike_1", "answer": "SELECT date, cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5"} {"question": "Which district has the largest population?\nAdditional table information: table: store_product", "answer": "SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1"} {"question": "Count the number of departments which offer courses.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT dept_name) FROM course"} {"question": "How many regions do we have?\nAdditional table information: table: party_people", "answer": "SELECT COUNT(*) FROM region"} {"question": "Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')"} {"question": "Which order's shipment tracking number is '3452'? Give me the id of the order.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id FROM shipments WHERE shipment_tracking_number = '3452'"} {"question": "Find the dates on which more than one revisions were made.\nAdditional table information: table: product_catalog", "answer": "SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING COUNT(*) > 1"} {"question": "When did the first staff member start working?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT date_from FROM Project_Staff ORDER BY date_from ASC NULLS FIRST LIMIT 1"} {"question": "What are the employee ids of employees who report to Payam, and what are their salaries?\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam')"} {"question": "How many credits does course CIS-220 have, and what its description?\nAdditional table information: table: college_1", "answer": "SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220'"} {"question": "What is the average room count of the apartments whose booking status code is 'Provisional'?\nAdditional table information: table: apartment_rentals", "answer": "SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Provisional'"} {"question": "What are distinct locations where tracks are located?\nAdditional table information: table: race_track", "answer": "SELECT DISTINCT LOCATION FROM track"} {"question": "How many kinds of roles are there for the staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(DISTINCT role_code) FROM Project_Staff"} {"question": "Who is the youngest male?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male')"} {"question": "What are the forename and surname of the driver who has the smallest laptime?\nAdditional table information: table: formula_1", "answer": "SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds NULLS FIRST LIMIT 1"} {"question": "For each classroom with at least 2 classes, how many classes are offered?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2"} {"question": "Please show the different statuses, ordered by the number of cities that have each.\nAdditional table information: table: farm", "answer": "SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC NULLS FIRST"} {"question": "Show the advisors of the students whose city of residence has city code 'BAL'.\nAdditional table information: table: voter_2", "answer": "SELECT Advisor FROM STUDENT WHERE city_code = 'BAL'"} {"question": "How many document types are there?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM Ref_document_types"} {"question": "Count how many appointments have been made in total.\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*) FROM appointment"} {"question": "What are the names of all the teams in the basketball competition, sorted by all home scores in descending order?\nAdditional table information: table: university_basketball", "answer": "SELECT team_name FROM basketball_match ORDER BY All_Home DESC"} {"question": "List the name and country of origin for all singers who have produced songs with rating above 9.\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9"} {"question": "What are the ids and details for all organizations that have grants of more than 6000 dollars?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T2.organisation_id, T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING SUM(T1.grant_amount) > 6000"} {"question": "Find the names of the companies whose headquarters are not located in 'USA'.\nAdditional table information: table: company_office", "answer": "SELECT name FROM Companies WHERE Headquarters <> 'USA'"} {"question": "What is the name of the oldest student?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student')"} {"question": "What are the names of perpetrators whose country is not 'China'?\nAdditional table information: table: perpetrator", "answer": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> 'China'"} {"question": "What are the total and average enrollment of all schools?\nAdditional table information: table: school_finance", "answer": "SELECT SUM(enrollment), AVG(enrollment) FROM school"} {"question": "What is the description and code of the type of service that is performed the most often?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the full names of all students\nAdditional table information: table: allergy_1", "answer": "SELECT Fname, Lname FROM Student"} {"question": "Show the location with most number of train stations.\nAdditional table information: table: train_station", "answer": "SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names and years released for the movies with the top 3 highest ratings?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3"} {"question": "How many courses that do not have prerequisite?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)"} {"question": "List all ship names in the order of built year and class.\nAdditional table information: table: ship_1", "answer": "SELECT name FROM ship ORDER BY built_year NULLS FIRST, CLASS NULLS FIRST"} {"question": "Show the number of customer cards.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers_cards"} {"question": "What is all the information about the Marketing department?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM departments WHERE department_name = 'Marketing'"} {"question": "Show different builders of railways, along with the corresponding number of railways using each builder.\nAdditional table information: table: railway", "answer": "SELECT Builder, COUNT(*) FROM railway GROUP BY Builder"} {"question": "What is the label that has the most albums?\nAdditional table information: table: music_2", "answer": "SELECT label FROM albums GROUP BY label ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the writers of the books in ascending alphabetical order.\nAdditional table information: table: book_2", "answer": "SELECT Writer FROM book ORDER BY Writer ASC NULLS FIRST"} {"question": "Show the prices of publications whose publisher is either 'Person' or 'Wiley'\nAdditional table information: table: book_2", "answer": "SELECT Price FROM publication WHERE Publisher = 'Person' OR Publisher = 'Wiley'"} {"question": "Which attraction type does the most tourist attractions belong to? Tell me its attraction type description and code.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Attraction_Type_Description, T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the average room count of the apartments that have booking status code 'Provisional'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Provisional'"} {"question": "Please show the industries of companies in descending order of the number of companies.\nAdditional table information: table: company_office", "answer": "SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC"} {"question": "Show all team names.\nAdditional table information: table: match_season", "answer": "SELECT Name FROM Team"} {"question": "What is the name and country of origin of the artist who released a song that has 'love' in its title?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE '%love%'"} {"question": "Find the max and min grade point for all letter grade.\nAdditional table information: table: college_3", "answer": "SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION"} {"question": "What is the list of distinct product names sorted by product id?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT DISTINCT product_name FROM product ORDER BY product_id NULLS FIRST"} {"question": "What are the names of device shops, and what are the carriers that they carry devices in stock for?\nAdditional table information: table: device", "answer": "SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID"} {"question": "What are the first names of all students who took ACCT-211 and received a C?\nAdditional table information: table: college_1", "answer": "SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'"} {"question": "What are the unique block codes that have available rooms?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT blockcode FROM room WHERE unavailable = 0"} {"question": "What is the checking balance of the account whose owner\u2019s name contains the substring \u2018ee\u2019?\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'"} {"question": "which shop has happy hour most frequently? List its id and number of happy hours.\nAdditional table information: table: coffee_shop", "answer": "SELECT shop_id, COUNT(*) FROM happy_hour GROUP BY shop_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many different locations does the school with code BUS has?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_address) FROM department WHERE school_code = 'BUS'"} {"question": "Show first name and id for all customers with at least 2 accounts.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2"} {"question": "How many courses are there in total?\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(*) FROM COURSES"} {"question": "Please show the countries and the number of climbers from each country.\nAdditional table information: table: climbing", "answer": "SELECT Country, COUNT(*) FROM climber GROUP BY Country"} {"question": "Find the id of the item whose title is 'orange'.\nAdditional table information: table: epinions_1", "answer": "SELECT i_id FROM item WHERE title = 'orange'"} {"question": "What is the count of aircrafts that have a distance between 1000 and 5000?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000"} {"question": "What are the different location codes for documents?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT DISTINCT location_code FROM Document_locations"} {"question": "Tell me the name of the staff in charge of the attraction called 'US museum'.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'US museum'"} {"question": "Which type of policy is most frequently used? Give me the policy type code.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many times in total did the team Boston Red Stockings participate in postseason games?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings')"} {"question": "What is the author of the submission with the highest score?\nAdditional table information: table: workshop_paper", "answer": "SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1"} {"question": "Find the claim that has the largest total settlement amount. Return the effective date of the claim.\nAdditional table information: table: insurance_fnol", "answer": "SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1"} {"question": "What are the names of the songs whose rating is below the rating of all songs in English?\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english')"} {"question": "Find the code of city where most of students are living in.\nAdditional table information: table: dorm_1", "answer": "SELECT city_code FROM student GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the ids of all distinct orders ordered by placed date.\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed NULLS FIRST"} {"question": "Return the name of the characteristic that is most common across all products.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all the clubs ordered in descending alphabetical order?\nAdditional table information: table: sports_competition", "answer": "SELECT name FROM club ORDER BY name DESC"} {"question": "What is the last name of the artist who sang the most songs?\nAdditional table information: table: music_2", "answer": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which start station had the most trips starting from August? Give me the name and id of the station.\nAdditional table information: table: bike_1", "answer": "SELECT start_station_name, start_station_id FROM trip WHERE start_date LIKE '8/%' GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the sum of all payment amounts.\nAdditional table information: table: sakila_1", "answer": "SELECT SUM(amount) FROM payment"} {"question": "What are the ids of the students who registered course statistics by order of registration date?\nAdditional table information: table: student_assessment", "answer": "SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'statistics' ORDER BY T2.registration_date NULLS FIRST"} {"question": "What is the type with the fewest games?\nAdditional table information: table: game_1", "answer": "SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "How many distinct teams are involved in match seasons?\nAdditional table information: table: match_season", "answer": "SELECT COUNT(DISTINCT Team) FROM match_season"} {"question": "Show all video game types.\nAdditional table information: table: game_1", "answer": "SELECT DISTINCT gtype FROM Video_games"} {"question": "List the names, color descriptions and product descriptions of products with category 'Herbs'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT T1.product_name, T2.color_description, T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = 'Herbs'"} {"question": "What are the wines that have prices higher than 50 and made of Red color grapes?\nAdditional table information: table: wine_1", "answer": "SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red' AND T2.price > 50"} {"question": "Find the name of instructor who is the advisor of the student who has the highest number of total credits.\nAdditional table information: table: college_2", "answer": "SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1"} {"question": "Find the name and budget of departments whose budgets are more than the average budget.\nAdditional table information: table: college_2", "answer": "SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)"} {"question": "For each country, what is the average elevation of that country's airports?\nAdditional table information: table: flight_4", "answer": "SELECT AVG(elevation), country FROM airports GROUP BY country"} {"question": "Which catalog publisher has published the most catalogs?\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of entrepreneurs and their corresponding investors, ordered descending by the amount of money requested?\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested NULLS FIRST"} {"question": "What are the name and id of the three highest priced rooms?\nAdditional table information: table: inn_1", "answer": "SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3"} {"question": "What is average number of students enrolled in Florida colleges?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(enr) FROM College WHERE state = 'FL'"} {"question": "Find the first name and last name for the 'CTO' of the club 'Hopkins Student Enterprises'?\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises' AND t2.position = 'CTO'"} {"question": "Show all company names with a movie directed in year 1999.\nAdditional table information: table: culture_company", "answer": "SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999"} {"question": "What details do we have on the students who registered for courses most recently?\nAdditional table information: table: student_assessment", "answer": "SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1"} {"question": "How many different statuses do cities have?\nAdditional table information: table: farm", "answer": "SELECT COUNT(DISTINCT Status) FROM city"} {"question": "Count the number of rooms that are not in the Lamberton building.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton'"} {"question": "What is the name of the airport with the most number of routes that start in China?\nAdditional table information: table: flight_4", "answer": "SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the description of transaction type with code 'PUR'.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code = 'PUR'"} {"question": "How many characteristics are there?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM CHARACTERISTICS"} {"question": "List all church names in descending order of opening date.\nAdditional table information: table: wedding", "answer": "SELECT name FROM church ORDER BY open_date DESC"} {"question": "Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco.\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE LOCATION = 'Northridge' AND county = 'Los Angeles' UNION SELECT campus FROM campuses WHERE LOCATION = 'San Francisco' AND county = 'San Francisco'"} {"question": "What are the names of wines whose production year are before the year of all wines by Brander winery?\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = 'Brander')"} {"question": "What is the duration of the oldest actor?\nAdditional table information: table: musical", "answer": "SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1"} {"question": "What is the name of the event that happened in the most recent year?\nAdditional table information: table: swimming", "answer": "SELECT name FROM event ORDER BY YEAR DESC LIMIT 1"} {"question": "What is the average rating of songs produced by female artists?\nAdditional table information: table: music_1", "answer": "SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = 'Female'"} {"question": "What is employee Nancy Edwards's phone number?\nAdditional table information: table: store_1", "answer": "SELECT phone FROM employees WHERE first_name = 'Nancy' AND last_name = 'Edwards'"} {"question": "What is the average fee for a CSU campus in the year of 1996?\nAdditional table information: table: csu_1", "answer": "SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996"} {"question": "What are the countries that contain 3 or more cities?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3"} {"question": "When did customer with first name as Carole and last name as Bernhard became a customer?\nAdditional table information: table: driving_school", "answer": "SELECT date_became_customer FROM Customers WHERE first_name = 'Carole' AND last_name = 'Bernhard'"} {"question": "Find the description of the claim status 'Open'.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name = 'Open'"} {"question": "Return the name of the team and the acc during the regular season for the school that was founded the earliest.\nAdditional table information: table: university_basketball", "answer": "SELECT t2.team_name, t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded NULLS FIRST LIMIT 1"} {"question": "What is the average bike availablility for stations not in Palo Alto?\nAdditional table information: table: bike_1", "answer": "SELECT AVG(bikes_available) FROM status WHERE NOT station_id IN (SELECT id FROM station WHERE city = 'Palo Alto')"} {"question": "How many tracks does each genre have and what are the names of the top 5?\nAdditional table information: table: store_1", "answer": "SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5"} {"question": "What are the main industries of the companies without gas stations and what are the companies?\nAdditional table information: table: gas_company", "answer": "SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company)"} {"question": "List the names of journalists in ascending order of years working.\nAdditional table information: table: news_report", "answer": "SELECT Name FROM journalist ORDER BY Years_working ASC NULLS FIRST"} {"question": "List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.\nAdditional table information: table: school_finance", "answer": "SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested NULLS FIRST, T2.total_budget_percent_budgeted NULLS FIRST"} {"question": "List the name of all the distinct customers who have orders with status 'Packing'.\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Packing'"} {"question": "What are the names of parties with at least 2 events?\nAdditional table information: table: party_people", "answer": "SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2"} {"question": "What is the name of department where has the smallest number of professors?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Which parties have more than 20 hosts? Give me the host names for these parties.\nAdditional table information: table: party_host", "answer": "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"} {"question": "How many pilots are there?\nAdditional table information: table: pilot_record", "answer": "SELECT COUNT(*) FROM pilot"} {"question": "What is the id and first name of all the drivers who participated in the Australian Grand Prix and the Chinese Grand Prix?\nAdditional table information: table: formula_1", "answer": "SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Australian Grand Prix' INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Chinese Grand Prix'"} {"question": "Find the name of organizations whose names contain 'Party'.\nAdditional table information: table: e_government", "answer": "SELECT organization_name FROM organizations WHERE organization_name LIKE '%Party%'"} {"question": "What are the names and prices of products that cost at least 180, sorted by price decreasing and name ascending?\nAdditional table information: table: manufactory_1", "answer": "SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC, name ASC NULLS FIRST"} {"question": "What are the personal names and family names of the students? Sort the result in alphabetical order of the family name.\nAdditional table information: table: e_learning", "answer": "SELECT personal_name, family_name FROM Students ORDER BY family_name NULLS FIRST"} {"question": "Find the name of the dorm with the largest capacity.\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1"} {"question": "What are the different names of mountains ascended by climbers from the country of West Germany?\nAdditional table information: table: climbing", "answer": "SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = 'West Germany'"} {"question": "Find the names of the tourist attractions that is either accessible by bus or at address 254 Ottilie Junction.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '254 Ottilie Junction' OR T2.How_to_Get_There = 'bus'"} {"question": "What are the ids and names of the medicine that can interact with two or more enzymes?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.id, T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2"} {"question": "What is the average rating star for each reviewer?\nAdditional table information: table: movie_1", "answer": "SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name"} {"question": "Count the number of customers recorded.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT COUNT(*) FROM CUSTOMERS"} {"question": "Find the address line 1 and 2 of the customer with email 'vbogisich@example.org'.\nAdditional table information: table: customer_complaints", "answer": "SELECT address_line_1, address_line_2 FROM customers WHERE email_address = 'vbogisich@example.org'"} {"question": "What is the total and maximum duration of trips with bike id 636?\nAdditional table information: table: bike_1", "answer": "SELECT SUM(duration), MAX(duration) FROM trip WHERE bike_id = 636"} {"question": "How many routes go from the United States to Canada?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')"} {"question": "How many faculty do we have?\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Faculty"} {"question": "What is the city_code of the city that the most students live in?\nAdditional table information: table: voter_2", "answer": "SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the distinct payment method codes with the number of orders made\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT payment_method_code, COUNT(*) FROM INVOICES GROUP BY payment_method_code"} {"question": "What is the first name of all employees who do not give any lessons?\nAdditional table information: table: driving_school", "answer": "SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id"} {"question": "How many distinct delegates are from counties with population larger than 50000?\nAdditional table information: table: election", "answer": "SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000"} {"question": "List the names of phones that are not on any market.\nAdditional table information: table: phone_market", "answer": "SELECT Name FROM phone WHERE NOT Phone_id IN (SELECT Phone_ID FROM phone_market)"} {"question": "How many railways are there?\nAdditional table information: table: railway", "answer": "SELECT COUNT(*) FROM railway"} {"question": "How many different roles are there on the project staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(DISTINCT role_code) FROM Project_Staff"} {"question": "Show total points of all players.\nAdditional table information: table: sports_competition", "answer": "SELECT SUM(Points) FROM player"} {"question": "What are the types of vocals used in the song 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'"} {"question": "What are the email addresses of the drama workshop groups with address in Alaska state?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = 'Alaska'"} {"question": "What are the department ids, full names, and salaries for employees who make the most in their departments?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary, department_id, MAX(salary) FROM employees GROUP BY department_id"} {"question": "List the names of all distinct medications, ordered in an alphabetical order.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT name FROM medication ORDER BY name NULLS FIRST"} {"question": "Find the name of tracks which are in both Movies and music playlists.\nAdditional table information: table: store_1", "answer": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'"} {"question": "List the names of phones in ascending order of price.\nAdditional table information: table: phone_market", "answer": "SELECT Name FROM phone ORDER BY Price ASC NULLS FIRST"} {"question": "Find the number of universities that have over a 20000 enrollment size for each affiliation type.\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(*), affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation"} {"question": "Find the names of the workshop groups where services with product name 'film' are performed.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = 'film'"} {"question": "Show all the ranks and the number of male and female faculty for each rank.\nAdditional table information: table: activity_1", "answer": "SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex"} {"question": "Find courses that ran in Fall 2009 or in Spring 2010.\nAdditional table information: table: college_2", "answer": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "Return the official native languages of countries who have players from Maryland or Duke colleges.\nAdditional table information: table: match_season", "answer": "SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = 'Maryland' OR T2.College = 'Duke'"} {"question": "How many classrooms are not in Lamberton?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton'"} {"question": "Show the title and publication dates of books.\nAdditional table information: table: book_2", "answer": "SELECT T1.Title, T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID"} {"question": "Find the department with the most employees.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) DESC LIMIT 1"} {"question": "what are name and phone number of patients who had more than one appointment?\nAdditional table information: table: hospital_1", "answer": "SELECT name, phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING COUNT(*) > 1"} {"question": "Find the name and id of the item with the highest average rating.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rating) DESC LIMIT 1"} {"question": "Return the date of birth for all the guests with gender code 'Male'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT date_of_birth FROM Guests WHERE gender_code = 'Male'"} {"question": "Show all the activity names and the number of faculty involved in each activity.\nAdditional table information: table: activity_1", "answer": "SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID"} {"question": "Show the most common position of players in match seasons.\nAdditional table information: table: match_season", "answer": "SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the department that has the largest number of students enrolled?\nAdditional table information: table: college_1", "answer": "SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the id and name of the employee with maximum salary.\nAdditional table information: table: flight_1", "answer": "SELECT eid, name FROM Employee ORDER BY salary DESC LIMIT 1"} {"question": "Find the average ram mib size of the chip models that are never used by any phone.\nAdditional table information: table: phone_1", "answer": "SELECT AVG(RAM_MiB) FROM chip_model WHERE NOT model_name IN (SELECT chip_model FROM phone)"} {"question": "How many students have advisors?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT s_id) FROM advisor"} {"question": "Find the number of team franchises that are active (have 'Y' as 'active' information).\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM team_franchise WHERE active = 'Y'"} {"question": "What are the names of all clubs?\nAdditional table information: table: club_1", "answer": "SELECT clubname FROM club"} {"question": "Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.\nAdditional table information: table: college_1", "answer": "SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student)"} {"question": "What are the types of competition and number of competitions for that type?\nAdditional table information: table: sports_competition", "answer": "SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type"} {"question": "What are the unique ids of those departments where any manager is managing 4 or more employees.\nAdditional table information: table: hr_1", "answer": "SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4"} {"question": "Find the names of customers who have used either the service 'Close a policy' or the service 'Upgrade a policy'.\nAdditional table information: table: insurance_fnol", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = 'Close a policy' OR t3.service_name = 'Upgrade a policy'"} {"question": "What is the zip code of the customer Carole Bernhard?\nAdditional table information: table: driving_school", "answer": "SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = 'Carole' AND T1.last_name = 'Bernhard'"} {"question": "When did the staff member Janessa Sawayn leave the company?\nAdditional table information: table: driving_school", "answer": "SELECT date_left_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'"} {"question": "Show all publishers and the number of books for each publisher.\nAdditional table information: table: culture_company", "answer": "SELECT publisher, COUNT(*) FROM book_club GROUP BY publisher"} {"question": "What are the first and last names of all customers who lived in Lockmanfurt?\nAdditional table information: table: driving_school", "answer": "SELECT T1.first_name, T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = 'Lockmanfurt'"} {"question": "Show all distinct cities in the address record.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT DISTINCT city FROM addresses"} {"question": "Find the distinct last names of the students who have class president votes.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE"} {"question": "How many times the number of adults and kids staying in a room reached the maximum capacity of the room?\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids"} {"question": "Return the distinct customer details.\nAdditional table information: table: insurance_policies", "answer": "SELECT DISTINCT customer_details FROM Customers"} {"question": "How many party events do we have?\nAdditional table information: table: party_people", "answer": "SELECT COUNT(*) FROM party_events"} {"question": "What are the ids, date opened, name, and other details for all accounts?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT account_id, date_account_opened, account_name, other_account_details FROM Accounts"} {"question": "Which types of policy are chosen by more than 2 customers? Give me the policy type codes.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING COUNT(*) > 2"} {"question": "List the name of ships in ascending order of tonnage.\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship ORDER BY Tonnage ASC NULLS FIRST"} {"question": "How many courses are offered?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT crs_code) FROM CLASS"} {"question": "What are the names of all airports whose elevation is between -50 and 50?\nAdditional table information: table: flight_4", "answer": "SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50"} {"question": "which pilot is in charge of the most number of flights?\nAdditional table information: table: flight_company", "answer": "SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the most common interaction type between enzymes and medicine? And how many are there?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT interaction_type, COUNT(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Give the city that the student whose family name is Kim lives in.\nAdditional table information: table: allergy_1", "answer": "SELECT city_code FROM Student WHERE LName = 'Kim'"} {"question": "Find the name of physicians who are in charge of more than one patient.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING COUNT(*) > 1"} {"question": "What are the names of the tourist attractions that can be accessed by bus?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = 'bus'"} {"question": "Show the name and date for each race and its track name.\nAdditional table information: table: race_track", "answer": "SELECT T1.name, T1.date, T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id"} {"question": "How many distinct names are associated with all the photos?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT COUNT(DISTINCT Name) FROM PHOTOS"} {"question": "Which language does the film AIRPORT POLLOCK use? List the language name.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK'"} {"question": "Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?\nAdditional table information: table: swimming", "answer": "SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000"} {"question": "Return the average transaction amount, as well as the total amount of all transactions.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT AVG(transaction_amount), SUM(transaction_amount) FROM Financial_transactions"} {"question": "What are the resident details containing the substring 'Miss'?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%'"} {"question": "What are the ids of the students who either registered or attended a course?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance"} {"question": "How many classes are held in each department?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code"} {"question": "How many courses are provided in each semester and year?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*), semester, YEAR FROM SECTION GROUP BY semester, YEAR"} {"question": "What were all the salary values of players in 2010 and 2001?\nAdditional table information: table: baseball_1", "answer": "SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001"} {"question": "What is the location name of the document 'Robin CV'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = 'Robin CV'"} {"question": "What is the country in which the customer Carole Bernhard lived?\nAdditional table information: table: driving_school", "answer": "SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = 'Carole' AND T1.last_name = 'Bernhard'"} {"question": "Where is the club 'Pen and Paper Gaming' located?\nAdditional table information: table: club_1", "answer": "SELECT clublocation FROM club WHERE clubname = 'Pen and Paper Gaming'"} {"question": "Return the names of teams that have no match season record.\nAdditional table information: table: match_season", "answer": "SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season)"} {"question": "Show the season, the player, and the name of the country that player belongs to.\nAdditional table information: table: match_season", "answer": "SELECT T2.Season, T2.Player, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country"} {"question": "List the project details of the projects launched by the organisation\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.\nAdditional table information: table: wine_1", "answer": "SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR NULLS FIRST"} {"question": "Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?\nAdditional table information: table: city_record", "answer": "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"} {"question": "What are the companies and investors that correspond to each entrepreneur?\nAdditional table information: table: entrepreneur", "answer": "SELECT Company, Investor FROM entrepreneur"} {"question": "What is the full name of the instructor who has a course named COMPUTER LITERACY?\nAdditional table information: table: college_3", "answer": "SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = 'COMPUTER LITERACY'"} {"question": "What are the origins of all flights that are headed to Honolulu?\nAdditional table information: table: flight_1", "answer": "SELECT origin FROM Flight WHERE destination = 'Honolulu'"} {"question": "How many artists are there?\nAdditional table information: table: music_4", "answer": "SELECT COUNT(*) FROM artist"} {"question": "List the names of the top 5 oldest people.\nAdditional table information: table: gymnast", "answer": "SELECT Name FROM People ORDER BY Age DESC LIMIT 5"} {"question": "Which orders have shipment after 2000-01-01? Give me the order ids.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id FROM shipments WHERE shipment_date > '2000-01-01'"} {"question": "In which distinct years was the governor 'Eliot Spitzer'?\nAdditional table information: table: election", "answer": "SELECT DISTINCT YEAR FROM party WHERE Governor = 'Eliot Spitzer'"} {"question": "Find the number of classes offered for all class rooms that held at least 2 classes.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2"} {"question": "Find the number of students in total.\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list"} {"question": "What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.\nAdditional table information: table: local_govt_mdm", "answer": "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"} {"question": "Show the minimum, maximum, and average age for all people.\nAdditional table information: table: wedding", "answer": "SELECT MIN(age), MAX(age), AVG(age) FROM people"} {"question": "How many gas companies are there?\nAdditional table information: table: gas_company", "answer": "SELECT COUNT(*) FROM company"} {"question": "What is the number of employees that have a salary between 100000 and 200000?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000"} {"question": "Find names of instructors with salary greater than that of some (at least one) instructor in the Biology department.\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE salary > (SELECT MIN(salary) FROM instructor WHERE dept_name = 'Biology')"} {"question": "Show the names of sponsors of players whose residence is either 'Brandon' or 'Birtle'.\nAdditional table information: table: riding_club", "answer": "SELECT Sponsor_name FROM player WHERE Residence = 'Brandon' OR Residence = 'Birtle'"} {"question": "For each customer who has at least two orders, find the customer name and number of orders made.\nAdditional table information: table: tracking_orders", "answer": "SELECT T2.customer_name, COUNT(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) >= 2"} {"question": "Find the cities which were once a host city after 2010?\nAdditional table information: table: city_record", "answer": "SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010"} {"question": "What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?\nAdditional table information: table: formula_1", "answer": "SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year NULLS FIRST"} {"question": "List all the customers in increasing order of IDs.\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_id, customer_name FROM customers ORDER BY customer_id ASC NULLS FIRST"} {"question": "How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total?\nAdditional table information: table: baseball_1", "answer": "SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990"} {"question": "Return the names of musicals who have the nominee Bob Fosse.\nAdditional table information: table: musical", "answer": "SELECT Name FROM musical WHERE Nominee = 'Bob Fosse'"} {"question": "What are the names, checking balances, and savings balances for all customers?\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid"} {"question": "How many distinct FDA approval statuses are there for the medicines?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT COUNT(DISTINCT FDA_approved) FROM medicine"} {"question": "What is the role code with the largest number of employees?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many orders have detail 'Second time'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(*) FROM customer_orders WHERE order_details = 'Second time'"} {"question": "What is minimum age for different job title?\nAdditional table information: table: network_2", "answer": "SELECT MIN(age), job FROM Person GROUP BY job"} {"question": "What is the name and rank of every company ordered by descending number of sales?\nAdditional table information: table: gas_company", "answer": "SELECT company, rank FROM company ORDER BY Sales_billion DESC"} {"question": "Show the most common nationality for journalists.\nAdditional table information: table: news_report", "answer": "SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many students are older than 20 in each dorm?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name"} {"question": "Which problems were reported before the date of any problem reported by the staff Lysanne Turcotte? Give me the ids of the problems.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < (SELECT MIN(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = 'Lysanne' AND T4.staff_last_name = 'Turcotte')"} {"question": "Which students are advised by Michael Goodrich? Give me their first and last names.\nAdditional table information: table: activity_1", "answer": "SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = 'Michael' AND T1.lname = 'Goodrich'"} {"question": "For each submission, find its author and acceptance result.\nAdditional table information: table: workshop_paper", "answer": "SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID"} {"question": "Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT Ref_Shipping_Agents.shipping_agent_name, COUNT(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY COUNT(Documents.document_id) DESC LIMIT 1"} {"question": "Find the names of districts where have both city mall and village store type stores.\nAdditional table information: table: store_product", "answer": "SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = 'City Mall' INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = 'Village Store'"} {"question": "Find the distinct majors of students who have treasurer votes.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote"} {"question": "What are all the phone numbers?\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_phone FROM available_policies"} {"question": "What are the manager's first name, last name and id who won the most manager award?\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_first, T1.name_last, T2.player_id FROM player AS T1 JOIN manager_award AS T2 ON T1.player_id = T2.player_id GROUP BY T2.player_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of products with 'white' as their color description?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = 'white'"} {"question": "Show each apartment type code, and the maximum and minimum number of rooms for each type.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM Apartments GROUP BY apt_type_code"} {"question": "How many total credits are offered by each department?\nAdditional table information: table: college_2", "answer": "SELECT SUM(credits), dept_name FROM course GROUP BY dept_name"} {"question": "Find the count and code of the job has most employees.\nAdditional table information: table: college_1", "answer": "SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the names of all music genres.\nAdditional table information: table: chinook_1", "answer": "SELECT Name FROM GENRE"} {"question": "What is the average price for flights from Los Angeles to Honolulu.\nAdditional table information: table: flight_1", "answer": "SELECT AVG(price) FROM Flight WHERE origin = 'Los Angeles' AND destination = 'Honolulu'"} {"question": "Show the nicknames of schools that are not in division 1.\nAdditional table information: table: school_player", "answer": "SELECT Nickname FROM school_details WHERE Division <> 'Division 1'"} {"question": "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.\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids"} {"question": "How many different levels do members have?\nAdditional table information: table: shop_membership", "answer": "SELECT COUNT(DISTINCT LEVEL) FROM member"} {"question": "Find the claim id and the number of settlements made for the claim with the most recent settlement date.\nAdditional table information: table: insurance_policies", "answer": "SELECT COUNT(*), T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1"} {"question": "What is the first name and age of every student who lives in a dorm with a TV Lounge?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')"} {"question": "Show different colleges along with the number of authors of submission from each college.\nAdditional table information: table: workshop_paper", "answer": "SELECT College, COUNT(*) FROM submission GROUP BY College"} {"question": "What is the name of the product with the highest price?\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1"} {"question": "Find the number of schools that have more than one donator whose donation amount is less than 8.5.\nAdditional table information: table: school_finance", "answer": "SELECT COUNT(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING COUNT(*) > 1)"} {"question": "Return the titles of any movies with an R rating.\nAdditional table information: table: sakila_1", "answer": "SELECT title FROM film WHERE rating = 'R'"} {"question": "Find the name of the nurse who has the largest number of appointments.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the names and decor of rooms that have a king bed. Sort the list by their price.\nAdditional table information: table: inn_1", "answer": "SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice NULLS FIRST"} {"question": "Which campus has the most degrees conferred in all times?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1"} {"question": "Compute the total amount of payment processed.\nAdditional table information: table: insurance_policies", "answer": "SELECT SUM(Amount_Payment) FROM Payments"} {"question": "What are the names of companies whose headquarters are not 'USA'?\nAdditional table information: table: company_office", "answer": "SELECT name FROM Companies WHERE Headquarters <> 'USA'"} {"question": "What is the average amount due for all the payments?\nAdditional table information: table: products_for_hire", "answer": "SELECT AVG(amount_due) FROM payments"} {"question": "Show institution names along with the number of proteins for each institution.\nAdditional table information: table: protein_institute", "answer": "SELECT T1.institution, COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id"} {"question": "What is the last name of every student who is either female or living in a city with the code BAL or male and under 20?\nAdditional table information: table: dorm_1", "answer": "SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20"} {"question": "What are the names of mountains that have a height of over 5000 or a prominence of over 1000?\nAdditional table information: table: climbing", "answer": "SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000"} {"question": "What are the id and zip code of the address with the highest monthly rental?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T2.address_id, T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1"} {"question": "Find the country of origin for the artist who made the least number of songs?\nAdditional table information: table: music_1", "answer": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What is the first name of the student whose last name starts with the letter S and is taking ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%'"} {"question": "Tell me the highest, lowest, and average cost of procedures.\nAdditional table information: table: hospital_1", "answer": "SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures"} {"question": "What are the names and locations of all enzymes listed?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name, LOCATION FROM enzyme"} {"question": "Find the names of all swimmers, sorted by their 100 meter scores in ascending order.\nAdditional table information: table: swimming", "answer": "SELECT name FROM swimmer ORDER BY meter_100 NULLS FIRST"} {"question": "Show the distinct director of films with market estimation in the year of 1995.\nAdditional table information: table: film_rank", "answer": "SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995"} {"question": "What are the students ids of students who have more than one allergy?\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Has_allergy GROUP BY StuID HAVING COUNT(*) >= 2"} {"question": "List document type codes and the number of documents in each code.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code"} {"question": "Return all information about employees with salaries between 8000 and 12000 for which commission is not null or where their department id is not 40.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct <> 'null' OR department_id <> 40"} {"question": "What are the positions of both players that have more than 20 20 points and less than 10 points?\nAdditional table information: table: sports_competition", "answer": "SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10"} {"question": "Find the name of bank branch that provided the greatest total amount of loans.\nAdditional table information: table: loan_1", "answer": "SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY SUM(T2.amount) DESC LIMIT 1"} {"question": "Return the famous release date for the oldest artist.\nAdditional table information: table: music_4", "answer": "SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1"} {"question": "Show the years, book titles, and publishers for all books, in descending order by year.\nAdditional table information: table: culture_company", "answer": "SELECT YEAR, book_title, publisher FROM book_club ORDER BY YEAR DESC"} {"question": "Show the names of customers who use Credit Card payment method and have more than 2 orders.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING COUNT(*) > 2"} {"question": "Find the number of companies whose industry is 'Banking' or 'Conglomerate',\nAdditional table information: table: company_office", "answer": "SELECT COUNT(*) FROM Companies WHERE Industry = 'Banking' OR Industry = 'Conglomerate'"} {"question": "How many employees do we have?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM Employees"} {"question": "What is the name of the department with the fewest professors?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What are the durations of the longest and the shortest tracks in milliseconds?\nAdditional table information: table: chinook_1", "answer": "SELECT MAX(Milliseconds), MIN(Milliseconds) FROM TRACK"} {"question": "How many tests have result 'Fail'?\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(*) FROM Student_Tests_Taken WHERE test_result = 'Fail'"} {"question": "Find Alice's friends of friends.\nAdditional table information: table: network_2", "answer": "SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice'"} {"question": "Find the name of customers who have loans of both Mortgages and Auto.\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'"} {"question": "List the name of playlist which has number of tracks greater than 100.\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING COUNT(T1.track_id) > 100"} {"question": "Which catalog publishers have substring 'Murray' in their names?\nAdditional table information: table: product_catalog", "answer": "SELECT DISTINCT (catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE '%Murray%'"} {"question": "For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title.\nAdditional table information: table: movie_1", "answer": "SELECT T1.title, T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY T1.director NULLS FIRST, T1.title NULLS FIRST"} {"question": "List the name of technicians whose team is not 'NYY'.\nAdditional table information: table: machine_repair", "answer": "SELECT Name FROM technician WHERE Team <> 'NYY'"} {"question": "List the enrollment for each school that does not have 'Catholic' as denomination.\nAdditional table information: table: school_player", "answer": "SELECT Enrollment FROM school WHERE Denomination <> 'Catholic'"} {"question": "What are the ids of all students who have attended at least one course?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_attendance"} {"question": "Show ids of students who don't play video game.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games"} {"question": "Show the number of transaction types.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(DISTINCT transaction_type) FROM Financial_Transactions"} {"question": "Show the total number of rooms of the apartments in the building with short name 'Columbus Square'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT SUM(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = 'Columbus Square'"} {"question": "what is the address of history department?\nAdditional table information: table: college_1", "answer": "SELECT dept_address FROM department WHERE dept_name = 'History'"} {"question": "Count the total number of settlements made.\nAdditional table information: table: insurance_policies", "answer": "SELECT COUNT(*) FROM Settlements"} {"question": "Find all the name of documents without any sections.\nAdditional table information: table: document_management", "answer": "SELECT document_name FROM documents WHERE NOT document_code IN (SELECT document_code FROM document_sections)"} {"question": "Return the full names and salaries for employees with first names that end with the letter m.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary FROM employees WHERE first_name LIKE '%m'"} {"question": "What are the staff roles of the staff who\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18'"} {"question": "What are the distinct first names of the students who have vice president votes and reside in a city whose city code is not PIT?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = 'PIT'"} {"question": "What are the titles of all albums that start with A in alphabetical order?\nAdditional table information: table: store_1", "answer": "SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title NULLS FIRST"} {"question": "What are the different membership levels?\nAdditional table information: table: shop_membership", "answer": "SELECT COUNT(DISTINCT LEVEL) FROM member"} {"question": "What campus has the most faculties in 2003?\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1"} {"question": "How many different colleges do attend the tryout test?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(DISTINCT cName) FROM tryout"} {"question": "What are the names of products that have never been ordered?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id"} {"question": "What are all of the products whose name includes the substring 'Scanner'?\nAdditional table information: table: store_product", "answer": "SELECT product FROM product WHERE product LIKE '%Scanner%'"} {"question": "List the votes of elections in descending order.\nAdditional table information: table: election_representative", "answer": "SELECT Votes FROM election ORDER BY Votes DESC"} {"question": "Find the name of the swimmer who has the most records.\nAdditional table information: table: swimming", "answer": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names and location of the wrestlers?\nAdditional table information: table: wrestler", "answer": "SELECT Name, LOCATION FROM wrestler"} {"question": "Find the name and ID of the product whose total order quantity is the largest.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) NULLS FIRST LIMIT 1"} {"question": "List all the name of organizations in order of the date formed.\nAdditional table information: table: e_government", "answer": "SELECT organization_name FROM organizations ORDER BY date_formed ASC NULLS FIRST"} {"question": "How many manufacturers have headquarters in either Tokyo or Beijing?\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'"} {"question": "What are the ids of all employees that don't have certificates?\nAdditional table information: table: flight_1", "answer": "SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate"} {"question": "what is the name and age of the youngest winning pilot?\nAdditional table information: table: aircraft", "answer": "SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age NULLS FIRST LIMIT 1"} {"question": "Find all the male members of club 'Hopkins Student Enterprises'. Show the first name and last name.\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises' AND t3.sex = 'M'"} {"question": "How many products are there for each manufacturer?\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(*), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name"} {"question": "Find the number of professors with a Ph.D. degree in each department.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code"} {"question": "Show the names of pilots and the number of records they have.\nAdditional table information: table: pilot_record", "answer": "SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name"} {"question": "Which rank is the most common among captains?\nAdditional table information: table: ship_1", "answer": "SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of gymnasts, ordered by their heights ascending?\nAdditional table information: table: gymnast", "answer": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC NULLS FIRST"} {"question": "Show the order ids and the number of invoices for each order.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id"} {"question": "On average, how old are the members in the club 'Hopkins Student Enterprises'?\nAdditional table information: table: club_1", "answer": "SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises'"} {"question": "What is the average fastest lap speed for races held after 2004, for each race, ordered by year?\nAdditional table information: table: formula_1", "answer": "SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year NULLS FIRST"} {"question": "What is the most popular file format?\nAdditional table information: table: music_1", "answer": "SELECT formats FROM files GROUP BY formats ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the reviewer id of Daniel Lewis?\nAdditional table information: table: movie_1", "answer": "SELECT rID FROM Reviewer WHERE name = 'Daniel Lewis'"} {"question": "What are the names and arrival times of trains?\nAdditional table information: table: railway", "answer": "SELECT Name, Arrival FROM train"} {"question": "Give me the name of each club.\nAdditional table information: table: club_1", "answer": "SELECT clubname FROM club"} {"question": "Find the names of the clubs that have at least a member from the city with city code 'HOU'.\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = 'HOU'"} {"question": "Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'"} {"question": "For each advisor, report the total number of students advised by him or her.\nAdditional table information: table: voter_2", "answer": "SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor"} {"question": "What is the location of the bridge named 'Kolob Arch' or 'Rainbow Bridge'?\nAdditional table information: table: architecture", "answer": "SELECT LOCATION FROM bridge WHERE name = 'Kolob Arch' OR name = 'Rainbow Bridge'"} {"question": "Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.\nAdditional table information: table: browser_web", "answer": "SELECT name, operating_system FROM web_client_accelerator EXCEPT SELECT T1.name, T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'"} {"question": "What are the minimum, average, and maximum quantities ordered? Check all the invoices.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES"} {"question": "Find the number of records of each policy type and its type code.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT policy_type_code, COUNT(*) FROM policies GROUP BY policy_type_code"} {"question": "List all manufacturer names and ids ordered by their opening year.\nAdditional table information: table: manufacturer", "answer": "SELECT name, manufacturer_id FROM manufacturer ORDER BY open_year NULLS FIRST"} {"question": "What is average enrollment of colleges in the state FL?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(enr) FROM College WHERE state = 'FL'"} {"question": "What is the total number of airlines?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airlines"} {"question": "Find the number of departments in each school.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code"} {"question": "Show all product names and the total quantity ordered for each product name.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.product_name, SUM(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name"} {"question": "For each project id, how many staff does it have? List them in increasing order.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) ASC NULLS FIRST"} {"question": "What are the details and star ratings of the three hotels with the lowest price ranges?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT other_hotel_details, star_rating_code FROM HOTELS ORDER BY price_range ASC NULLS FIRST LIMIT 3"} {"question": "What are the campuses that opened in 1958?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE YEAR = 1958"} {"question": "What are the ids of all moviest hat have not been reviewed by Britanny Harris?\nAdditional table information: table: movie_1", "answer": "SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = 'Brittany Harris'"} {"question": "What are the account details with the largest value or with value having char '5' in it?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE '%5%'"} {"question": "Which state can address '6862 Kaitlyn Knolls' possibly be in?\nAdditional table information: table: e_government", "answer": "SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE '%6862 Kaitlyn Knolls%'"} {"question": "How many employees have certificate.\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(DISTINCT eid) FROM Certificate"} {"question": "Which customers have used both the service named 'Close a policy' and the service named 'Upgrade a policy'? Give me the customer names.\nAdditional table information: table: insurance_fnol", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = 'Close a policy' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = 'New policy application'"} {"question": "How many students are in each department?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), dept_code FROM student GROUP BY dept_code"} {"question": "Find the names of all modern rooms with a base price below $160 and two beds.\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern'"} {"question": "What is the average total number of passengers for all airports that the aircraft 'Robinson R-22' visits?\nAdditional table information: table: aircraft", "answer": "SELECT AVG(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = 'Robinson R-22'"} {"question": "What are all the distinct asset models?\nAdditional table information: table: assets_maintenance", "answer": "SELECT DISTINCT asset_model FROM Assets"} {"question": "What are the employee ids for those who had two or more jobs.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2"} {"question": "What is the total number of games played?\nAdditional table information: table: game_1", "answer": "SELECT SUM(gamesplayed) FROM Sportsinfo"} {"question": "What are the names of the cameras that have taken picture of the most mountains?\nAdditional table information: table: mountain_photos", "answer": "SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names of reviewers who had given higher than 3 star ratings.\nAdditional table information: table: movie_1", "answer": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3"} {"question": "What are the names of modern rooms that have a base price lower than $160 and two beds.\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern'"} {"question": "What are the names of the songs by the artist whose last name is 'Heilo'?\nAdditional table information: table: music_2", "answer": "SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = 'Heilo'"} {"question": "Which kind of policy type was chosen by the most customers?\nAdditional table information: table: insurance_policies", "answer": "SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which colleges have both authors with submission score above 90 and authors with submission score below 80?\nAdditional table information: table: workshop_paper", "answer": "SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80"} {"question": "What are the names of customers who have purchased both products Latte and Americano?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Americano'"} {"question": "What are the names of artist whose exhibitions draw over 200 attendees on average?\nAdditional table information: table: theme_gallery", "answer": "SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING AVG(T1.attendance) > 200"} {"question": "Sort the names of all counties in ascending order of population.\nAdditional table information: table: election", "answer": "SELECT County_name FROM county ORDER BY Population ASC NULLS FIRST"} {"question": "Find all the songs whose name contains the word 'the'.\nAdditional table information: table: music_2", "answer": "SELECT title FROM songs WHERE title LIKE '% the %'"} {"question": "Show the race class and number of races in each class.\nAdditional table information: table: race_track", "answer": "SELECT CLASS, COUNT(*) FROM race GROUP BY CLASS"} {"question": "Find the states where have some college students in tryout and their decisions are yes.\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'"} {"question": "What is the customer id, first and last name with least number of accounts.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Show the name for regions and the number of storms for each region.\nAdditional table information: table: storm_record", "answer": "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"} {"question": "For each start station id, what is its name, longitude and average duration of trips started there?\nAdditional table information: table: bike_1", "answer": "SELECT T1.name, T1.long, AVG(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id"} {"question": "Find the number of patients who are not using the medication of Procrastin-X.\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*) FROM patient WHERE NOT SSN IN (SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X')"} {"question": "What are the names of the artists that are from the UK and sang songs in English?\nAdditional table information: table: music_1", "answer": "SELECT artist_name FROM artist WHERE country = 'UK' INTERSECT SELECT artist_name FROM song WHERE languages = 'english'"} {"question": "What are the names of schools with the top 3 largest size?\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM college ORDER BY enr DESC LIMIT 3"} {"question": "Show the flight number of flights with three lowest distances.\nAdditional table information: table: flight_1", "answer": "SELECT flno FROM Flight ORDER BY distance ASC NULLS FIRST LIMIT 3"} {"question": "What are the details and id of the project with the most outcomes?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the venues of all the matches? Sort them in the descending order of match date.\nAdditional table information: table: city_record", "answer": "SELECT venue FROM MATCH ORDER BY date DESC"} {"question": "Which event names were used more than twice for party events?\nAdditional table information: table: party_people", "answer": "SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2"} {"question": "What is the name of the project that has a scientist assigned to it whose name contains 'Smith'?\nAdditional table information: table: scientist_1", "answer": "SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%'"} {"question": "Find the id and rank of the team that has the highest average attendance rate in 2014.\nAdditional table information: table: baseball_1", "answer": "SELECT T2.team_id, T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY AVG(T1.attendance) DESC LIMIT 1"} {"question": "Name the background colour for the Australian Capital Territory. \nAdditional table information: table: regional_marketing\ncolumns: state_territory, text_bg_color, format, current_slogan, current_series, Notes", "answer": "SELECT text_bg_color FROM \"regional_marketing\" WHERE State/territory = 'Australian Capital Territory'"} {"question": "Which program was launched most recently? Return the program name.\nAdditional table information: table: program_share", "answer": "SELECT name FROM program ORDER BY launch DESC LIMIT 1"} {"question": "What are the first names and offices of history professors who don't have Ph.D.s?\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.'"} {"question": "Which attribute definitions have attribute value 0? Give me the attribute name and attribute ID.\nAdditional table information: table: product_catalog", "answer": "SELECT t1.attribute_name, t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0"} {"question": "Find the country of the airlines whose name starts with 'Orbit'.\nAdditional table information: table: flight_4", "answer": "SELECT country FROM airlines WHERE name LIKE 'Orbit%'"} {"question": "Find the prices of products which has never received a single complaint.\nAdditional table information: table: customer_complaints", "answer": "SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints)"} {"question": "find the total market rate of the furnitures that have the top 2 market shares.\nAdditional table information: table: manufacturer", "answer": "SELECT SUM(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2"} {"question": "What is the average number of attendance at home games for each year?\nAdditional table information: table: baseball_1", "answer": "SELECT YEAR, AVG(attendance) FROM home_game GROUP BY YEAR"} {"question": "What is the total account balance for customers with a credit score of above 100 for the different states?\nAdditional table information: table: loan_1", "answer": "SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state"} {"question": "What are the names of artist who have the letter 'a' in their names?\nAdditional table information: table: chinook_1", "answer": "SELECT Name FROM ARTIST WHERE Name LIKE '%a%'"} {"question": "What are the song names for every song whose rating is less than the minimum rating for English songs?\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english')"} {"question": "Show the names of editors that are on the committee of journals with sales bigger than 3000.\nAdditional table information: table: journal_committee", "answer": "SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000"} {"question": "How many customers use each payment method?\nAdditional table information: table: department_store", "answer": "SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code"} {"question": "Find the address of the location named 'UK Gallery'.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Address FROM LOCATIONS WHERE Location_Name = 'UK Gallery'"} {"question": "Find the average credit score of the customers who do not have any loan.\nAdditional table information: table: loan_1", "answer": "SELECT AVG(credit_score) FROM customer WHERE NOT cust_id IN (SELECT cust_id FROM loan)"} {"question": "Give the budget type code that is most common among documents with expenses.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are id and name of the products whose price is lower than 600 or higher than 900?\nAdditional table information: table: department_store", "answer": "SELECT product_id, product_name FROM products WHERE product_price < 600 OR product_price > 900"} {"question": "What are the first name, last name and id of the player with the most all star game experiences? Also list the count.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_first, T1.name_last, T1.player_id, COUNT(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which activity has the most faculty members participating in? Find the activity name.\nAdditional table information: table: activity_1", "answer": "SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the famous titles of the artist 'Triumfall'?\nAdditional table information: table: music_4", "answer": "SELECT Famous_Title FROM artist WHERE Artist = 'Triumfall'"} {"question": "What are the names of studios that have made two or more films?\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2"} {"question": "Count the number of accounts.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Accounts"} {"question": "What are the maximum and minimum budget of the departments?\nAdditional table information: table: department_management", "answer": "SELECT MAX(budget_in_billions), MIN(budget_in_billions) FROM department"} {"question": "Return the average age across all gymnasts.\nAdditional table information: table: gymnast", "answer": "SELECT AVG(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID"} {"question": "What are the states of the colleges where students who tried out for the striker position attend?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'"} {"question": "For each race name, What is the maximum fastest lap speed for races after 2004 ordered by year?\nAdditional table information: table: formula_1", "answer": "SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year NULLS FIRST"} {"question": "Show distinct types of artworks that are nominated in festivals in 2007.\nAdditional table information: table: entertainment_awards", "answer": "SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007"} {"question": "Compute the average number of hosts for parties.\nAdditional table information: table: party_host", "answer": "SELECT AVG(Number_of_hosts) FROM party"} {"question": "How many aircrafts are there?\nAdditional table information: table: aircraft", "answer": "SELECT COUNT(*) FROM aircraft"} {"question": "Find the parties associated with the delegates from district 1 or 2. Who served as comptrollers of the parties?\nAdditional table information: table: election", "answer": "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"} {"question": "Count the number of students the teacher LORIA ONDERSMA teaches.\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'LORIA' AND T2.lastname = 'ONDERSMA'"} {"question": "Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.\nAdditional table information: table: sakila_1", "answer": "SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200"} {"question": "List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes.\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'"} {"question": "What are the maximum and minimum resolution of songs whose duration is 3 minutes?\nAdditional table information: table: music_1", "answer": "SELECT MAX(T2.resolution), MIN(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE '3:%'"} {"question": "How many book clubs are there?\nAdditional table information: table: culture_company", "answer": "SELECT COUNT(*) FROM book_club"} {"question": "What is the average money requested by all entrepreneurs?\nAdditional table information: table: entrepreneur", "answer": "SELECT AVG(Money_Requested) FROM entrepreneur"} {"question": "Find the busiest destination airport that runs most number of routes in China.\nAdditional table information: table: flight_4", "answer": "SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many distinct courses are enrolled in by students?\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(course_id) FROM Student_Course_Enrolment"} {"question": "Find the capacity and gender type of the dorm whose name has substring \u2018Donor\u2019.\nAdditional table information: table: dorm_1", "answer": "SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'"} {"question": "Show the names of artworks in ascending order of the year they are nominated in.\nAdditional table information: table: entertainment_awards", "answer": "SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year NULLS FIRST"} {"question": "How many people have membership in the club 'Pen and Paper Gaming'?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Pen and Paper Gaming'"} {"question": "What is the last name of the professor whose office is located in DRE 102, and when were they hired?\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'"} {"question": "List all company names with a book published by Alyson.\nAdditional table information: table: culture_company", "answer": "SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson'"} {"question": "What are the names of all tracks that are on the Movies playlist but not in the music playlist?\nAdditional table information: table: store_1", "answer": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'"} {"question": "How many artists are above age 46 and joined after 1990?\nAdditional table information: table: theme_gallery", "answer": "SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990"} {"question": "what are the average and maximum attendances of all events?\nAdditional table information: table: news_report", "answer": "SELECT AVG(Event_Attendance), MAX(Event_Attendance) FROM event"} {"question": "Find the name and population of district with population between 200000 and 2000000\nAdditional table information: table: store_product", "answer": "SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000"} {"question": "Who are the different players and how many years has each played?\nAdditional table information: table: match_season", "answer": "SELECT Player, Years_Played FROM player"} {"question": "Which staff handled least number of payments? List the full name and the id.\nAdditional table information: table: sakila_1", "answer": "SELECT T1.first_name, T1.last_name, T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What is the total number of routes for each country and airline in that country?\nAdditional table information: table: flight_4", "answer": "SELECT T1.country, T1.name, COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name"} {"question": "Find the name of the user who gives the most reviews.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the product type codes which have at least two products.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT product_type_code FROM products GROUP BY product_type_code HAVING COUNT(*) >= 2"} {"question": "What are the different names, locations, and products of the enzymes that are capable inhibitor interactions?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'"} {"question": "What are the names and distances for all airplanes?\nAdditional table information: table: flight_1", "answer": "SELECT name, distance FROM Aircraft"} {"question": "find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.\nAdditional table information: table: gas_company", "answer": "SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3"} {"question": "Find the ids of the departments where any manager is managing 4 or more employees.\nAdditional table information: table: hr_1", "answer": "SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4"} {"question": "What is the city with the smallest GDP? Return the city and its GDP.\nAdditional table information: table: city_record", "answer": "SELECT city, GDP FROM city ORDER BY GDP NULLS FIRST LIMIT 1"} {"question": "Return the name, rate, check in and check out date for the room with the highest rate.\nAdditional table information: table: inn_1", "answer": "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"} {"question": "Give me the minimum and maximum bathroom count among all the apartments.\nAdditional table information: table: apartment_rentals", "answer": "SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments"} {"question": "What are the ids of all female students who play football?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = 'Football'"} {"question": "How many hours do the players train on average?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(HS) FROM Player"} {"question": "What are the names of customers who have not taken a Mortage loan?\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages'"} {"question": "Find the names of the top 10 airlines that operate the most number of routes.\nAdditional table information: table: flight_4", "answer": "SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10"} {"question": "What is the number of states that has some college whose enrollment is larger than the average enrollment?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(DISTINCT state) FROM college WHERE enr > (SELECT AVG(enr) FROM college)"} {"question": "Show the names of members that have a rank in round higher than 3.\nAdditional table information: table: decoration_competition", "answer": "SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3"} {"question": "What are the ids of documents with letter 's' in the name with any expense budgets.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%'"} {"question": "Count the number of people of each sex who have a weight higher than 85.\nAdditional table information: table: candidate_poll", "answer": "SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex"} {"question": "Find the purchase time, age and address of each member, and show the results in the order of purchase time.\nAdditional table information: table: coffee_shop", "answer": "SELECT Time_of_purchase, age, address FROM member ORDER BY Time_of_purchase NULLS FIRST"} {"question": "What are the names of all games played by Linda Smith?\nAdditional table information: table: game_1", "answer": "SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = 'Smith' AND T3.Fname = 'Linda'"} {"question": "What are the first names of all the different drivers in alphabetical order?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT forename FROM drivers ORDER BY forename ASC NULLS FIRST"} {"question": "Find the number of different departments in each school whose number of different departments is less than 5.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code HAVING COUNT(DISTINCT dept_name) < 5"} {"question": "What is the song with the most vocals?\nAdditional table information: table: music_2", "answer": "SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the id of the candidate who most recently accessed the course?\nAdditional table information: table: student_assessment", "answer": "SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1"} {"question": "What is the maximum point for climbers whose country is United Kingdom?\nAdditional table information: table: climbing", "answer": "SELECT MAX(Points) FROM climber WHERE Country = 'United Kingdom'"} {"question": "What are the names of the directors who made exactly one movie excluding director NULL?\nAdditional table information: table: movie_1", "answer": "SELECT director FROM Movie WHERE director <> 'null' GROUP BY director HAVING COUNT(*) = 1"} {"question": "Which organisation hired the most number of research staff? List the organisation id, type and detail.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.\nAdditional table information: table: body_builder", "answer": "SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200"} {"question": "Return the type of transaction with the highest total amount.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC LIMIT 1"} {"question": "Count the total number of games the team Boston Red Stockings attended from 1990 to 2000.\nAdditional table information: table: baseball_1", "answer": "SELECT SUM(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000"} {"question": "Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700"} {"question": "Return the minimum, average and maximum distances traveled across all aircrafts.\nAdditional table information: table: flight_1", "answer": "SELECT MIN(distance), AVG(distance), MAX(distance) FROM Aircraft"} {"question": "What are the names of all students taking a course who received an A or C?\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'"} {"question": "Show the ids of the employees who don't authorize destruction for any document.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "Show all party names and the number of members in each party.\nAdditional table information: table: party_people", "answer": "SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id"} {"question": "From the trip record, find the number of unique bikes.\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(DISTINCT bike_id) FROM trip"} {"question": "Which employees have either destroyed a document or made an authorization to do so? Return their employee ids.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "Find the order detail for the products with price above 2000.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000"} {"question": "What is the average rating for each movie that has never been reviewed by Brittany Harris?\nAdditional table information: table: movie_1", "answer": "SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = 'Brittany Harris') GROUP BY mID"} {"question": "What are the total scores of the body builders whose birthday contains the string 'January' ?\nAdditional table information: table: body_builder", "answer": "SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE '%January%'"} {"question": "Find the distinct ages of students who have secretary votes in the fall election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = 'Fall'"} {"question": "Return the average money requested across all entrepreneurs.\nAdditional table information: table: entrepreneur", "answer": "SELECT AVG(Money_Requested) FROM entrepreneur"} {"question": "How many artworks are there?\nAdditional table information: table: entertainment_awards", "answer": "SELECT COUNT(*) FROM artwork"} {"question": "Which university is in Los Angeles county and opened after 1950?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE county = 'Los Angeles' AND YEAR > 1950"} {"question": "In which city do the most employees live and how many of them live there?\nAdditional table information: table: driving_school", "answer": "SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Please show each industry and the corresponding number of companies in that industry.\nAdditional table information: table: company_office", "answer": "SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry"} {"question": "What is the name of the language that the film 'AIRPORT POLLOCK' is in?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK'"} {"question": "Find the name of physicians whose position title contains the word 'senior'.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM physician WHERE POSITION LIKE '%senior%'"} {"question": "What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name, T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'No Response'"} {"question": "Find the numbers of different majors and cities.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student"} {"question": "On what dates were employees without the letter M in their first names hired?\nAdditional table information: table: hr_1", "answer": "SELECT hire_date FROM employees WHERE NOT first_name LIKE '%M%'"} {"question": "Show institution types, along with the number of institutions and total enrollment for each type.\nAdditional table information: table: protein_institute", "answer": "SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE"} {"question": "Return the city with the customer type code 'Good Credit Rating' that had the fewest customers.\nAdditional table information: table: customer_complaints", "answer": "SELECT town_city FROM customers WHERE customer_type_code = 'Good Credit Rating' GROUP BY town_city ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Please show the most common reigns of wrestlers.\nAdditional table information: table: wrestler", "answer": "SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type.\nAdditional table information: table: university_basketball", "answer": "SELECT SUM(Enrollment), affiliation FROM university WHERE founded > 1850 GROUP BY affiliation"} {"question": "How many lessons taught by staff whose first name has letter 'a' in it?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE '%a%'"} {"question": "Return the login names of the students whose family name is 'Ward'.\nAdditional table information: table: e_learning", "answer": "SELECT login_name FROM Students WHERE family_name = 'Ward'"} {"question": "What is the name and sex of the candidate with the highest support rate?\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1"} {"question": "What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party'"} {"question": "Which policy type appears most frequently in the available policies?\nAdditional table information: table: insurance_fnol", "answer": "SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the names of members who did not participate in any round.\nAdditional table information: table: decoration_competition", "answer": "SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM round)"} {"question": "Show the maximum amount of transaction.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT MAX(amount_of_transaction) FROM TRANSACTIONS"} {"question": "What are the first and last names of all customers with more than 2 payments?\nAdditional table information: table: driving_school", "answer": "SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2"} {"question": "Show storm name with at least two regions and 10 cities affected.\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Find number of tracks in each genre?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*), T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name"} {"question": "What are the full names of customers who do not have any accounts?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_first_name, customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id"} {"question": "What place has the most flights coming from there?\nAdditional table information: table: flight_1", "answer": "SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the name of students who didn't take any course from Biology department.\nAdditional table information: table: college_2", "answer": "SELECT name FROM student WHERE NOT id IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')"} {"question": "What is the id of the department with the least number of staff?\nAdditional table information: table: department_store", "answer": "SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "For each grant id, how many documents does it have, and which one has the most?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.\nAdditional table information: table: hr_1", "answer": "SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000"} {"question": "What are the maximum and minimum population of the counties?\nAdditional table information: table: election", "answer": "SELECT MAX(Population), MIN(Population) FROM county"} {"question": "What are the times of elimination for wrestlers with over 50 days held?\nAdditional table information: table: wrestler", "answer": "SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50"} {"question": "What are the names for all aircrafts with at least 2 flights?\nAdditional table information: table: flight_1", "answer": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2"} {"question": "What is the name of the tourist attraction that is associated with the photo 'game1'?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = 'game1'"} {"question": "Find the rooms of faculties with rank professor who live in building NEB.\nAdditional table information: table: college_3", "answer": "SELECT Room FROM FACULTY WHERE Rank = 'Professor' AND Building = 'NEB'"} {"question": "Find the number of different states which banks are located at.\nAdditional table information: table: loan_1", "answer": "SELECT COUNT(DISTINCT state) FROM bank"} {"question": "Which claim processing stage has the most claims? Show the claim status name.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the number of players who have points less than 30 for each position?\nAdditional table information: table: sports_competition", "answer": "SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION"} {"question": "Find all the papers published by the institution 'Google'.\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'Google'"} {"question": "Find the first name of student who is taking classes from accounting and Computer Info. Systems departments\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'"} {"question": "Find the first names of faculties of rank Professor in alphabetic order.\nAdditional table information: table: college_3", "answer": "SELECT Fname FROM FACULTY WHERE Rank = 'Professor' ORDER BY Fname NULLS FIRST"} {"question": "what are the names of the channels that broadcast in both morning and night?\nAdditional table information: table: program_share", "answer": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night'"} {"question": "Tell me the employee id of the head of the department with the least employees.\nAdditional table information: table: hospital_1", "answer": "SELECT head FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) NULLS FIRST LIMIT 1"} {"question": "Return the structure description of the document that has been accessed the fewest number of times.\nAdditional table information: table: document_management", "answer": "SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the document type code for the document with the id 2.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_type_code FROM Documents WHERE document_id = 2"} {"question": "Find the list of cities that no customer is living in.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id)"} {"question": "Who are the ministers, when did they take office, and when did they leave office, ordered by when they left office?\nAdditional table information: table: party_people", "answer": "SELECT minister, took_office, left_office FROM party ORDER BY left_office NULLS FIRST"} {"question": "Which physicians are affiliated with both Surgery and Psychiatry departments? Tell me their names.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Psychiatry'"} {"question": "What is all the information regarding employees who are managers?\nAdditional table information: table: hr_1", "answer": "SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id"} {"question": "What are the descriptions for the aircrafts?\nAdditional table information: table: aircraft", "answer": "SELECT Description FROM aircraft"} {"question": "List all the salary values players received in 2010 and 2001.\nAdditional table information: table: baseball_1", "answer": "SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001"} {"question": "What is the zip code the county named 'Howard' is located in?\nAdditional table information: table: election", "answer": "SELECT Zip_code FROM county WHERE County_name = 'Howard'"} {"question": "Find each target user's name and average trust score.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id"} {"question": "How many members are not living in Hartford?\nAdditional table information: table: coffee_shop", "answer": "SELECT COUNT(*) FROM member WHERE address <> 'Hartford'"} {"question": "How many departments does the college has?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_name) FROM department"} {"question": "What are the distinct president votes on 08/30/2015?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = '08/30/2015'"} {"question": "find the name of the program that was launched most recently.\nAdditional table information: table: program_share", "answer": "SELECT name FROM program ORDER BY launch DESC LIMIT 1"} {"question": "Which advisor has most number of students?\nAdditional table information: table: allergy_1", "answer": "SELECT advisor FROM Student GROUP BY advisor ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the average height and weight for all males (sex is M).\nAdditional table information: table: candidate_poll", "answer": "SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M'"} {"question": "List the names of players that do not have coaches.\nAdditional table information: table: riding_club", "answer": "SELECT Player_name FROM player WHERE NOT Player_ID IN (SELECT Player_ID FROM player_coach)"} {"question": "Show order ids and the total quantity in each order.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT order_id, SUM(product_quantity) FROM Order_items GROUP BY order_id"} {"question": "Which teachers teach the student named EVELINA BROMLEY? Give me the first and last name of the teachers.\nAdditional table information: table: student_1", "answer": "SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'EVELINA' AND T1.lastname = 'BROMLEY'"} {"question": "How many campuses exist are in the county of LA?\nAdditional table information: table: csu_1", "answer": "SELECT COUNT(*) FROM campuses WHERE county = 'Los Angeles'"} {"question": "What are the descriptions of the courses with name 'database'?\nAdditional table information: table: e_learning", "answer": "SELECT course_description FROM COURSES WHERE course_name = 'database'"} {"question": "What are the login names of the students with family name 'Ward'?\nAdditional table information: table: e_learning", "answer": "SELECT login_name FROM Students WHERE family_name = 'Ward'"} {"question": "Which project made the most number of outcomes? List the project details and the project id.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20"} {"question": "Find the name of accounts whose checking balance is higher than corresponding saving balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance"} {"question": "What are the languages that are used most often in songs?\nAdditional table information: table: music_1", "answer": "SELECT languages FROM song GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the first name of students enrolled in class ACCT-211 and got grade C?\nAdditional table information: table: college_1", "answer": "SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'"} {"question": "Return the themes, dates, and attendance for exhibitions that happened in 2004.\nAdditional table information: table: theme_gallery", "answer": "SELECT T2.theme, T1.date, T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T2.year = 2004"} {"question": "Find the patient who has the most recent undergoing treatment?\nAdditional table information: table: hospital_1", "answer": "SELECT patient FROM undergoes ORDER BY dateundergoes NULLS FIRST LIMIT 1"} {"question": "Show all card type codes and the number of cards in each type.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_type_code, COUNT(*) FROM Customers_cards GROUP BY card_type_code"} {"question": "What is title of album which track Balls to the Wall belongs to?\nAdditional table information: table: store_1", "answer": "SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = 'Balls to the Wall'"} {"question": "What are the names of all the customers?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers"} {"question": "What are the names of all Rock tracks that are stored on MPEG audio files?\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = 'Rock' AND T3.name = 'MPEG audio file'"} {"question": "Give the state that has the most customers.\nAdditional table information: table: customer_complaints", "answer": "SELECT state FROM customers GROUP BY state ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "How many assets does each maintenance contract contain? List the number and the contract id.\nAdditional table information: table: assets_maintenance", "answer": "SELECT COUNT(*), T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id"} {"question": "What is the gender of the student Linda Smith?\nAdditional table information: table: restaurant_1", "answer": "SELECT Sex FROM Student WHERE Fname = 'Linda' AND Lname = 'Smith'"} {"question": "Which cities have at least one customer but no performer?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID"} {"question": "How many patients' prescriptions are made by physician John Dorian?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = 'John Dorian'"} {"question": "What is the name, latitude, and city of the station that is located the furthest South?\nAdditional table information: table: bike_1", "answer": "SELECT name, lat, city FROM station ORDER BY lat NULLS FIRST LIMIT 1"} {"question": "How many counties are there?\nAdditional table information: table: county_public_safety", "answer": "SELECT COUNT(*) FROM county_public_safety"} {"question": "Find the number of rooms for different block code?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*), T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode"} {"question": "Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.company_id, T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(*) >= 2 UNION SELECT T3.company_id, T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id = T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING COUNT(*) >= 2"} {"question": "Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009.\nAdditional table information: table: theme_gallery", "answer": "SELECT AVG(ticket_price), MIN(ticket_price), MAX(ticket_price) FROM exhibition WHERE YEAR < 2009"} {"question": "What are the names of Art instructors who have taught a course, and the corresponding course id?\nAdditional table information: table: college_2", "answer": "SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art'"} {"question": "What are the phone numbers for each employee?\nAdditional table information: table: chinook_1", "answer": "SELECT Phone FROM EMPLOYEE"} {"question": "Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.\nAdditional table information: table: phone_market", "answer": "SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING SUM(T1.Num_of_stock) >= 2000 ORDER BY SUM(T1.Num_of_stock) DESC"} {"question": "What is the name of school that has the smallest enrollment in each state?\nAdditional table information: table: soccer_2", "answer": "SELECT cName, state, MIN(enr) FROM college GROUP BY state"} {"question": "Count the number of distinct governors.\nAdditional table information: table: election", "answer": "SELECT COUNT(DISTINCT Governor) FROM party"} {"question": "What are the names and account balances of customers with the letter a in their names?\nAdditional table information: table: loan_1", "answer": "SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'"} {"question": "List the names of all distinct products in alphabetical order.\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT product_name FROM products ORDER BY product_name NULLS FIRST"} {"question": "What are the official names of cities, ordered descending by population?\nAdditional table information: table: farm", "answer": "SELECT Official_Name FROM city ORDER BY Population DESC"} {"question": "What is the total revenue of each manufacturer?\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue), name FROM manufacturers GROUP BY name"} {"question": "Find the product category description of the product category with code 'Spices'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_category_description FROM ref_product_categories WHERE product_category_code = 'Spices'"} {"question": "What is the location with the most cinemas opened in year 2010 or later?\nAdditional table information: table: cinema", "answer": "SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the average and maximum hours for the students whose tryout decision is yes.\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(T1.HS), MAX(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'"} {"question": "Find the semester and year which has the least number of student taking any class.\nAdditional table information: table: college_2", "answer": "SELECT semester, YEAR FROM takes GROUP BY semester, YEAR ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Which customers have both 'On Road' and 'Shipped' as order status? List the customer ids.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road' INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Shipped'"} {"question": "How many players born in USA are right-handed batters? That is, have the batter value 'R'.\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM player WHERE birth_country = 'USA' AND bats = 'R'"} {"question": "For each product with some problems, list the count of problems and the product id.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id"} {"question": "What is the format for South Australia?\nAdditional table information: table: regional_marketing\ncolumns: state_territory, text_bg_color, format, current_slogan, current_series, Notes", "answer": "SELECT format FROM \"regional_marketing\" WHERE state_territory = 'South Australia'"} {"question": "Show the name of track and the number of races in each track.\nAdditional table information: table: race_track", "answer": "SELECT T2.name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id"} {"question": "What are the different names and credit scores of customers who have taken a loan?\nAdditional table information: table: loan_1", "answer": "SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id"} {"question": "How many faculty members participate in an activity?\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in"} {"question": "Which semeseter and year had the fewest students?\nAdditional table information: table: college_2", "answer": "SELECT semester, YEAR FROM takes GROUP BY semester, YEAR ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What are the lengths and heights of roller coasters?\nAdditional table information: table: roller_coaster", "answer": "SELECT LENGTH, Height FROM roller_coaster"} {"question": "What are the ids and names of the companies that operated more than one flight?\nAdditional table information: table: flight_company", "answer": "SELECT T1.id, T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING COUNT(*) > 1"} {"question": "Show the dates of performances with attending members whose roles are 'Violin'.\nAdditional table information: table: performance_attendance", "answer": "SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = 'Violin'"} {"question": "What is the first and last name of all employees who live in the city Damianfort?\nAdditional table information: table: driving_school", "answer": "SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = 'Damianfort'"} {"question": "How many statements do we have?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Statements"} {"question": "display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%'"} {"question": "What are the names of the schools with some players in the mid position but no goalies?\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'"} {"question": "What is the name of the deparment with the highest enrollment?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the artist who produced the shortest song?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration NULLS FIRST LIMIT 1"} {"question": "Find the first and last names of people who payed more than the rooms' base prices.\nAdditional table information: table: inn_1", "answer": "SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0"} {"question": "Which documents have more than 1 draft copies? List document id and number of draft copies.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_id, COUNT(*) FROM Draft_Copies GROUP BY document_id HAVING COUNT(*) > 1"} {"question": "Count the number of characteristics.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM CHARACTERISTICS"} {"question": "What is the total number of customers across banks?\nAdditional table information: table: loan_1", "answer": "SELECT SUM(no_of_customers) FROM bank"} {"question": "How many students does each advisor have?\nAdditional table information: table: allergy_1", "answer": "SELECT advisor, COUNT(*) FROM Student GROUP BY advisor"} {"question": "Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed?\nAdditional table information: table: document_management", "answer": "SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1"} {"question": "Show the name of the shop that have the largest quantity of devices in stock.\nAdditional table information: table: device", "answer": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1"} {"question": "What are the different names of friends who are younger than the average age for a friend?\nAdditional table information: table: network_2", "answer": "SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person)"} {"question": "Show the studios that have not produced films with director 'Walter Hill'.\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = 'Walter Hill'"} {"question": "Show the status of the city that has hosted the greatest number of competitions.\nAdditional table information: table: farm", "answer": "SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the countries with the most airlines whose active status is Y?\nAdditional table information: table: flight_4", "answer": "SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which locations are shared by more than two wrestlers?\nAdditional table information: table: wrestler", "answer": "SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2"} {"question": "What are the average enrollment size of the universities that are founded before 1850?\nAdditional table information: table: university_basketball", "answer": "SELECT AVG(enrollment) FROM university WHERE founded < 1850"} {"question": "How many members of 'Bootup Baltimore' are older than 18?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.age > 18"} {"question": "What are the three colleges from which the most players are from?\nAdditional table information: table: match_season", "answer": "SELECT College FROM match_season GROUP BY College ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Find the addresses and author IDs of the course authors that teach at least two courses.\nAdditional table information: table: e_learning", "answer": "SELECT T1.address_line_1, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2"} {"question": "Return the apartment number and the number of rooms for each apartment.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_number, room_count FROM Apartments"} {"question": "What is the level name of the cheapest catalog (in USD)?\nAdditional table information: table: product_catalog", "answer": "SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars NULLS FIRST LIMIT 1"} {"question": "How many elections are there?\nAdditional table information: table: election_representative", "answer": "SELECT COUNT(*) FROM election"} {"question": "Which county has the largest population? Give me the name of the county.\nAdditional table information: table: election", "answer": "SELECT County_name FROM county ORDER BY Population DESC LIMIT 1"} {"question": "Show different teams of technicians and the number of technicians in each team.\nAdditional table information: table: machine_repair", "answer": "SELECT Team, COUNT(*) FROM technician GROUP BY Team"} {"question": "Give me all the distinct location codes for documents.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT DISTINCT location_code FROM Document_locations"} {"question": "Show the names of the buildings that have more than one company offices.\nAdditional table information: table: company_office", "answer": "SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1"} {"question": "Show the number of customers.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Customers"} {"question": "What are the ids of every student who has never attended a course?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM students WHERE NOT student_id IN (SELECT student_id FROM student_course_attendance)"} {"question": "What are the average and minimum age of captains in different class?\nAdditional table information: table: ship_1", "answer": "SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS"} {"question": "Show the distinct leader names of colleges associated with members from country 'Canada'.\nAdditional table information: table: decoration_competition", "answer": "SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = 'Canada'"} {"question": "Return the booking start date and end date for the apartments that have type code 'Duplex'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = 'Duplex'"} {"question": "Which colleges does each player with a name that starts with the letter D who tried out go to?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'"} {"question": "List member names and their party names.\nAdditional table information: table: party_people", "answer": "SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id"} {"question": "Find name of the services that has never been used.\nAdditional table information: table: e_government", "answer": "SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id"} {"question": "List all the cities in a decreasing order of each city's stations' highest latitude.\nAdditional table information: table: bike_1", "answer": "SELECT city FROM station GROUP BY city ORDER BY MAX(lat) DESC"} {"question": "For each airport name, how many routes start at that airport, ordered from most to least?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY COUNT(*) DESC"} {"question": "Find the list of distinct ranks for faculty.\nAdditional table information: table: activity_1", "answer": "SELECT DISTINCT rank FROM Faculty"} {"question": "List the title of films that do not have any market estimation.\nAdditional table information: table: film_rank", "answer": "SELECT Title FROM film WHERE NOT Film_ID IN (SELECT Film_ID FROM film_market_estimation)"} {"question": "Show the name of the customer who has the most orders.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the different names of all songs without back vocals?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = 'back'"} {"question": "Find the city and state of the bank branch named morningside.\nAdditional table information: table: loan_1", "answer": "SELECT city, state FROM bank WHERE bname = 'morningside'"} {"question": "Find the name of the department that has the fewest members.\nAdditional table information: table: college_3", "answer": "SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Give the classes that have more than two captains.\nAdditional table information: table: ship_1", "answer": "SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2"} {"question": "Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.\nAdditional table information: table: inn_1", "answer": "SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2"} {"question": "Find the number of students that have at least one grade 'B'.\nAdditional table information: table: college_3", "answer": "SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = 'B'"} {"question": "Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.\nAdditional table information: table: flight_1", "answer": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY COUNT(*) >= 5 NULLS FIRST"} {"question": "What is the name of the artist who joined latest?\nAdditional table information: table: theme_gallery", "answer": "SELECT name FROM artist ORDER BY year_join DESC LIMIT 1"} {"question": "Find the average credit score of the customers who have some loan.\nAdditional table information: table: loan_1", "answer": "SELECT AVG(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)"} {"question": "Who is performing in the back stage position for the song 'Der Kapitan'? Show the first name and last name.\nAdditional table information: table: music_2", "answer": "SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Der Kapitan' AND T1.StagePosition = 'back'"} {"question": "List the total points of gymnasts in descending order.\nAdditional table information: table: gymnast", "answer": "SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC"} {"question": "Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim amount.\nAdditional table information: table: insurance_policies", "answer": "SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC NULLS FIRST LIMIT 1"} {"question": "Count the number of students who have advisors.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT s_id) FROM advisor"} {"question": "List all information about the assessment notes sorted by date in ascending order.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT * FROM Assessment_Notes ORDER BY date_of_notes ASC NULLS FIRST"} {"question": "Who is the composer of track Fast As a Shark?\nAdditional table information: table: store_1", "answer": "SELECT composer FROM tracks WHERE name = 'Fast As a Shark'"} {"question": "What is the name of every college in alphabetical order that has more than 18000 students enrolled?\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM College WHERE enr > 18000 ORDER BY cName NULLS FIRST"} {"question": "Return the last name for the members of the club named 'Hopkins Student Enterprises'.\nAdditional table information: table: club_1", "answer": "SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises'"} {"question": "List the name and the number of stations for all the cities that have at least 15 stations.\nAdditional table information: table: bike_1", "answer": "SELECT city, COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15"} {"question": "Find all the songs performed by artist with last name 'Heilo'\nAdditional table information: table: music_2", "answer": "SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = 'Heilo'"} {"question": "Show all majors.\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT Major FROM Student"} {"question": "What are the category of music festivals with result 'Awarded'?\nAdditional table information: table: music_4", "answer": "SELECT Category FROM music_festival WHERE RESULT = 'Awarded'"} {"question": "Which city does student Linda Smith live in?\nAdditional table information: table: restaurant_1", "answer": "SELECT city_code FROM Student WHERE Fname = 'Linda' AND Lname = 'Smith'"} {"question": "Show the name and location of track with 1 race.\nAdditional table information: table: race_track", "answer": "SELECT T2.name, T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING COUNT(*) = 1"} {"question": "Find the average age of members of the club 'Hopkins Student Enterprises'.\nAdditional table information: table: club_1", "answer": "SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises'"} {"question": "Return the poll source corresponding to the candidate who has the oppose rate.\nAdditional table information: table: candidate_poll", "answer": "SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1"} {"question": "What are the ids for all sporty students who are on scholarship?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'"} {"question": "display the ID for those employees who did two or more jobs in the past.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2"} {"question": "Count the number of artists who have had volumes.\nAdditional table information: table: music_4", "answer": "SELECT COUNT(DISTINCT Artist_ID) FROM volume"} {"question": "Which country is the airport that has the highest altitude located in?\nAdditional table information: table: flight_4", "answer": "SELECT country FROM airports ORDER BY elevation DESC LIMIT 1"} {"question": "Find all the songs produced by artists with first name 'Marianne'.\nAdditional table information: table: music_2", "answer": "SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = 'Marianne'"} {"question": "Find the name of services that have been used for more than 2 times in first notification of loss.\nAdditional table information: table: insurance_fnol", "answer": "SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING COUNT(*) > 2"} {"question": "What is the denomination of the school the most players belong to?\nAdditional table information: table: school_player", "answer": "SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show invoice dates and order id and details for all invoices.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.invoice_date, T1.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id"} {"question": "display those employees who contain a letter z to their first name and also display their last name, city.\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T1.last_name, T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'"} {"question": "Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.\nAdditional table information: table: insurance_policies", "answer": "SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1"} {"question": "What are the titles of courses without prerequisites?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)"} {"question": "List the names and scores of all wines.\nAdditional table information: table: wine_1", "answer": "SELECT Name, Score FROM WINE"} {"question": "What is all the information about the Marketing department?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM departments WHERE department_name = 'Marketing'"} {"question": "How many degrees were conferred in 'San Jose State University' in 2000?\nAdditional table information: table: csu_1", "answer": "SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND t2.year = 2000"} {"question": "Show names for all employees who do not have certificate of Boeing 737-800.\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Boeing 737-800'"} {"question": "What are the attribute data types with more than 3 attribute definitions?\nAdditional table information: table: product_catalog", "answer": "SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING COUNT(*) > 3"} {"question": "What are the top 5 countries by number of invoices and how many do they have?\nAdditional table information: table: store_1", "answer": "SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5"} {"question": "Show all donor names.\nAdditional table information: table: school_finance", "answer": "SELECT DISTINCT donator_name FROM endowment"} {"question": "How many rooms have not had any reservation yet?\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations)"} {"question": "List the count and id of each product in all the orders.\nAdditional table information: table: tracking_orders", "answer": "SELECT COUNT(*), T3.product_id FROM orders AS T1, order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id"} {"question": "Return the color description that is most common across all products.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the name and publication date of the catalogs with catalog level number above 5?\nAdditional table information: table: product_catalog", "answer": "SELECT t1.catalog_name, t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5"} {"question": "What are the distinct ages of students who have secretary votes in the fall election cycle?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = 'Fall'"} {"question": "How many students are enrolled in college?\nAdditional table information: table: soccer_2", "answer": "SELECT SUM(enr) FROM College"} {"question": "How many games are played for all students?\nAdditional table information: table: game_1", "answer": "SELECT SUM(gamesplayed) FROM Sportsinfo"} {"question": "Find the average unit price of jazz tracks.\nAdditional table information: table: chinook_1", "answer": "SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Jazz'"} {"question": "display the average salary of employees for each department who gets a commission percentage.\nAdditional table information: table: hr_1", "answer": "SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> 'null' GROUP BY department_id"} {"question": "What is the name of the department htat has no students minoring in it?\nAdditional table information: table: college_3", "answer": "SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO"} {"question": "What is all the job history info done by employees earning a salary greater than or equal to 12000?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000"} {"question": "What are the different affiliations, and how many schools with each have an enrollment size of above 20000?\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(*), affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation"} {"question": "Which papers were written by authors from the institution 'Google'?\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'Google'"} {"question": "Find the distinct last names of all the students who have president votes and whose advisor is not 2192.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = '2192'"} {"question": "What is the id of the routes whose source and destination airports are in the United States?\nAdditional table information: table: flight_4", "answer": "SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')"} {"question": "Find the number of distinct room types available.\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(DISTINCT roomtype) FROM room"} {"question": "List the name of the aircraft that has been named winning aircraft the most number of times.\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show all customer ids and the number of cards owned by each customer.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id"} {"question": "What are the names of the clubs that have 'Davis Steven' as a member?\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Davis' AND t3.lname = 'Steven'"} {"question": "Return the names of shops, ordered by year of opening ascending.\nAdditional table information: table: device", "answer": "SELECT Shop_Name FROM shop ORDER BY Open_Year ASC NULLS FIRST"} {"question": "Find the number of distinct products Rodrick Heaney has bought so far.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = 'Rodrick Heaney'"} {"question": "List all tracks bought by customer Daan Peeters.\nAdditional table information: table: store_1", "answer": "SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = 'Daan' AND T4.last_name = 'Peeters'"} {"question": "List the name of enzymes in descending lexicographical order.\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name FROM enzyme ORDER BY name DESC"} {"question": "Show the residences that have both a player of gender 'M' and a player of gender 'F'.\nAdditional table information: table: riding_club", "answer": "SELECT Residence FROM player WHERE gender = 'M' INTERSECT SELECT Residence FROM player WHERE gender = 'F'"} {"question": "Report all advisors that advise more than 2 students.\nAdditional table information: table: voter_2", "answer": "SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2"} {"question": "What are the city name, id, and number of addresses corresponding to the city with the most addressed?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List all restaurant types.\nAdditional table information: table: restaurant_1", "answer": "SELECT ResTypeName FROM Restaurant_Type"} {"question": "What are the id and address of the shops which have a happy hour in May?\nAdditional table information: table: coffee_shop", "answer": "SELECT t1.address, t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id = t2.shop_id WHERE MONTH = 'May'"} {"question": "What is the invoice number and invoice date corresponding to the invoice with the greatest number of transactions?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.invoice_number, T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the ids of all students who played video games and sports?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games"} {"question": "What is the name of the organization that was formed most recently?\nAdditional table information: table: e_government", "answer": "SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1"} {"question": "Count the total number of bookings made.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT COUNT(*) FROM BOOKINGS"} {"question": "Return the ids and details corresponding to projects for which there are more than two documents.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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"} {"question": "Give me the first name and last name for all the female members of the club 'Bootup Baltimore'.\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.sex = 'F'"} {"question": "What is the channel code and contact number of the customer contact channel that was active for the longest time?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)"} {"question": "What are the names and other details for accounts corresponding to the customer named Meaghan Keeling?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.account_name, T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' AND T2.customer_last_name = 'Keeling'"} {"question": "Which orders are made by the customer named 'Jeramie'? Give me the order ids and status.\nAdditional table information: table: tracking_orders", "answer": "SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'"} {"question": "What are the ids of all students who live in CHI?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE city_code = 'CHI'"} {"question": "Find the name and description of the role with code 'MG'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_name, role_description FROM ROLES WHERE role_code = 'MG'"} {"question": "How many debit cards do we have?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers_cards WHERE card_type_code = 'Debit'"} {"question": "Find the distinct names of wines produced before the year of 2000 or after the year of 2010.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010"} {"question": "How many camera lenses have a focal length longer than 15 mm?\nAdditional table information: table: mountain_photos", "answer": "SELECT COUNT(*) FROM camera_lens WHERE focal_length_mm > 15"} {"question": "List the name of physicians who took some appointment.\nAdditional table information: table: hospital_1", "answer": "SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID"} {"question": "Show all church names that have hosted least two weddings.\nAdditional table information: table: wedding", "answer": "SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id HAVING COUNT(*) >= 2"} {"question": "List the total scores of body builders in ascending order.\nAdditional table information: table: body_builder", "answer": "SELECT Total FROM body_builder ORDER BY Total ASC NULLS FIRST"} {"question": "Group by ships by flag, and return number of ships that have each flag.\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(*), flag FROM ship GROUP BY flag"} {"question": "What are the percentage of hispanics in cities with the black percentage higher than 10?\nAdditional table information: table: county_public_safety", "answer": "SELECT Hispanic FROM city WHERE Black > 10"} {"question": "What is the last name of the student who got a grade A in the class with code 10018.\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018"} {"question": "What is the zip code in which the average mean sea level pressure is the lowest?\nAdditional table information: table: bike_1", "answer": "SELECT zip_code FROM weather GROUP BY zip_code ORDER BY AVG(mean_sea_level_pressure_inches) NULLS FIRST LIMIT 1"} {"question": "How many drivers participated in the race Australian Grand Prix held in 2009?\nAdditional table information: table: formula_1", "answer": "SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = 'Australian Grand Prix' AND YEAR = 2009"} {"question": "Show the denomination of the school that has the most players.\nAdditional table information: table: school_player", "answer": "SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the name of rooms whose base price is between 120 and 150.\nAdditional table information: table: inn_1", "answer": "SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150"} {"question": "How many distinct artists do the volumes associate to?\nAdditional table information: table: music_4", "answer": "SELECT COUNT(DISTINCT Artist_ID) FROM volume"} {"question": "How many regions were affected by each storm?\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Return the flag that is most common among all ships.\nAdditional table information: table: ship_1", "answer": "SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of scientists who are not working on the project with the most hours?\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)"} {"question": "What is the name and the average gpa of department whose students have the highest average gpa?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1"} {"question": "Show ids of students who play video game and play sports.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games"} {"question": "Find the name of the courses that do not have any prerequisite?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)"} {"question": "Find the name and component amount of the least popular furniture.\nAdditional table information: table: manufacturer", "answer": "SELECT name, Num_of_Component FROM furniture ORDER BY market_rate NULLS FIRST LIMIT 1"} {"question": "Which nations have both hosts of age above 45 and hosts of age below 35?\nAdditional table information: table: party_host", "answer": "SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35"} {"question": "For each competition, count the number of matches.\nAdditional table information: table: city_record", "answer": "SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition"} {"question": "Give the names, details, and data types of characteristics that are not found in any product.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id"} {"question": "What is the alphabetically ordered list of all the distinct names of nurses?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT name FROM nurse ORDER BY name NULLS FIRST"} {"question": "What are the monthly rentals of student addresses in Texas state?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = 'Texas'"} {"question": "List categories that have at least two books after year 1989.\nAdditional table information: table: culture_company", "answer": "SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING COUNT(*) >= 2"} {"question": "What are the first name, last name, and phone number of all the female faculty members?\nAdditional table information: table: activity_1", "answer": "SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F'"} {"question": "List the studios which average gross is above 4500000.\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film GROUP BY Studio HAVING AVG(Gross_in_dollar) >= 4500000"} {"question": "What are the companies and main industries of all companies that are not headquartered in the United States?\nAdditional table information: table: gas_company", "answer": "SELECT company, main_industry FROM company WHERE headquarters <> 'USA'"} {"question": "What is the 'active to date' of the latest contact channel used by 'Tillman Ernser'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Tillman Ernser'"} {"question": "List name of all tracks in Balls to the Wall.\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = 'Balls to the Wall'"} {"question": "How many stores are headquarted in each city?\nAdditional table information: table: store_product", "answer": "SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city"} {"question": "What are the names of documents that do not have any sections?\nAdditional table information: table: document_management", "answer": "SELECT document_name FROM documents WHERE NOT document_code IN (SELECT document_code FROM document_sections)"} {"question": "What are the details of the lots which are not used in any transactions?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id"} {"question": "Show ids for all documents with budget types described as 'Government'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = 'Government'"} {"question": "What is the vocal type of the band mate whose first name is 'Marianne' played the most?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = 'Marianne' GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'"} {"question": "What is the phone number and postal code of the address 1031 Daugavpils Parkway?\nAdditional table information: table: sakila_1", "answer": "SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'"} {"question": "What are the names of movies that get 3 star and 4 star?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4"} {"question": "Return the maximum and minimum number of cities across all markets.\nAdditional table information: table: film_rank", "answer": "SELECT MAX(Number_cities), MIN(Number_cities) FROM market"} {"question": "What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill?\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film WHERE Director = 'Nicholas Meyer' INTERSECT SELECT Studio FROM film WHERE Director = 'Walter Hill'"} {"question": "Show all advisors who have at least two students.\nAdditional table information: table: game_1", "answer": "SELECT advisor FROM Student GROUP BY advisor HAVING COUNT(*) >= 2"} {"question": "Which engineers have never visited to maintain the assets? List the engineer first name and last name.\nAdditional table information: table: assets_maintenance", "answer": "SELECT first_name, last_name FROM Maintenance_Engineers WHERE NOT engineer_id IN (SELECT engineer_id FROM Engineer_Visits)"} {"question": "Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date.\nAdditional table information: table: insurance_policies", "answer": "SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims)"} {"question": "What is detail of the student who registered the most number of courses?\nAdditional table information: table: student_assessment", "answer": "SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of banks that have loaned money to customers with credit scores below 100?\nAdditional table information: table: loan_1", "answer": "SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100"} {"question": "What are the numbers of all flights coming from Los Angeles?\nAdditional table information: table: flight_1", "answer": "SELECT flno FROM Flight WHERE origin = 'Los Angeles'"} {"question": "Who is the youngest employee in the company? List employee's first and last name.\nAdditional table information: table: store_1", "answer": "SELECT first_name, last_name FROM employees ORDER BY birth_date DESC LIMIT 1"} {"question": "How many colleges in total?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM College"} {"question": "What is the title of the film that has the highest high market estimation.\nAdditional table information: table: film_rank", "answer": "SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1"} {"question": "Show the ids of all employees who have destroyed a document.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "What is the average height of the players from the college named 'Yale University'?\nAdditional table information: table: baseball_1", "answer": "SELECT AVG(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University'"} {"question": "What are all the movies rated as R? List the titles.\nAdditional table information: table: sakila_1", "answer": "SELECT title FROM film WHERE rating = 'R'"} {"question": "Name all the products with next entry ID greater than 8.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8"} {"question": "What are the names of courses without prerequisites?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)"} {"question": "Find the names of customers whose name contains 'Diana'.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT customer_details FROM customers WHERE customer_details LIKE '%Diana%'"} {"question": "Show the id and star rating of each hotel, ordered by its price from low to high.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT hotel_id, star_rating_code FROM HOTELS ORDER BY price_range ASC NULLS FIRST"} {"question": "What is the name of all the people who are older than at least one engineer? Order them by age.\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age NULLS FIRST"} {"question": "What are the full names and hire dates for employees in the same department as someone with the first name Clara?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = 'Clara')"} {"question": "What are the companies of entrepreneurs, ordered descending by amount of money requested?\nAdditional table information: table: entrepreneur", "answer": "SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC"} {"question": "display all the details from Employees table for those employees who was hired before 2002-06-21.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE hire_date < '2002-06-21'"} {"question": "Find the names of artists that do not have any albums.\nAdditional table information: table: chinook_1", "answer": "SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId"} {"question": "What are names and savings balances of the three accounts with the highest savings balances?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name, T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance DESC LIMIT 3"} {"question": "Find the total number of available hotels.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT COUNT(*) FROM HOTELS"} {"question": "Find the rank of the faculty that the fewest faculties belong to.\nAdditional table information: table: college_3", "answer": "SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What is the name of the race held most recently?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM races ORDER BY date DESC LIMIT 1"} {"question": "Show the maximum and minimum share count of different transaction types.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT transaction_type_code, MAX(share_count), MIN(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code"} {"question": "What are the names of all songs in English?\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song WHERE languages = 'english'"} {"question": "How many events had participants whose details had the substring 'Dr.'\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT COUNT(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'"} {"question": "Find the average number of customers cross all banks.\nAdditional table information: table: loan_1", "answer": "SELECT AVG(no_of_customers) FROM bank"} {"question": "Which person whose friends have the oldest average age?\nAdditional table information: table: network_2", "answer": "SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1"} {"question": "How many games has each stadium held?\nAdditional table information: table: game_injury", "answer": "SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id"} {"question": "What is the largest major?\nAdditional table information: table: allergy_1", "answer": "SELECT major FROM Student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the average price of hotels for different pet policy.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn"} {"question": "What are the investors who have invested in both entrepreneurs who requested more than 140000 and entrepreneurs who requested less than 120000?\nAdditional table information: table: entrepreneur", "answer": "SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000"} {"question": "What are the different cities listed?\nAdditional table information: table: manufactory_1", "answer": "SELECT DISTINCT headquarter FROM manufacturers"} {"question": "Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261'"} {"question": "Find employee with ID and name of the country presently where (s)he is working.\nAdditional table information: table: hr_1", "answer": "SELECT T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id"} {"question": "Return the names of people, ordered by weight ascending.\nAdditional table information: table: entrepreneur", "answer": "SELECT Name FROM People ORDER BY Weight ASC NULLS FIRST"} {"question": "How much in total does customer with first name as Carole and last name as Bernhard paid?\nAdditional table information: table: driving_school", "answer": "SELECT SUM(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Carole' AND T2.last_name = 'Bernhard'"} {"question": "How many departments are in the division AS?\nAdditional table information: table: college_3", "answer": "SELECT COUNT(*) FROM DEPARTMENT WHERE Division = 'AS'"} {"question": "For each airport name, how many routes start at that airport?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name"} {"question": "List all customers\u2019 names in the alphabetical order.\nAdditional table information: table: small_bank_1", "answer": "SELECT name FROM accounts ORDER BY name NULLS FIRST"} {"question": "What are the maximum and average height of the mountains?\nAdditional table information: table: mountain_photos", "answer": "SELECT MAX(height), AVG(height) FROM mountain"} {"question": "What are the ids of all products that were either ordered more than 3 times or have a cumulative amount purchased of above 80000?\nAdditional table information: table: department_store", "answer": "SELECT product_id FROM Order_Items GROUP BY product_id HAVING COUNT(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING SUM(total_amount_purchased) > 80000"} {"question": "Show the names of players and names of their coaches.\nAdditional table information: table: riding_club", "answer": "SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID"} {"question": "In what years did a movie receive a 4 or 5 star rating, and list the years from oldest to most recently?\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year NULLS FIRST"} {"question": "How many customers are there?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(*) FROM customers"} {"question": "What are the names of customers with accounts, and how many checking accounts do each of them have?\nAdditional table information: table: small_bank_1", "answer": "SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name"} {"question": "List the names of buildings in descending order of building height.\nAdditional table information: table: company_office", "answer": "SELECT name FROM buildings ORDER BY Height DESC"} {"question": "Return the code of the card type that is most common.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the titles of movies and books corresponding to companies incorporated in China?\nAdditional table information: table: culture_company", "answer": "SELECT T1.title, T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'"} {"question": "Which physicians are in charge of more than one patient? Give me their names.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING COUNT(*) > 1"} {"question": "What are the name and primarily affiliated department name of each physician?\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name, T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1"} {"question": "Show the names of trains and locations of railways they are in.\nAdditional table information: table: railway", "answer": "SELECT T2.Name, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID"} {"question": "What are the names of all employees who have a certificate to fly Boeing 737-800?\nAdditional table information: table: flight_1", "answer": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Boeing 737-800'"} {"question": "What are the nationalities and ages of journalists?\nAdditional table information: table: news_report", "answer": "SELECT Nationality, Age FROM journalist"} {"question": "List the names of editors that are not on any journal committee.\nAdditional table information: table: journal_committee", "answer": "SELECT Name FROM editor WHERE NOT editor_id IN (SELECT editor_id FROM journal_committee)"} {"question": "Show order ids and the number of products in each order.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT order_id, COUNT(DISTINCT product_id) FROM Order_items GROUP BY order_id"} {"question": "What are the names of body builders?\nAdditional table information: table: body_builder", "answer": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID"} {"question": "How many students are over 18 and do not have allergy to food type or animal type?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student WHERE age > 18 AND NOT StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'food' OR T2.allergytype = 'animal')"} {"question": "Find the name and age of the person who is a friend of Dan or Alice.\nAdditional table information: table: network_2", "answer": "SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'"} {"question": "Count the number of credit cards that the customer with first name Blanche and last name Huels has.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Blanche' AND T2.customer_last_name = 'Huels' AND T1.card_type_code = 'Credit'"} {"question": "What is the email of the student with first name 'Emma' and last name 'Rohan'?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT email_address FROM Students WHERE first_name = 'Emma' AND last_name = 'Rohan'"} {"question": "What are the ids and durations of the trips with the top 3 durations?\nAdditional table information: table: bike_1", "answer": "SELECT id, duration FROM trip ORDER BY duration DESC LIMIT 3"} {"question": "Find the number of teachers who teach the student called CHRISSY NABOZNY.\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'CHRISSY' AND T1.lastname = 'NABOZNY'"} {"question": "What is the characteristic name used by most number of the products?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the venue of the competition '1994 FIFA World Cup qualification' which was hosted by 'Nanjing ( Jiangsu )'.\nAdditional table information: table: city_record", "answer": "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'"} {"question": "Find the payment method that is used the most often in all the invoices. Give me its code.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the composer who created the track 'Fast As a Shark'?\nAdditional table information: table: store_1", "answer": "SELECT composer FROM tracks WHERE name = 'Fast As a Shark'"} {"question": "What procedures cost less than 5000 and have John Wen as a trained physician?\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM procedures WHERE cost < 5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "Show the people that have been governor the most times.\nAdditional table information: table: election", "answer": "SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the total number of horses on farms in ascending order.\nAdditional table information: table: farm", "answer": "SELECT Total_Horses FROM farm ORDER BY Total_Horses ASC NULLS FIRST"} {"question": "What are the login names and family names of course author and tutors?\nAdditional table information: table: e_learning", "answer": "SELECT login_name, family_name FROM Course_Authors_and_Tutors"} {"question": "How many different countries are all the swimmers from?\nAdditional table information: table: swimming", "answer": "SELECT COUNT(DISTINCT nationality) FROM swimmer"} {"question": "What are the names of representatives and the dates of elections they participated in.\nAdditional table information: table: election_representative", "answer": "SELECT T2.Name, T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID"} {"question": "Find the faculty rank that has the least members.\nAdditional table information: table: activity_1", "answer": "SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Show total hours per week and number of games played for student David Shieber.\nAdditional table information: table: game_1", "answer": "SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = 'David' AND T2.Lname = 'Shieber'"} {"question": "What are the order details of the products with price higher than 2000?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000"} {"question": "What buildings have faculty offices?\nAdditional table information: table: activity_1", "answer": "SELECT DISTINCT building FROM Faculty"} {"question": "What are the names of actors ordered descending by the year in which their musical was awarded?\nAdditional table information: table: musical", "answer": "SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID ORDER BY T2.Year DESC"} {"question": "What are all the instruments used?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT instrument FROM Instruments"} {"question": "Return all reviewer names and movie names together in a single list.\nAdditional table information: table: movie_1", "answer": "SELECT name FROM Reviewer UNION SELECT title FROM Movie"} {"question": "How many females does this network has?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(*) FROM Person WHERE gender = 'female'"} {"question": "Find the claim id and claim date of the claim that incurred the most settlement count. Also tell me the count.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.claim_id, T1.date_claim_made, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Select the names of all the products in the store.\nAdditional table information: table: manufactory_1", "answer": "SELECT Name FROM Products"} {"question": "How many settlements are there in total?\nAdditional table information: table: insurance_policies", "answer": "SELECT COUNT(*) FROM Settlements"} {"question": "How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Rylan' AND T2.last_name = 'Goodwin' AND T1.lesson_status_code = 'Completed'"} {"question": "What is the rank, company, and market value of every comapny in the banking industry ordered by sales and profits?\nAdditional table information: table: gas_company", "answer": "SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion NULLS FIRST, profits_billion NULLS FIRST"} {"question": "Find the names of customers who have no policies associated.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id"} {"question": "What is the total amount of grants given by each organisations? Also list the organisation id.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id"} {"question": "What are the id and name of the mountains that have at least 2 photos?\nAdditional table information: table: mountain_photos", "answer": "SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id GROUP BY T1.id HAVING COUNT(*) >= 2"} {"question": "Return the the 'active to date' of the latest contact channel used by the customer named 'Tillman Ernser'.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Tillman Ernser'"} {"question": "What are the ids and last names of all drivers who participated in the most races?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which payment method is used by most customers?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all cities and states?\nAdditional table information: table: e_government", "answer": "SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses"} {"question": "What country does Roberto Almeida live?\nAdditional table information: table: store_1", "answer": "SELECT country FROM customers WHERE first_name = 'Roberto' AND last_name = 'Almeida'"} {"question": "Who are the owners of the programs that broadcast both in the morning and at night?\nAdditional table information: table: program_share", "answer": "SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = 'Morning' INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = 'Night'"} {"question": "What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' ORDER BY department_id NULLS FIRST"} {"question": "Who is the nominee who has been nominated for the most musicals?\nAdditional table information: table: musical", "answer": "SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the white percentages of cities, and the corresponding crime rates of the counties they correspond to?\nAdditional table information: table: county_public_safety", "answer": "SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID"} {"question": "What campuses are located in Los Angeles county and opened after 1950?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE county = 'Los Angeles' AND YEAR > 1950"} {"question": "Show the years and the official names of the host cities of competitions.\nAdditional table information: table: farm", "answer": "SELECT T2.Year, T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID"} {"question": "List the studios of each film and the number of films produced by that studio.\nAdditional table information: table: film_rank", "answer": "SELECT Studio, COUNT(*) FROM film GROUP BY Studio"} {"question": "What are the distinct names of the products that cost more than the average?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS)"} {"question": "Show the first name and last name for all the instructors.\nAdditional table information: table: activity_1", "answer": "SELECT fname, lname FROM Faculty WHERE Rank = 'Instructor'"} {"question": "For each player, what are their name, season, and country that they belong to?\nAdditional table information: table: match_season", "answer": "SELECT T2.Season, T2.Player, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country"} {"question": "Find the names of all reviewers who have contributed three or more ratings.\nAdditional table information: table: movie_1", "answer": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3"} {"question": "Which customers have made at least two orders? Give me each customer name and number of orders made.\nAdditional table information: table: tracking_orders", "answer": "SELECT T2.customer_name, COUNT(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) >= 2"} {"question": "List names of all teams in the basketball competition, ordered by all home scores in descending order.\nAdditional table information: table: university_basketball", "answer": "SELECT team_name FROM basketball_match ORDER BY All_Home DESC"} {"question": "What are the names of captains, sorted by age descending?\nAdditional table information: table: ship_1", "answer": "SELECT name FROM captain ORDER BY age DESC"} {"question": "Find the name of dorms which have TV Lounge but no Study Room as amenity.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'"} {"question": "What is the name of the stadium which held the most events?\nAdditional table information: table: swimming", "answer": "SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "list the name, job title of all people ordered by their names.\nAdditional table information: table: network_2", "answer": "SELECT name, job FROM Person ORDER BY name NULLS FIRST"} {"question": "What are the names of captains that have either the rank Midshipman or Lieutenant?\nAdditional table information: table: ship_1", "answer": "SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'"} {"question": "Return the id of the project that has the fewest corresponding documents.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "How many songs appear in studio albums?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = 'Studio'"} {"question": "Show ids for all transactions whose amounts are greater than the average.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT AVG(transaction_amount) FROM Financial_transactions)"} {"question": "What are the first names and last names of the students that minor in the department with DNO 140.\nAdditional table information: table: college_3", "answer": "SELECT T2.Fname, T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140"} {"question": "What is the total access count of documents that are of the most common document type?\nAdditional table information: table: document_management", "answer": "SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "On which day and in which zip code was the min dew point lower than any day in zip code 94107?\nAdditional table information: table: bike_1", "answer": "SELECT date, zip_code FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107)"} {"question": "how many schools exist in total?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT school_code) FROM department"} {"question": "What is the average age for all managers?\nAdditional table information: table: railway", "answer": "SELECT AVG(Age) FROM manager"} {"question": "What are the names of countains that no climber has climbed?\nAdditional table information: table: climbing", "answer": "SELECT Name FROM mountain WHERE NOT Mountain_ID IN (SELECT Mountain_ID FROM climber)"} {"question": "Display the first name, and department number for all employees whose last name is 'McEwen'.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'"} {"question": "Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.\nAdditional table information: table: match_season", "answer": "SELECT College FROM match_season WHERE POSITION = 'Midfielder' INTERSECT SELECT College FROM match_season WHERE POSITION = 'Defender'"} {"question": "What are the faculty ids of all the male faculty members?\nAdditional table information: table: activity_1", "answer": "SELECT FacID FROM Faculty WHERE Sex = 'M'"} {"question": "Show all locations and the number of gas stations in each location ordered by the count.\nAdditional table information: table: gas_company", "answer": "SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*) NULLS FIRST"} {"question": "Find the name of different colleges involved in the tryout in alphabetical order.\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT cName FROM tryout ORDER BY cName NULLS FIRST"} {"question": "Which committees have delegates from both democratic party and liberal party?\nAdditional table information: table: election", "answer": "SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Democratic' INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Liberal'"} {"question": "Find the number of rooms that do not have any reservation.\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations)"} {"question": "Tell me what the notes are for South Australia. \nAdditional table information: table: regional_marketing\ncolumns: state_territory, text_bg_color, format, current_slogan, current_series, Notes", "answer": "SELECT Notes FROM \"regional_marketing\" WHERE current_slogan = 'SOUTH AUSTRALIA'"} {"question": "Give the maximum and minimum gradepoints for students living in NYC?\nAdditional table information: table: college_3", "answer": "SELECT MAX(T2.gradepoint), MIN(T2.gradepoint) FROM ENROLLED_IN AS T1, GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = 'NYC'"} {"question": "Count the number of different colleges that players who play for Columbus Crew are from.\nAdditional table information: table: match_season", "answer": "SELECT COUNT(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Columbus Crew'"} {"question": "Show student ids who are on scholarship and have major 600.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'"} {"question": "Find the id and star rating of each hotel and sort them in increasing order of price.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT hotel_id, star_rating_code FROM HOTELS ORDER BY price_range ASC NULLS FIRST"} {"question": "Find the distinct number of president votes.\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD"} {"question": "Return the rank for which there are the fewest captains.\nAdditional table information: table: ship_1", "answer": "SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance NULLS FIRST"} {"question": "Show the names and total passengers for all train stations not in London.\nAdditional table information: table: train_station", "answer": "SELECT name, total_passengers FROM station WHERE LOCATION <> 'London'"} {"question": "List the name of all rooms sorted by their prices.\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms ORDER BY basePrice NULLS FIRST"} {"question": "What are the names of representatives whose party is not 'Republican'?\nAdditional table information: table: election_representative", "answer": "SELECT Name FROM Representative WHERE Party <> 'Republican'"} {"question": "Find the count of universities whose campus fee is greater than the average campus fee.\nAdditional table information: table: csu_1", "answer": "SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)"} {"question": "What are the names and data types of the characteristics of the 'cumin' product?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'cumin'"} {"question": "What are the names of all pilots 30 years old or young in descending alphabetical order?\nAdditional table information: table: aircraft", "answer": "SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC"} {"question": "How many cities are in Australia?\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia'"} {"question": "Show the team that have at least two technicians.\nAdditional table information: table: machine_repair", "answer": "SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2"} {"question": "How many transactions do we have?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Financial_transactions"} {"question": "Count the number of cities in Australia.\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia'"} {"question": "List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.\nAdditional table information: table: restaurant_1", "answer": "SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F'"} {"question": "List all vehicle id\nAdditional table information: table: driving_school", "answer": "SELECT vehicle_id FROM Vehicles"} {"question": "What are the ids of the students who registered for course 301 most recently?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1"} {"question": "What are all details of the students who registered but did not attend any course?\nAdditional table information: table: student_assessment", "answer": "SELECT * FROM student_course_registrations WHERE NOT student_id IN (SELECT student_id FROM student_course_attendance)"} {"question": "Find the ids of the problems reported after the date of any problems reported by the staff Rylan Homenick.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > (SELECT MAX(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = 'Rylan' AND T4.staff_last_name = 'Homenick')"} {"question": "Show the first year and last year of parties with theme 'Spring' or 'Teqnology'.\nAdditional table information: table: party_host", "answer": "SELECT First_year, Last_year FROM party WHERE Party_Theme = 'Spring' OR Party_Theme = 'Teqnology'"} {"question": "Return all the information for each election record.\nAdditional table information: table: election", "answer": "SELECT * FROM election"} {"question": "How many medicines have the FDA approval status 'No' ?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT COUNT(*) FROM medicine WHERE FDA_approved = 'No'"} {"question": "How many devices are there?\nAdditional table information: table: device", "answer": "SELECT COUNT(*) FROM device"} {"question": "Return the party email that has used party services the greatest number of times.\nAdditional table information: table: e_government", "answer": "SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the id and full name of the customer who has the fewest accounts.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What are teh names of the different products, as well as the number of customers who have ordered each product.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.product_name, COUNT(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name"} {"question": "What are all the section titles of the document named 'David CV'?\nAdditional table information: table: document_management", "answer": "SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = 'David CV'"} {"question": "How many different locations does each school have?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code"} {"question": "Show the names of festivals that have nominated artworks of type 'Program Talent Show'.\nAdditional table information: table: entertainment_awards", "answer": "SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = 'Program Talent Show'"} {"question": "How many flights do we have?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Flight"} {"question": "What are the gender and occupation of players?\nAdditional table information: table: riding_club", "answer": "SELECT Gender, Occupation FROM player"} {"question": "How many students play video games?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(DISTINCT StuID) FROM Plays_games"} {"question": "How many documents have the status code done?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT COUNT(*) FROM Documents WHERE document_status_code = 'done'"} {"question": "What are the id of students who registered courses or attended courses?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance"} {"question": "How many undergraduates are there in 'San Jose State University' in year 2004?\nAdditional table information: table: csu_1", "answer": "SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = 'San Jose State University'"} {"question": "What are the id and details of the customers who have at least 3 events?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 3"} {"question": "Find the number of members living in each address.\nAdditional table information: table: coffee_shop", "answer": "SELECT COUNT(*), address FROM member GROUP BY address"} {"question": "What are the names of players who train between 500 and 1500 hours?\nAdditional table information: table: soccer_2", "answer": "SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500"} {"question": "What are the ids of the stations in San Francisco that normally have more than 10 bikes available?\nAdditional table information: table: bike_1", "answer": "SELECT id FROM station WHERE city = 'San Francisco' INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING AVG(bikes_available) > 10"} {"question": "What is the average credit score for customers who have never taken a loan?\nAdditional table information: table: loan_1", "answer": "SELECT AVG(credit_score) FROM customer WHERE NOT cust_id IN (SELECT cust_id FROM loan)"} {"question": "Show the number of all customers without an account.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Accounts)"} {"question": "Return the descriptions and names of the courses that have more than two students enrolled in.\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_description, T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2"} {"question": "How many allergies are there?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(DISTINCT allergy) FROM Allergy_type"} {"question": "Find the number of tied games (the value of 'ties' is '1') in 1885 postseason.\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM postseason WHERE YEAR = 1885 AND ties = 1"} {"question": "Which address do not have any member with the black membership card?\nAdditional table information: table: coffee_shop", "answer": "SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card = 'Black'"} {"question": "What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds?\nAdditional table information: table: bike_1", "answer": "SELECT date, mean_temperature_f, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3"} {"question": "What are the titles and studios of films that have been produced by a studio whose name contains 'Universal'?\nAdditional table information: table: film_rank", "answer": "SELECT title, Studio FROM film WHERE Studio LIKE '%Universal%'"} {"question": "Show the names of donors who donated to both school 'Glenn' and 'Triton.'\nAdditional table information: table: school_finance", "answer": "SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton'"} {"question": "What is the forename and surname of the driver with the shortest laptime?\nAdditional table information: table: formula_1", "answer": "SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds NULLS FIRST LIMIT 1"} {"question": "What type has the most games?\nAdditional table information: table: game_1", "answer": "SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the personal name, family name, and author ID of the course author who teaches the most courses?\nAdditional table information: table: e_learning", "answer": "SELECT T1.personal_name, T1.family_name, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the number of different different airports that are destinations for American Airlines?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'"} {"question": "Count the number of different languages in these films.\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(DISTINCT language_id) FROM film"} {"question": "What is the id for the employee called Ebba?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_ID FROM Employees WHERE employee_name = 'Ebba'"} {"question": "What is the country of origin of the artist who is female and produced a song in Bangla?\nAdditional table information: table: music_1", "answer": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = 'Female' AND T2.languages = 'bangla'"} {"question": "Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'"} {"question": "What is the date of the performance with the highest number of attendees?\nAdditional table information: table: performance_attendance", "answer": "SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1"} {"question": "What are the names and years of all races that had a driver with the last name Lewis?\nAdditional table information: table: formula_1", "answer": "SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = 'Lewis'"} {"question": "What are the location and nickname of each school?\nAdditional table information: table: school_player", "answer": "SELECT T1.Location, T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID"} {"question": "Find the average number of followers for the users who do not have any tweet.\nAdditional table information: table: twitter_1", "answer": "SELECT AVG(followers) FROM user_profiles WHERE NOT UID IN (SELECT UID FROM tweets)"} {"question": "Show the account id with most number of transactions.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show me the classrooms grade 5 is using.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT classroom FROM list WHERE grade = 5"} {"question": "For all directors who have directed more than one movie, what movies have they directed and what are their names?\nAdditional table information: table: movie_1", "answer": "SELECT T1.title, T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY T1.director NULLS FIRST, T1.title NULLS FIRST"} {"question": "Show all male student ids who don't play football.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = 'Football'"} {"question": "What are the names of the counties of public safety, ordered by population descending?\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM county_public_safety ORDER BY Population DESC"} {"question": "What are the distinct buildings with capacities of greater than 50?\nAdditional table information: table: college_2", "answer": "SELECT DISTINCT building FROM classroom WHERE capacity > 50"} {"question": "Compute the average price of all products with manufacturer code equal to 2.\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(price) FROM products WHERE manufacturer = 2"} {"question": "Count different addresses of each school.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code"} {"question": "Which kind of part has the least number of faults? List the part name.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "which countries have more than 2 airports?\nAdditional table information: table: flight_company", "answer": "SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2"} {"question": "Tell me the payment method used by the customer who ordered the least amount of goods in total.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) NULLS FIRST LIMIT 1"} {"question": "What are the distinct types of mills that are built by American or Canadian architects?\nAdditional table information: table: architecture", "answer": "SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian'"} {"question": "Return the investor who have invested in the greatest number of entrepreneurs.\nAdditional table information: table: entrepreneur", "answer": "SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32.\nAdditional table information: table: phone_1", "answer": "SELECT T2.Hardware_Model_name, T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32"} {"question": "Which vocal type did the musician with first name 'Solveig' played in the song with title 'A Bar in Amsterdam'?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = 'Solveig' AND T2.title = 'A Bar In Amsterdam'"} {"question": "report the total number of degrees granted between 1998 and 2002.\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus"} {"question": "How many invoices correspond to each order id?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id"} {"question": "Sort all captain names by their ages from old to young.\nAdditional table information: table: ship_1", "answer": "SELECT name FROM captain ORDER BY age DESC"} {"question": "Show the average amount of transactions for different lots, ordered by average amount of transactions.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY AVG(amount_of_transaction) NULLS FIRST"} {"question": "What are the different cities where people live?\nAdditional table information: table: student_assessment", "answer": "SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id"} {"question": "What are the names of artists that have not had any exhibitions?\nAdditional table information: table: theme_gallery", "answer": "SELECT name FROM artist WHERE NOT artist_id IN (SELECT artist_id FROM exhibition)"} {"question": "Find the number of medications prescribed for each brand.\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*), T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand"} {"question": "Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in.\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID"} {"question": "How many movies were made before 2000?\nAdditional table information: table: movie_1", "answer": "SELECT COUNT(*) FROM Movie WHERE YEAR < 2000"} {"question": "For each classroom, report the classroom number and the number of grades using it.\nAdditional table information: table: student_1", "answer": "SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom"} {"question": "Show all majors and corresponding number of students.\nAdditional table information: table: allergy_1", "answer": "SELECT major, COUNT(*) FROM Student GROUP BY major"} {"question": "Which location names contain the word 'film'?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE '%film%'"} {"question": "How many rooms in each building have a capacity of over 50?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*), building FROM classroom WHERE capacity > 50 GROUP BY building"} {"question": "Return the names and typical buying and selling prices for products that have 'yellow' as their color description.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.product_name, t1.typical_buying_price, t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = 'yellow'"} {"question": "What are the names of all movies directed by Steven Spielberg?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE director = 'Steven Spielberg'"} {"question": "List all the subject names.\nAdditional table information: table: e_learning", "answer": "SELECT subject_name FROM SUBJECTS"} {"question": "What are the distinct address type codes for all customer addresses?\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT DISTINCT address_type_code FROM customer_addresses"} {"question": "What is the first names of the professors from the history department who do not teach a class.\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num"} {"question": "Show all the cinema names and opening years in descending order of opening year.\nAdditional table information: table: cinema", "answer": "SELECT name, openning_year FROM cinema ORDER BY openning_year DESC"} {"question": "What are the names of rooms whose reservation frequency exceeds 60 times?\nAdditional table information: table: inn_1", "answer": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60"} {"question": "Show different parties of people along with the number of people in each party.\nAdditional table information: table: debate", "answer": "SELECT Party, COUNT(*) FROM people GROUP BY Party"} {"question": "What are the completion dates of all the tests that have result 'Fail'?\nAdditional table information: table: e_learning", "answer": "SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = 'Fail'"} {"question": "Which parties have hosts of age above 50? Give me the party locations.\nAdditional table information: table: party_host", "answer": "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"} {"question": "List in alphabetic order the names of all distinct instructors.\nAdditional table information: table: college_2", "answer": "SELECT DISTINCT name FROM instructor ORDER BY name NULLS FIRST"} {"question": "Count the number of regions.\nAdditional table information: table: party_people", "answer": "SELECT COUNT(*) FROM region"} {"question": "Show the names of members and names of colleges they go to.\nAdditional table information: table: decoration_competition", "answer": "SELECT T2.Name, T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID"} {"question": "How many students whose are playing the role of goalie?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM tryout WHERE pPos = 'goalie'"} {"question": "How many institutions do not have an associated protein in our record?\nAdditional table information: table: protein_institute", "answer": "SELECT COUNT(*) FROM institution WHERE NOT institution_id IN (SELECT institution_id FROM protein)"} {"question": "Find the name of dorms only for female (F gender).\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm WHERE gender = 'F'"} {"question": "What apartment type codes and apartment numbers do the buildings managed by 'Kyle' have?\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = 'Kyle'"} {"question": "Of all the claims, what was the earliest date when any claim was made?\nAdditional table information: table: insurance_policies", "answer": "SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC NULLS FIRST LIMIT 1"} {"question": "List the names of all the distinct customers who bought a keyboard.\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = 'keyboard'"} {"question": "Who made the latest order?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1"} {"question": "What are the names of regions with two or more storms?\nAdditional table information: table: storm_record", "answer": "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"} {"question": "What are the ids of all aircrafts that can cover a distance of more than 1000?\nAdditional table information: table: flight_1", "answer": "SELECT aid FROM Aircraft WHERE distance > 1000"} {"question": "What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*), T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year"} {"question": "Find the policy types more than 4 customers use. Show their type code.\nAdditional table information: table: insurance_fnol", "answer": "SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING COUNT(*) > 4"} {"question": "Show the names of journalists and the names of the events they reported in ascending order\nAdditional table information: table: news_report", "answer": "SELECT T3.Name, T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance ASC NULLS FIRST"} {"question": "What are the names of stations that are located in Palo Alto city but have never been the ending point of trips more than 100 times?\nAdditional table information: table: bike_1", "answer": "SELECT name FROM station WHERE city = 'Palo Alto' EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING COUNT(*) > 100"} {"question": "What are the names of rooms that have either king or queen bed?\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms WHERE bedType = 'King' OR bedType = 'Queen'"} {"question": "Return the names of products that have had complaints filed by the customer who has filed the fewest complaints.\nAdditional table information: table: customer_complaints", "answer": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id, customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What are the total number of domestic passengers at all London airports?\nAdditional table information: table: aircraft", "answer": "SELECT SUM(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE '%London%'"} {"question": "What are the total amount and average amount paid in claim headers?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT SUM(amount_piad), AVG(amount_piad) FROM claim_headers"} {"question": "What is the first and last name of the student participating in the most activities?\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which workshop groups have bookings with status code 'stop'? Give me the names.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = 'stop'"} {"question": "What is the average bike availability in stations that are not located in Palo Alto?\nAdditional table information: table: bike_1", "answer": "SELECT AVG(bikes_available) FROM status WHERE NOT station_id IN (SELECT id FROM station WHERE city = 'Palo Alto')"} {"question": "What is the number of cities in the United States with more than 3 airports?\nAdditional table information: table: flight_4", "answer": "SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3"} {"question": "Find the average age of female students.\nAdditional table information: table: voter_2", "answer": "SELECT AVG(Age) FROM STUDENT WHERE Sex = 'F'"} {"question": "For each product, show its name and the number of times it was ordered.\nAdditional table information: table: tracking_orders", "answer": "SELECT T3.product_name, COUNT(*) FROM orders AS T1, order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id"} {"question": "How many settlements does each claim correspond to? List the claim id and the number of settlements.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.Claim_id, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id"} {"question": "What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2"} {"question": "Which location has the most corresponding counties?\nAdditional table information: table: county_public_safety", "answer": "SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which people severed as comptroller most frequently? Give me the name of the person and the frequency count.\nAdditional table information: table: election", "answer": "SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show all school names in alphabetical order.\nAdditional table information: table: school_finance", "answer": "SELECT school_name FROM school ORDER BY school_name NULLS FIRST"} {"question": "Which classrooms are used by grade 4?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT classroom FROM list WHERE grade = 4"} {"question": "How many students are enrolled in some classes that are taught by an accounting professor?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'"} {"question": "Return the different statuses of cities, ascending by frequency.\nAdditional table information: table: farm", "answer": "SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC NULLS FIRST"} {"question": "What are the first names of all professors not teaching any classes?\nAdditional table information: table: college_1", "answer": "SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num"} {"question": "Show the ids for all the students who participate in an activity and are under 20.\nAdditional table information: table: activity_1", "answer": "SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20"} {"question": "What are the first and last names of all students who are living in a dorm with a TV Lounge?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')"} {"question": "How many students are there in total?\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(*) FROM STUDENT"} {"question": "Which city is the address of the store named 'FJA Filming' located in?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = 'FJA Filming'"} {"question": "Find the city that hosted some events in the most recent year. What is the id of this city?\nAdditional table information: table: city_record", "answer": "SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1"} {"question": "Show the name and description of the role played by the employee named Ebba.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = 'Ebba'"} {"question": "Find the names of the regions which were affected by the storm that killed the greatest number of people.\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Return the characters and durations for each actor.\nAdditional table information: table: musical", "answer": "SELECT Character, Duration FROM actor"} {"question": "What are the name and the nationality of the host of the highest age?\nAdditional table information: table: party_host", "answer": "SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1"} {"question": "Show the name of aircraft which fewest people have its certificate.\nAdditional table information: table: flight_1", "answer": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average age of female (sex is F) students?\nAdditional table information: table: voter_2", "answer": "SELECT AVG(Age) FROM STUDENT WHERE Sex = 'F'"} {"question": "Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM College WHERE enr < 13000 AND state = 'AZ' UNION SELECT cName FROM College WHERE enr > 15000 AND state = 'LA'"} {"question": "Find the contact channel code that was used by the customer named 'Tillman Ernser'.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Tillman Ernser'"} {"question": "Find the first name of students who are living in the Smith Hall.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall'"} {"question": "Show the phone, room, and building for the faculty named Jerry Prince.\nAdditional table information: table: activity_1", "answer": "SELECT phone, room, building FROM Faculty WHERE Fname = 'Jerry' AND Lname = 'Prince'"} {"question": "Find the number of students in total.\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(*) FROM STUDENT"} {"question": "What is highest rating for the most recent movie and when was it released?\nAdditional table information: table: movie_1", "answer": "SELECT MAX(T1.stars), T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MAX(YEAR) FROM Movie)"} {"question": "Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.\nAdditional table information: table: workshop_paper", "answer": "SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80"} {"question": "Find the id of users who are followed by Mary or Susan.\nAdditional table information: table: twitter_1", "answer": "SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = 'Mary' OR T1.name = 'Susan'"} {"question": "Return the name and gender of the staff who was assigned in 2016.\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE '2016%'"} {"question": "Show the name and service for all trains in order by time.\nAdditional table information: table: train_station", "answer": "SELECT name, service FROM train ORDER BY TIME NULLS FIRST"} {"question": "What are the different positions of players from UCLA or Duke colleges?\nAdditional table information: table: match_season", "answer": "SELECT DISTINCT POSITION FROM match_season WHERE College = 'UCLA' OR College = 'Duke'"} {"question": "What are the reigns and days held of all wrestlers?\nAdditional table information: table: wrestler", "answer": "SELECT Reign, Days_held FROM wrestler"} {"question": "return all columns of the albums created in the year of 2012.\nAdditional table information: table: music_2", "answer": "SELECT * FROM Albums WHERE YEAR = 2012"} {"question": "What is the shortest and most poorly rated song for each genre, ordered alphabetically by genre?\nAdditional table information: table: music_1", "answer": "SELECT MIN(T1.duration), MIN(T2.rating), T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is NULLS FIRST"} {"question": "Show the names for all females from Canada having a wedding in year 2016.\nAdditional table information: table: wedding", "answer": "SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada'"} {"question": "What document status codes do we have?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_status_code FROM Ref_Document_Status"} {"question": "What are the average, maximum and total revenues of all companies?\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(revenue), MAX(revenue), SUM(revenue) FROM manufacturers"} {"question": "What are the names of customers who have a savings balance lower than their checking balance, and what is the total of their checking and savings balances?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance"} {"question": "Tell me the first and last name of the student who has the most activities.\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many songs have 4 minute duration?\nAdditional table information: table: music_1", "answer": "SELECT COUNT(*) FROM files WHERE duration LIKE '4:%'"} {"question": "Which film actor (actress) starred the most films? List his or her first name, last name and actor id.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show all the distinct institution types.\nAdditional table information: table: protein_institute", "answer": "SELECT DISTINCT TYPE FROM institution"} {"question": "Find the names of the artists who have produced English songs but have never received rating higher than 8.\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT artist_name FROM song WHERE languages = 'english' EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8"} {"question": "What are the types and countries of competitions?\nAdditional table information: table: sports_competition", "answer": "SELECT Competition_type, Country FROM competition"} {"question": "How many professors are in the accounting dept?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = 'Accounting'"} {"question": "What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200"} {"question": "Find the average number of bedrooms of all the apartments.\nAdditional table information: table: apartment_rentals", "answer": "SELECT AVG(bedroom_count) FROM Apartments"} {"question": "What are the names and scores of wines that are made of white color grapes?\nAdditional table information: table: wine_1", "answer": "SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White'"} {"question": "How many different songs have shared vocals?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = 'shared'"} {"question": "Find the id of the appointment with the most recent start date?\nAdditional table information: table: hospital_1", "answer": "SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1"} {"question": "Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Christop'"} {"question": "What are the unit of measure and category code for the 'chervil' product?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'chervil'"} {"question": "Find the document type name of the document named 'How to read a book'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = 'How to read a book'"} {"question": "Which colleges do the tryout players whose name starts with letter D go to?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'"} {"question": "Order denominations in descending order of the count of schools with the denomination. Return each denomination with the count of schools.\nAdditional table information: table: school_player", "answer": "SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC"} {"question": "find the names of programs whose origin is not in Beijing.\nAdditional table information: table: program_share", "answer": "SELECT name FROM program WHERE origin <> 'Beijing'"} {"question": "What are the names of entrepreneurs whose investor is not 'Rachel Elnaugh'?\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> 'Rachel Elnaugh'"} {"question": "Which customer made the largest amount of claim in a single claim? Return the customer details.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT MAX(amount_claimed) FROM claim_headers)"} {"question": "find the number of medicines offered by each trade.\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT trade_name, COUNT(*) FROM medicine GROUP BY trade_name"} {"question": "Find the customer name and date of the orders that have the status 'Delivered'.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = 'Delivered'"} {"question": "Find the id of routes whose source and destination airports are in the United States.\nAdditional table information: table: flight_4", "answer": "SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')"} {"question": "Find the last name of the staff member who processed the complaint of the cheapest product.\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price NULLS FIRST LIMIT 1"} {"question": "What are the names and location of the shops in ascending alphabetical order of name.\nAdditional table information: table: device", "answer": "SELECT Shop_Name, LOCATION FROM shop ORDER BY Shop_Name ASC NULLS FIRST"} {"question": "For the oldest movie listed, what is its average rating and title?\nAdditional table information: table: movie_1", "answer": "SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(YEAR) FROM Movie)"} {"question": "Find the policy type used by more than 4 customers.\nAdditional table information: table: insurance_fnol", "answer": "SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING COUNT(*) > 4"} {"question": "Show details of all investors if they make any transaction with share count greater than 100.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100"} {"question": "What are the names of all customers, ordered by account balance?\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer ORDER BY acc_bal NULLS FIRST"} {"question": "Give me the name and description of the document type code RV.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = 'RV'"} {"question": "What is the document type name and the document type description and creation date for all the documents?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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"} {"question": "What are the address and phone number of the buildings managed by 'Brenden'?\nAdditional table information: table: apartment_rentals", "answer": "SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = 'Brenden'"} {"question": "List all location codes and location names.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code, location_name FROM Ref_locations"} {"question": "What are all the the participant ids, type code and details?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants"} {"question": "What are the first, middle, and last names of all staff?\nAdditional table information: table: driving_school", "answer": "SELECT first_name, middle_name, last_name FROM Staff"} {"question": "What are the different album labels listed?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT label FROM Albums"} {"question": "What are the names and descriptions of the photos taken at the tourist attraction 'film festival'?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'film festival'"} {"question": "What is the first and last name of the student who played the most sports?\nAdditional table information: table: game_1", "answer": "SELECT T2.Fname, T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the title, credit value, and department name for courses with more than one prerequisite?\nAdditional table information: table: college_2", "answer": "SELECT T1.title, T1.credits, T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) > 1"} {"question": "What are the names of climbers who are not from the country of Switzerland?\nAdditional table information: table: climbing", "answer": "SELECT Name FROM climber WHERE Country <> 'Switzerland'"} {"question": "Show the ids of all employees who don't destroy any document.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "What is the total amount of products purchased before 2018-03-17 07:13:53?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < '2018-03-17 07:13:53'"} {"question": "How many female Professors do we have?\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = 'Professor'"} {"question": "What are the ids of all reviewers who did not give 4 stars?\nAdditional table information: table: movie_1", "answer": "SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4"} {"question": "Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.\nAdditional table information: table: phone_market", "answer": "SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking NULLS FIRST"} {"question": "What are the last names of students in room 111?\nAdditional table information: table: student_1", "answer": "SELECT lastname FROM list WHERE classroom = 111"} {"question": "What are the names of everybody sorted by age in descending order?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person ORDER BY age DESC"} {"question": "Which problems are reported by the staff with last name 'Bosco'? Show the ids of the problems.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = 'Bosco'"} {"question": "Find the top 3 wineries with the greatest number of wines made of white color grapes.\nAdditional table information: table: wine_1", "answer": "SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = 'White' GROUP BY T2.Winery ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Find the full names of faculties who are members of department with department number 520.\nAdditional table information: table: college_3", "answer": "SELECT T1.Fname, T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520"} {"question": "Find the maximum and minimum millisecond lengths of pop tracks.\nAdditional table information: table: chinook_1", "answer": "SELECT MAX(Milliseconds), MIN(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Pop'"} {"question": "A list of the top 5 countries by number of invoices. List country name and number of invoices.\nAdditional table information: table: store_1", "answer": "SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5"} {"question": "Which parties have delegates in both the 'Appropriations' committee and the 'Economic Matters' committee?\nAdditional table information: table: election", "answer": "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'"} {"question": "What is the average speed of roller coasters?\nAdditional table information: table: roller_coaster", "answer": "SELECT AVG(Speed) FROM roller_coaster"} {"question": "List the campuses in Los Angeles county.\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE county = 'Los Angeles'"} {"question": "Show the date valid from and the date valid to for the card with card number '4560596484842'.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT date_valid_from, date_valid_to FROM Customers_cards WHERE card_number = '4560596484842'"} {"question": "What are the distinct details of invoices created before 1989-09-03 or after 2007-12-25?\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < '1989-09-03' OR invoice_date > '2007-12-25'"} {"question": "Please show the software platforms of devices in descending order of the count.\nAdditional table information: table: device", "answer": "SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC"} {"question": "What is the number of professors for different school?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code"} {"question": "What are the first and last names of all students who are not living in the city HKG and order the results by age?\nAdditional table information: table: dorm_1", "answer": "SELECT fname, lname FROM student WHERE city_code <> 'HKG' ORDER BY age NULLS FIRST"} {"question": "List the titles of the papers whose authors are from the institution 'Indiana University'.\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'Indiana University'"} {"question": "What is the name of the customer who has made the minimum amount of payment in one claim?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT MIN(amount_piad) FROM claim_headers)"} {"question": "List the publisher of the publication with the highest price.\nAdditional table information: table: book_2", "answer": "SELECT Publisher FROM publication ORDER BY Price DESC LIMIT 1"} {"question": "What are the names of people who have a height greater than 200 or less than 190?\nAdditional table information: table: candidate_poll", "answer": "SELECT name FROM people WHERE height > 200 OR height < 190"} {"question": "What are the name and level of catalog structure with level number between 5 and 10\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10"} {"question": "What is the count of enzymes without any interactions?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction)"} {"question": "Show the names of employees that work for companies with sales bigger than 200.\nAdditional table information: table: company_employee", "answer": "SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200"} {"question": "Where us the club named 'Tennis Club' located?\nAdditional table information: table: club_1", "answer": "SELECT clublocation FROM club WHERE clubname = 'Tennis Club'"} {"question": "What are the names of all songs that are approximately 4 minutes long or are in English?\nAdditional table information: table: music_1", "answer": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE '4:%' UNION SELECT song_name FROM song WHERE languages = 'english'"} {"question": "How many engineer visits are required at most for a single fault log? List the number and the log entry id.\nAdditional table information: table: assets_maintenance", "answer": "SELECT COUNT(*), T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the number of routes operated by the airline American Airlines whose destinations are in Italy?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'"} {"question": "What are the dates of ceremony and results for each music festival?\nAdditional table information: table: music_4", "answer": "SELECT Date_of_ceremony, RESULT FROM music_festival"} {"question": "What are the first name and department name of all employees?\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id"} {"question": "How many albums has Billy Cobam released?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = 'Billy Cobham'"} {"question": "How many draft copies does the document with id 2 have?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2"} {"question": "List the name of the shop with the latest open year.\nAdditional table information: table: device", "answer": "SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1"} {"question": "Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.\nAdditional table information: table: college_2", "answer": "SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "What are the maximum and minimum sales of the companies whose industries are not 'Banking'.\nAdditional table information: table: company_office", "answer": "SELECT MAX(Sales_billion), MIN(Sales_billion) FROM Companies WHERE Industry <> 'Banking'"} {"question": "Report the name of all campuses in Los Angeles county.\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE county = 'Los Angeles'"} {"question": "What are the distinct reigns of wrestlers whose location is not 'Tokyo,Japan' ?\nAdditional table information: table: wrestler", "answer": "SELECT DISTINCT Reign FROM wrestler WHERE LOCATION <> 'Tokyo , Japan'"} {"question": "What is the total number of residents for the districts with the 3 largest areas?\nAdditional table information: table: store_product", "answer": "SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3"} {"question": "What are the document ids for the budget type code 'SF'?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF'"} {"question": "Find the ids of all the order items whose product id is 11.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_item_id FROM order_items WHERE product_id = 11"} {"question": "Give the name of the department with the lowest budget.\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM department ORDER BY budget NULLS FIRST LIMIT 1"} {"question": "What are the top 3 artists with the largest number of songs in the language Bangla?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'bangla' GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What is the color description of the product with name 'catnip'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = 'catnip'"} {"question": "Return the different classes of races.\nAdditional table information: table: race_track", "answer": "SELECT DISTINCT CLASS FROM race"} {"question": "What are the maximum and minimum number of cows across all farms.\nAdditional table information: table: farm", "answer": "SELECT MAX(Cows), MIN(Cows) FROM farm"} {"question": "Return the average, maximum, and total revenues across all manufacturers.\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(revenue), MAX(revenue), SUM(revenue) FROM manufacturers"} {"question": "Count the number of customers.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Customers"} {"question": "Show names for all employees with salary more than the average.\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Employee WHERE salary > (SELECT AVG(salary) FROM Employee)"} {"question": "What are the maximum and minimum number of silver medals for clubs.\nAdditional table information: table: sports_competition", "answer": "SELECT MAX(Silver), MIN(Silver) FROM club_rank"} {"question": "Return the id of the staff whose Staff Department Assignment was earlier than that of any Clerical Staff.\nAdditional table information: table: department_store", "answer": "SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT MAX(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff')"} {"question": "What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?\nAdditional table information: table: hr_1", "answer": "SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000"} {"question": "For each policy type, return its type code and its count in the record.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT policy_type_code, COUNT(*) FROM policies GROUP BY policy_type_code"} {"question": "List the writers who have written more than one book.\nAdditional table information: table: book_2", "answer": "SELECT Writer FROM book GROUP BY Writer HAVING COUNT(*) > 1"} {"question": "Give me the temperature of Shanghai in January.\nAdditional table information: table: city_record", "answer": "SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = 'Shanghai'"} {"question": "How many faculty lines are there in the university that conferred the most number of degrees in year 2002?\nAdditional table information: table: csu_1", "answer": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1"} {"question": "How long does student Linda Smith spend on the restaurant in total?\nAdditional table information: table: restaurant_1", "answer": "SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = 'Linda' AND Student.Lname = 'Smith'"} {"question": "List the names of members in ascending alphabetical order.\nAdditional table information: table: decoration_competition", "answer": "SELECT Name FROM member ORDER BY Name ASC NULLS FIRST"} {"question": "What are all the characteristic names of product 'sesame'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'sesame'"} {"question": "What are the roles with three or more employees? Give me the role codes.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code FROM Employees GROUP BY role_code HAVING COUNT(*) >= 3"} {"question": "What is the employee id of the head whose department has the least number of employees?\nAdditional table information: table: hospital_1", "answer": "SELECT head FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) NULLS FIRST LIMIT 1"} {"question": "Please show the themes of competitions with host cities having populations larger than 1000.\nAdditional table information: table: farm", "answer": "SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000"} {"question": "Return the publisher that has published the most books.\nAdditional table information: table: culture_company", "answer": "SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names of the swimmers who have both 'win' and 'loss' results in the record.\nAdditional table information: table: swimming", "answer": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss'"} {"question": "what are the names of people who did not participate in the candidate election.\nAdditional table information: table: candidate_poll", "answer": "SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate)"} {"question": "Show the name of the county with the biggest population.\nAdditional table information: table: election", "answer": "SELECT County_name FROM county ORDER BY Population DESC LIMIT 1"} {"question": "How many stations are in Mountain View?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(*) FROM station WHERE city = 'Mountain View'"} {"question": "Cound the number of artists who have not released an album.\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM ARTIST WHERE NOT artistid IN (SELECT artistid FROM ALBUM)"} {"question": "Count the number of patients who stayed in room 112.\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(patient) FROM stay WHERE room = 112"} {"question": "Which allergy is the most common?\nAdditional table information: table: allergy_1", "answer": "SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of wrestlers days held less than 100?\nAdditional table information: table: wrestler", "answer": "SELECT Name FROM wrestler WHERE Days_held < 100"} {"question": "What is the description for the CIS-220 and how many credits does it have?\nAdditional table information: table: college_1", "answer": "SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220'"} {"question": "Find the number of complaints with Product Failure type for each complaint status.\nAdditional table information: table: customer_complaints", "answer": "SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = 'Product Failure' GROUP BY complaint_status_code"} {"question": "What are the names of members who are not in charge of any events?\nAdditional table information: table: party_people", "answer": "SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id"} {"question": "Show all product sizes.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT DISTINCT product_size FROM Products"} {"question": "Which department has the highest average instructor salary?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC LIMIT 1"} {"question": "What is the name and capacity of the dorm with the fewest amount of amenities?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Find the names of the chip models that are not used by any phone with full accreditation type.\nAdditional table information: table: phone_1", "answer": "SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full'"} {"question": "Return the decor of the room named 'Recluse and defiance'.\nAdditional table information: table: inn_1", "answer": "SELECT decor FROM Rooms WHERE roomName = 'Recluse and defiance'"} {"question": "Show the name and phone of the customer without any mailshot.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM mailshot_customers)"} {"question": "Give the total money requested by entrepreneurs who are taller than 1.85.\nAdditional table information: table: entrepreneur", "answer": "SELECT SUM(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85"} {"question": "Find the distinct last names of all the students who have president votes and whose advisor is 8741.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = '8741'"} {"question": "How many train stations are there?\nAdditional table information: table: train_station", "answer": "SELECT COUNT(*) FROM station"} {"question": "Find the title of all the albums of the artist 'AC/DC'.\nAdditional table information: table: chinook_1", "answer": "SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = 'AC/DC'"} {"question": "Show student ids for all male students.\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Student WHERE Sex = 'M'"} {"question": "List countries that have more than one swimmer.\nAdditional table information: table: swimming", "answer": "SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1"} {"question": "How many participants belong to the type 'Organizer'?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer'"} {"question": "Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.\nAdditional table information: table: manufacturer", "answer": "SELECT name, open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10"} {"question": "What are all the distinct payment types?\nAdditional table information: table: products_for_hire", "answer": "SELECT DISTINCT payment_type_code FROM payments"} {"question": "What is the name and open year for the branch with most number of memberships registered in 2016?\nAdditional table information: table: shop_membership", "answer": "SELECT T2.name, T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all departments in alphabetical order?\nAdditional table information: table: college_1", "answer": "SELECT dept_name FROM department ORDER BY dept_name NULLS FIRST"} {"question": "Show the most common country across members.\nAdditional table information: table: decoration_competition", "answer": "SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.\nAdditional table information: table: match_season", "answer": "SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Forward' INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Defender'"} {"question": "What is the sum of budgets of the Marketing and Finance departments?\nAdditional table information: table: college_2", "answer": "SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'"} {"question": "Show names of musicals and the number of actors who have appeared in the musicals.\nAdditional table information: table: musical", "answer": "SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID"} {"question": "What are the student ids of students who don't have any allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy"} {"question": "Tell me the booking status code for the apartment with number 'Suite 634'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = 'Suite 634'"} {"question": "What are the names of the states that have some college students playing in the positions of goalie and mid-field?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'"} {"question": "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.\nAdditional table information: table: local_govt_mdm", "answer": "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"} {"question": "List all every engineer's first name, last name, details and coresponding skill description.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.first_name, T1.last_name, T1.other_details, T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id"} {"question": "Count the number of documents with expenses.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Documents_with_expenses"} {"question": "Return the description and unit of measurement for products in the 'Herbs' category.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'"} {"question": "What are the names of all products?\nAdditional table information: table: manufactory_1", "answer": "SELECT Name FROM Products"} {"question": "What is the average horizontal bar points for all gymnasts?\nAdditional table information: table: gymnast", "answer": "SELECT AVG(Horizontal_Bar_Points) FROM gymnast"} {"question": "List the names of clubs that do not have any players.\nAdditional table information: table: sports_competition", "answer": "SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player)"} {"question": "Find the first names and last names of teachers in alphabetical order of last name.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT first_name, last_name FROM Teachers ORDER BY last_name NULLS FIRST"} {"question": "Find how many school locations have the word 'NY'.\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(*) FROM university WHERE LOCATION LIKE '%NY%'"} {"question": "What is the latitude, longitude, city of the station from which the shortest trip started?\nAdditional table information: table: bike_1", "answer": "SELECT T1.lat, T1.long, T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration NULLS FIRST LIMIT 1"} {"question": "Show the name of aircrafts with top three lowest distances.\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Aircraft ORDER BY distance NULLS FIRST LIMIT 3"} {"question": "List the names of companies in descending order of market value.\nAdditional table information: table: company_office", "answer": "SELECT name FROM Companies ORDER BY Market_Value_billion DESC"} {"question": "For each zip code, select all those that have an average mean visiblity below 10.\nAdditional table information: table: bike_1", "answer": "SELECT zip_code FROM weather GROUP BY zip_code HAVING AVG(mean_visibility_miles) < 10"} {"question": "Find the first names of the faculty members who participate in Canoeing and Kayaking.\nAdditional table information: table: activity_1", "answer": "SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Kayaking'"} {"question": "Which customer is associated with the latest policy?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.start_date = (SELECT MAX(start_date) FROM policies)"} {"question": "Show names of technicians and the number of machines they are assigned to repair.\nAdditional table information: table: machine_repair", "answer": "SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name"} {"question": "Return names of songs in volumes that are by artists that are at least 32 years old.\nAdditional table information: table: music_4", "answer": "SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32"} {"question": "Find the id of the order which is shipped most recently.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments)"} {"question": "Count the number of customers that have the customer type that is most common.\nAdditional table information: table: customer_complaints", "answer": "SELECT COUNT(*) FROM customers GROUP BY customer_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "For each staff id, what is the description of the role that is involved with the most number of projects?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all aircrafts that have won a match at least twice?\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2"} {"question": "Show id, first name and last name for all customers and the number of accounts.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id"} {"question": "List all information about college sorted by enrollment number in the ascending order.\nAdditional table information: table: soccer_2", "answer": "SELECT * FROM College ORDER BY enr NULLS FIRST"} {"question": "Find the first names of students studying in room 108.\nAdditional table information: table: student_1", "answer": "SELECT firstname FROM list WHERE classroom = 108"} {"question": "What are the different types of player positions?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(DISTINCT pPos) FROM tryout"} {"question": "Show the different statuses and the numbers of roller coasters for each status.\nAdditional table information: table: roller_coaster", "answer": "SELECT Status, COUNT(*) FROM roller_coaster GROUP BY Status"} {"question": "How many products have the characteristic named 'hot'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'hot'"} {"question": "What is the total number of campuses?\nAdditional table information: table: csu_1", "answer": "SELECT COUNT(*) FROM campuses"} {"question": "What are the maximum and minimum number of cities in all markets.\nAdditional table information: table: film_rank", "answer": "SELECT MAX(Number_cities), MIN(Number_cities) FROM market"} {"question": "What are the names of the 3 departments with the most courses?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "How many different services are provided by all stations?\nAdditional table information: table: station_weather", "answer": "SELECT COUNT(DISTINCT services) FROM station"} {"question": "List all directors along with the number of films directed by each director.\nAdditional table information: table: cinema", "answer": "SELECT directed_by, COUNT(*) FROM film GROUP BY directed_by"} {"question": "Which catalog content has the highest height? Give me the catalog entry name.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1"} {"question": "What are the different names and countries of origins for all artists whose song ratings are above 9?\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9"} {"question": "List the names of people that are not perpetrators.\nAdditional table information: table: perpetrator", "answer": "SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator)"} {"question": "Show the location code of the country 'Canada'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code FROM Ref_locations WHERE location_name = 'Canada'"} {"question": "What are the first names of all history professors who do not teach?\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num"} {"question": "What are the different product names, and what is the sum of quantity ordered for each product?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.product_name, SUM(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name"} {"question": "What are the names, headquarters and revenues for manufacturers, sorted by revenue descending?\nAdditional table information: table: manufactory_1", "answer": "SELECT name, headquarter, revenue FROM manufacturers ORDER BY revenue DESC"} {"question": "List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_id FROM Documents WHERE document_status_code = 'done' AND document_type_code = 'Paper' INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = 'USPS'"} {"question": "display the country ID and number of cities for each country.\nAdditional table information: table: hr_1", "answer": "SELECT country_id, COUNT(*) FROM locations GROUP BY country_id"} {"question": "what is the name of every pilot who is at least 25 years old?\nAdditional table information: table: aircraft", "answer": "SELECT Name FROM pilot WHERE Age >= 25"} {"question": "Find the total number of students and total number of instructors for each department.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT T2.id), COUNT(DISTINCT T3.id), T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name"} {"question": "What are the countries that have at least two perpetrators?\nAdditional table information: table: perpetrator", "answer": "SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2"} {"question": "What is the first and last name of artist who performed 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Le Pop'"} {"question": "Find the last names of all the teachers that teach GELL TAMI.\nAdditional table information: table: student_1", "answer": "SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'GELL' AND T1.lastname = 'TAMI'"} {"question": "List the name of the phone model launched in year 2002 and with the highest RAM size.\nAdditional table information: table: phone_1", "answer": "SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1"} {"question": "What is the average gpa of the students enrolled in the course with code ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'"} {"question": "What is the average and maximum number of total passengers for train stations in London or Glasgow?\nAdditional table information: table: train_station", "answer": "SELECT AVG(total_passengers), MAX(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow'"} {"question": "Return the codes of the document types that do not have a total access count of over 10000.\nAdditional table information: table: document_management", "answer": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000"} {"question": "What is the campus fee of 'San Jose State University' in year 1996?\nAdditional table information: table: csu_1", "answer": "SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND T2.year = 1996"} {"question": "Find the name of the program that is broadcast most frequently.\nAdditional table information: table: program_share", "answer": "SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all districts with a city area greater than 10 or have more than 100000 people living there?\nAdditional table information: table: store_product", "answer": "SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000"} {"question": "What are the countries of mountains with height bigger than 5000?\nAdditional table information: table: climbing", "answer": "SELECT Country FROM mountain WHERE Height > 5000"} {"question": "Show all video games with type Collectible card game.\nAdditional table information: table: game_1", "answer": "SELECT gname FROM Video_games WHERE gtype = 'Collectible card game'"} {"question": "What are the full name (first and last name) and salary for all employees who does not have any value for commission?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary FROM employees WHERE commission_pct = 'null'"} {"question": "What is the total share of transactions?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT SUM(share_count) FROM TRANSACTIONS"} {"question": "What is all the product data, as well as each product's manufacturer?\nAdditional table information: table: manufactory_1", "answer": "SELECT * FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code"} {"question": "List the names of departments where some physicians are primarily affiliated with.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1"} {"question": "What are the distinct first names and cities of the students who have allergy either to milk or to cat?\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT T1.fname, T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = 'Milk' OR T2.Allergy = 'Cat'"} {"question": "Find the average age of the members in the club 'Bootup Baltimore'.\nAdditional table information: table: club_1", "answer": "SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore'"} {"question": "Find the name, age, and job title of persons who are friends with Alice for the longest years.\nAdditional table information: table: network_2", "answer": "SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice')"} {"question": "What is the most frequently ordered product? Tell me the detail of the product\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.\nAdditional table information: table: device", "answer": "SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008"} {"question": "How many invoices were billed from each state?\nAdditional table information: table: store_1", "answer": "SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = 'USA' GROUP BY billing_state"} {"question": "Find the total savings balance of all accounts except the account with name \u2018Brown\u2019.\nAdditional table information: table: small_bank_1", "answer": "SELECT SUM(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name <> 'Brown'"} {"question": "How many perpetrators are there?\nAdditional table information: table: perpetrator", "answer": "SELECT COUNT(*) FROM perpetrator"} {"question": "How many reviewers are there?\nAdditional table information: table: movie_1", "answer": "SELECT COUNT(*) FROM Reviewer"} {"question": "How many artists do not have any album?\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM ARTIST WHERE NOT artistid IN (SELECT artistid FROM ALBUM)"} {"question": "What is the average account balance of customers with credit score below 50 for the different account types?\nAdditional table information: table: loan_1", "answer": "SELECT AVG(acc_bal), acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type"} {"question": "Find the list of attribute data types possessed by more than 3 attribute definitions.\nAdditional table information: table: product_catalog", "answer": "SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING COUNT(*) > 3"} {"question": "List all budget type codes and descriptions.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT budget_type_code, budget_type_description FROM Ref_budget_codes"} {"question": "How many animal type allergies exist?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Allergy_type WHERE allergytype = 'animal'"} {"question": "Tell me the name of the most pricy product.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1"} {"question": "What is the official name and status of the city with the most residents?\nAdditional table information: table: farm", "answer": "SELECT Official_Name, Status FROM city ORDER BY Population DESC LIMIT 1"} {"question": "Find the average and maximum rating of all reviews.\nAdditional table information: table: epinions_1", "answer": "SELECT AVG(rating), MAX(rating) FROM review"} {"question": "Show all cities and corresponding number of students.\nAdditional table information: table: allergy_1", "answer": "SELECT city_code, COUNT(*) FROM Student GROUP BY city_code"} {"question": "How many captains with younger than 50 are in each rank?\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank"} {"question": "What are all the distinct participant ids who attended any events?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events"} {"question": "What are the names of all instructors who have taught a course, as well as the corresponding course id?\nAdditional table information: table: college_2", "answer": "SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID"} {"question": "Find the title of course whose prerequisite is course Differential Geometry.\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry')"} {"question": "What are the building, room number, semester and year of courses in the Psychology department, sorted using course title?\nAdditional table information: table: college_2", "answer": "SELECT T2.building, T2.room_number, T2.semester, T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title NULLS FIRST"} {"question": "List the carriers of devices in ascending alphabetical order.\nAdditional table information: table: device", "answer": "SELECT Carrier FROM device ORDER BY Carrier ASC NULLS FIRST"} {"question": "What are the maximum duration and resolution of songs grouped and ordered by languages?\nAdditional table information: table: music_1", "answer": "SELECT MAX(T1.duration), MAX(T2.resolution), T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.languages ORDER BY T2.languages NULLS FIRST"} {"question": "What are the different main industries for all companies?\nAdditional table information: table: gas_company", "answer": "SELECT DISTINCT main_industry FROM company"} {"question": "Which policy type has the most records in the database?\nAdditional table information: table: insurance_fnol", "answer": "SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which allergy has most number of students affected?\nAdditional table information: table: allergy_1", "answer": "SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the id and name of the enzyme with most number of medicines that can interact as 'activator'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the papers published under the institution 'Indiana University'?\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'Indiana University'"} {"question": "Find the county where produces the most number of wines with score higher than 90.\nAdditional table information: table: wine_1", "answer": "SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Compute the average active time span of contact channels.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels"} {"question": "What is the title and id of the film that has the greatest number of copies in inventory?\nAdditional table information: table: sakila_1", "answer": "SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the count of cities with more than 3 airports?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3)"} {"question": "How many fault status codes are recorded in the fault log parts table?\nAdditional table information: table: assets_maintenance", "answer": "SELECT DISTINCT fault_status FROM Fault_Log_Parts"} {"question": "What are the cities that have more than 2 airports sorted by number of airports?\nAdditional table information: table: flight_4", "answer": "SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) NULLS FIRST"} {"question": "What is the id and family name of the driver who has the longest laptime?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1"} {"question": "What are the employee ids of the employees whose role name is 'Human Resource' or 'Manager'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Human Resource' OR T2.role_name = 'Manager'"} {"question": "Display the first and last name, and salary for those employees whose first name is ending with the letter m.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary FROM employees WHERE first_name LIKE '%m'"} {"question": "What are the zip codes that have an average mean humidity below 70 and had at least 100 trips come through there?\nAdditional table information: table: bike_1", "answer": "SELECT zip_code FROM weather GROUP BY zip_code HAVING AVG(mean_humidity) < 70 INTERSECT SELECT zip_code FROM trip GROUP BY zip_code HAVING COUNT(*) >= 100"} {"question": "Find the number of scientists involved for the projects that require more than 300 hours.\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name"} {"question": "What is the film title and inventory id of the item in the inventory which was rented most frequently?\nAdditional table information: table: sakila_1", "answer": "SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "With which kind of payment method were the least number of payments processed?\nAdditional table information: table: insurance_policies", "answer": "SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Count the number of distinct names associated with the photos.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT COUNT(DISTINCT Name) FROM PHOTOS"} {"question": "For each injury accident, find the date of the game and the name of the injured player in the game, and sort the results in descending order of game season.\nAdditional table information: table: game_injury", "answer": "SELECT T1.date, T2.player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id ORDER BY T1.season DESC"} {"question": "Find the number of customers who live in the city called Lake Geovannyton.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = 'Lake Geovannyton'"} {"question": "Show all party names and their region names.\nAdditional table information: table: party_people", "answer": "SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id"} {"question": "What is the most popular first name of the actors?\nAdditional table information: table: sakila_1", "answer": "SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "show the name of all bridges that was designed by american archtect, and sort the result by the bridge feet length.\nAdditional table information: table: architecture", "answer": "SELECT t1.name FROM bridge AS t1 JOIN architect AS t2 ON t1.architect_id = t2.id WHERE t2.nationality = 'American' ORDER BY t1.length_feet NULLS FIRST"} {"question": "Show ids for the faculty members who don't advise any student.\nAdditional table information: table: activity_1", "answer": "SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student"} {"question": "How many tasks does each project have? List the task count and the project detail.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id"} {"question": "For each dorm, how many amenities does it have?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid"} {"question": "Give the title of the prerequisite to the course International Finance.\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')"} {"question": "What are the full names of actors who had roles in more than 30 films?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30"} {"question": "What are the names of all aircrafts that are associated with both London Heathrow and Gatwick airports?\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Heathrow' INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick'"} {"question": "What are the employee ids and job ids for employees who make less than the lowest earning employee with title MK_MAN?\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, job_id FROM employees WHERE salary < (SELECT MIN(salary) FROM employees WHERE job_id = 'MK_MAN')"} {"question": "Which minister left office the latest?\nAdditional table information: table: party_people", "answer": "SELECT minister FROM party ORDER BY left_office DESC LIMIT 1"} {"question": "What is the description for the budget type with code ORG?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = 'ORG'"} {"question": "Which countries has the most number of airlines whose active status is 'Y'?\nAdditional table information: table: flight_4", "answer": "SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is Nancy Edwards's address?\nAdditional table information: table: store_1", "answer": "SELECT address FROM employees WHERE first_name = 'Nancy' AND last_name = 'Edwards'"} {"question": "How many different kinds of information sources are there for injury accidents?\nAdditional table information: table: game_injury", "answer": "SELECT COUNT(DISTINCT SOURCE) FROM injury_accident"} {"question": "What are the distinct publishers of publications with price higher than 5000000?\nAdditional table information: table: book_2", "answer": "SELECT DISTINCT Publisher FROM publication WHERE Price > 5000000"} {"question": "How many aircrafts do we have?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Aircraft"} {"question": "Show home city where at least two drivers older than 40 are from.\nAdditional table information: table: school_bus", "answer": "SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2"} {"question": "What are the official native languages that contain the string 'English'.\nAdditional table information: table: match_season", "answer": "SELECT Official_native_language FROM country WHERE Official_native_language LIKE '%English%'"} {"question": "Which events id does not have any participant with detail 'Kenyatta Kuhn'?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn'"} {"question": "Show the headquarters that have at least two companies.\nAdditional table information: table: company_employee", "answer": "SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2"} {"question": "Which student's age is older than 18 and is majoring in 600? List each student's first and last name.\nAdditional table information: table: restaurant_1", "answer": "SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major = 600"} {"question": "Show the manager name with most number of gas stations opened after 2000.\nAdditional table information: table: gas_company", "answer": "SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the category code and typical price of 'cumin'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_category_code, typical_buying_price FROM products WHERE product_name = 'cumin'"} {"question": "Find the the date of enrollment of the 'Spanish' course.\nAdditional table information: table: e_learning", "answer": "SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'Spanish'"} {"question": "Which are the first and last names of the students taught by MARROTTE KIRK?\nAdditional table information: table: student_1", "answer": "SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'MARROTTE' AND T2.lastname = 'KIRK'"} {"question": "What is the headquarter of the company whose founder is James?\nAdditional table information: table: manufactory_1", "answer": "SELECT headquarter FROM manufacturers WHERE founder = 'James'"} {"question": "What are the id of each employee and the number of document destruction authorised by that employee?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID"} {"question": "What are the total number of students enrolled in ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'"} {"question": "Find the distinct first names of all the students who have vice president votes and whose city code is not PIT.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = 'PIT'"} {"question": "Tell me the price ranges for all the hotels.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT price_range FROM HOTELS"} {"question": "Find the first names of students with age above 22.\nAdditional table information: table: voter_2", "answer": "SELECT Fname FROM STUDENT WHERE Age > 22"} {"question": "Show the church names for the weddings of all people older than 30.\nAdditional table information: table: wedding", "answer": "SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30"} {"question": "How many friends does Dan have?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'"} {"question": "What are all the different first names of the drivers who are in position as standing and won?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1"} {"question": "Find the players' first name and last name who won award both in 1960 and in 1961.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_first, T1.name_last FROM player AS T1, player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1, player_award AS T2 WHERE T2.year = 1961"} {"question": "Return the cities with more than 3 airports in the United States.\nAdditional table information: table: flight_4", "answer": "SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3"} {"question": "Return the title of the film with the highest high estimate?\nAdditional table information: table: film_rank", "answer": "SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1"} {"question": "List the name of artworks that are not nominated.\nAdditional table information: table: entertainment_awards", "answer": "SELECT Name FROM Artwork WHERE NOT Artwork_ID IN (SELECT Artwork_ID FROM nomination)"} {"question": "Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000"} {"question": "How many accelerators are not compatible with the browsers listed ?\nAdditional table information: table: browser_web", "answer": "SELECT COUNT(*) FROM web_client_accelerator WHERE NOT id IN (SELECT accelerator_id FROM accelerator_compatible_browser)"} {"question": "Find the the name of the customers who have a loan with amount more than 3000.\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000"} {"question": "What are the names of all the physicians who took appointments.\nAdditional table information: table: hospital_1", "answer": "SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID"} {"question": "What is the number of departments in Division 'AS'?\nAdditional table information: table: college_3", "answer": "SELECT COUNT(*) FROM DEPARTMENT WHERE Division = 'AS'"} {"question": "List the venues of debates in ascending order of the number of audience.\nAdditional table information: table: debate", "answer": "SELECT Venue FROM debate ORDER BY Num_of_Audience ASC NULLS FIRST"} {"question": "Find all the vocal types.\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT TYPE FROM vocals"} {"question": "List the hardware model name for the phons that were produced by 'Nokia Corporation' but whose screen mode type is not Text.\nAdditional table information: table: phone_1", "answer": "SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = 'Nokia Corporation' AND T1.Type <> 'Text'"} {"question": "Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?\nAdditional table information: table: city_record", "answer": "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"} {"question": "Return the names of wrestlers with fewer than 100 days held.\nAdditional table information: table: wrestler", "answer": "SELECT Name FROM wrestler WHERE Days_held < 100"} {"question": "What is the total number of hours per work and number of games played by David Shieber?\nAdditional table information: table: game_1", "answer": "SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = 'David' AND T2.Lname = 'Shieber'"} {"question": "List the titles of books that are not published.\nAdditional table information: table: book_2", "answer": "SELECT Title FROM book WHERE NOT Book_ID IN (SELECT Book_ID FROM publication)"} {"question": "What is the invoice number and invoice date for the invoice with most number of transactions?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.invoice_number, T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the id and last name of the driver who participated in the most races after 2010?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the bed type and name of all the rooms with traditional decor?\nAdditional table information: table: inn_1", "answer": "SELECT roomName, bedType FROM Rooms WHERE decor = 'traditional'"} {"question": "What are the student IDs for everybody who worked for more than 10 hours per week on all sports?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10"} {"question": "Show the name and population of the country that has the highest roller coaster.\nAdditional table information: table: roller_coaster", "answer": "SELECT T1.Name, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1"} {"question": "Which complaint status has more than 3 records on file?\nAdditional table information: table: customer_complaints", "answer": "SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3"} {"question": "Show all distinct publishers for books.\nAdditional table information: table: culture_company", "answer": "SELECT DISTINCT publisher FROM book_club"} {"question": "What is the total number of people who has no friend living in the city of Austin.\nAdditional table information: table: network_2", "answer": "SELECT COUNT(DISTINCT name) FROM PersonFriend WHERE NOT friend IN (SELECT name FROM person WHERE city = 'Austin')"} {"question": "What are the names of parties that do not have delegates in election?\nAdditional table information: table: election", "answer": "SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election)"} {"question": "How many Professors are in building NEB?\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Faculty WHERE Rank = 'Professor' AND building = 'NEB'"} {"question": "What are the first and last names of the top 10 longest-serving employees?\nAdditional table information: table: store_1", "answer": "SELECT first_name, last_name FROM employees ORDER BY hire_date ASC NULLS FIRST LIMIT 10"} {"question": "Count the number of cinemas.\nAdditional table information: table: cinema", "answer": "SELECT COUNT(*) FROM cinema"} {"question": "What is the count of states with college students playing in the mid position but not as goalies?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')"} {"question": "What are the times used by climbers who climbed mountains in the country of Uganda?\nAdditional table information: table: climbing", "answer": "SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = 'Uganda'"} {"question": "Show different types of ships and the number of ships of each type.\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE"} {"question": "Show the names of the three most recent festivals.\nAdditional table information: table: entertainment_awards", "answer": "SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3"} {"question": "What is the average distance and average price for flights from Los Angeles.\nAdditional table information: table: flight_1", "answer": "SELECT AVG(distance), AVG(price) FROM Flight WHERE origin = 'Los Angeles'"} {"question": "What are the names of perpetrators in country 'China' or 'Japan'?\nAdditional table information: table: perpetrator", "answer": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = 'China' OR T2.Country = 'Japan'"} {"question": "Count the number of different affiliation types.\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(DISTINCT affiliation) FROM university"} {"question": "Return the apartment numbers of the apartments with type code 'Flat'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_number FROM Apartments WHERE apt_type_code = 'Flat'"} {"question": "List the names of aircrafts and the number of times it won matches.\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft"} {"question": "Show the card type codes and the number of transactions.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T2.card_type_code, COUNT(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code"} {"question": "Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000"} {"question": "What are the names of the instructors in the Comp. Sci. department who earn more than 80000?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000"} {"question": "Find the name of the user who gave the highest rating.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1"} {"question": "What is the total number of people who have no friends living in Austin?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(DISTINCT name) FROM PersonFriend WHERE NOT friend IN (SELECT name FROM person WHERE city = 'Austin')"} {"question": "What are the different states that have students trying out?\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName"} {"question": "What are the names of the amenities that Smith Hall has?\nAdditional table information: table: dorm_1", "answer": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall'"} {"question": "Show the maximum share count of transactions where the amount is smaller than 10000\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT MAX(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000"} {"question": "How many video game types exist?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(DISTINCT gtype) FROM Video_games"} {"question": "What is the average age for each dorm and what are the names of each dorm?\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name"} {"question": "What is the average, maximum, and minimum for the number of hours spent training?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(HS), MAX(HS), MIN(HS) FROM Player"} {"question": "How many songs have a lead vocal?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = 'lead'"} {"question": "What are the names of tourist attraction that Alison visited but Rosalind did not visit?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Alison' EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Rosalind'"} {"question": "What are the songs in volumes associated with the artist aged 32 or older?\nAdditional table information: table: music_4", "answer": "SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32"} {"question": "What are the minimum and maximum crime rate of counties?\nAdditional table information: table: county_public_safety", "answer": "SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety"} {"question": "What is total amount claimed summed across all the claims?\nAdditional table information: table: insurance_policies", "answer": "SELECT SUM(Amount_Claimed) FROM Claims"} {"question": "How many tracks are in each genre?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*), T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name"} {"question": "What is the name of the student who has the highest total credits in the History department.\nAdditional table information: table: college_2", "answer": "SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1"} {"question": "Return the id of the customer who has the most cards, as well as the number of cards.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the track that has had the greatest number of races?\nAdditional table information: table: race_track", "answer": "SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many colors are there?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM ref_colors"} {"question": "Find the number of people who is under 40 for each gender.\nAdditional table information: table: network_2", "answer": "SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender"} {"question": "List the names of the employees who authorized the destruction of documents and the employees who destroyed the corresponding documents.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.employee_name, T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id"} {"question": "Find the name and email of the users who have more than 1000 followers.\nAdditional table information: table: twitter_1", "answer": "SELECT name, email FROM user_profiles WHERE followers > 1000"} {"question": "Which campus was opened between 1935 and 1939?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939"} {"question": "What are the hometowns that are shared by at least two gymnasts?\nAdditional table information: table: gymnast", "answer": "SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2"} {"question": "How many courses have more than 2 credits?\nAdditional table information: table: college_3", "answer": "SELECT COUNT(*) FROM COURSE WHERE Credits > 2"} {"question": "What are the names and locations of tracks that have had exactly 1 race?\nAdditional table information: table: race_track", "answer": "SELECT T2.name, T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING COUNT(*) = 1"} {"question": "Count the number of classrooms in Lamberton.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'"} {"question": "List the authors of submissions in ascending order of scores.\nAdditional table information: table: workshop_paper", "answer": "SELECT Author FROM submission ORDER BY Scores ASC NULLS FIRST"} {"question": "Whah are the name of each industry and the number of companies in that industry?\nAdditional table information: table: company_office", "answer": "SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry"} {"question": "Find the average grade point of student whose last name is Smith.\nAdditional table information: table: college_3", "answer": "SELECT AVG(T2.gradepoint) FROM ENROLLED_IN AS T1, GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = 'Smith'"} {"question": "What is all the information about the basketball match?\nAdditional table information: table: university_basketball", "answer": "SELECT * FROM basketball_match"} {"question": "What is the name and salary of the employee with the id 242518965?\nAdditional table information: table: flight_1", "answer": "SELECT name, salary FROM Employee WHERE eid = 242518965"} {"question": "What is the team with at least 2 technicians?\nAdditional table information: table: machine_repair", "answer": "SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2"} {"question": "Find the description of the club called 'Tennis Club'.\nAdditional table information: table: club_1", "answer": "SELECT clubdesc FROM club WHERE clubname = 'Tennis Club'"} {"question": "What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?\nAdditional table information: table: mountain_photos", "answer": "SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus'"} {"question": "Find the person who has exactly one friend.\nAdditional table information: table: network_2", "answer": "SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1"} {"question": "In which year did the most recent crime happen?\nAdditional table information: table: perpetrator", "answer": "SELECT MAX(YEAR) FROM perpetrator"} {"question": "Find the average number of customers in all banks of Utah state.\nAdditional table information: table: loan_1", "answer": "SELECT AVG(no_of_customers) FROM bank WHERE state = 'Utah'"} {"question": "Which customer status code has least number of customers?\nAdditional table information: table: driving_school", "answer": "SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What are the names of customers who have taken out more than one loan?\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING COUNT(*) > 1"} {"question": "Show all artist names and the year joined who are not from United States.\nAdditional table information: table: theme_gallery", "answer": "SELECT name, year_join FROM artist WHERE country <> 'United States'"} {"question": "Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000"} {"question": "Count the number of races.\nAdditional table information: table: race_track", "answer": "SELECT COUNT(*) FROM race"} {"question": "Show the opening year in whcih at least two churches opened.\nAdditional table information: table: wedding", "answer": "SELECT open_date FROM church GROUP BY open_date HAVING COUNT(*) >= 2"} {"question": "Find the name of dorms that do not have any amenity\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity)"} {"question": "Find the title of courses that have two prerequisites?\nAdditional table information: table: college_2", "answer": "SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2"} {"question": "Which cities have lower temperature in March than in Dec and have never served as host cities?\nAdditional table information: table: city_record", "answer": "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"} {"question": "Find the number of different cities that employees live in.\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(DISTINCT city) FROM EMPLOYEE"} {"question": "Show names of technicians in ascending order of quality rank of the machine they are assigned.\nAdditional table information: table: machine_repair", "answer": "SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank NULLS FIRST"} {"question": "How many customers are there?\nAdditional table information: table: customer_complaints", "answer": "SELECT COUNT(*) FROM customers"} {"question": "Count the number of entrepreneurs.\nAdditional table information: table: entrepreneur", "answer": "SELECT COUNT(*) FROM entrepreneur"} {"question": "What is the customer last name, id and phone number with most number of orders?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.customer_last_name, T1.customer_id, T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "For each journal_committee, find the editor name and the journal theme.\nAdditional table information: table: journal_committee", "answer": "SELECT T2.Name, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID"} {"question": "List the states which have between 2 to 4 staffs living there.\nAdditional table information: table: driving_school", "answer": "SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4"} {"question": "Return the full name and id of the actor or actress who starred in the greatest number of films.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all friends who are from New York?\nAdditional table information: table: network_2", "answer": "SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'"} {"question": "What are the names of all instructors with a higher salary than any of the instructors in the Biology department?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE salary > (SELECT MAX(salary) FROM instructor WHERE dept_name = 'Biology')"} {"question": "What are the maximum and minimum product prices for each product type?\nAdditional table information: table: department_store", "answer": "SELECT product_type_code, MAX(product_price), MIN(product_price) FROM products GROUP BY product_type_code"} {"question": "What are the official languages of the countries of players from Maryland or Duke college?\nAdditional table information: table: match_season", "answer": "SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = 'Maryland' OR T2.College = 'Duke'"} {"question": "Give me the descriptions of the service types that cost more than 100.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100"} {"question": "What is the sport with the most scholarship students?\nAdditional table information: table: game_1", "answer": "SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of parties that have both delegates on 'Appropriations' committee and\nAdditional table information: table: election", "answer": "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'"} {"question": "Find the details of all the distinct customers who have orders with status 'On Road'.\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road'"} {"question": "What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM song WHERE resolution > (SELECT AVG(resolution) FROM song WHERE genre_is = 'modern')"} {"question": "How many roles are there?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM ROLES"} {"question": "What are the total number of the audiences who visited any of the festivals?\nAdditional table information: table: entertainment_awards", "answer": "SELECT SUM(Num_of_Audience) FROM festival_detail"} {"question": "How many artists do we have?\nAdditional table information: table: theme_gallery", "answer": "SELECT COUNT(*) FROM artist"} {"question": "List the names of technicians who have not been assigned to repair machines.\nAdditional table information: table: machine_repair", "answer": "SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment)"} {"question": "What are the ids of the faculty members who do not advise any student.\nAdditional table information: table: activity_1", "answer": "SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student"} {"question": "What are the names and dates of races, and the names of the tracks where they are held?\nAdditional table information: table: race_track", "answer": "SELECT T1.name, T1.date, T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id"} {"question": "Find the first names of all the teachers that teach in classroom 110.\nAdditional table information: table: student_1", "answer": "SELECT firstname FROM teachers WHERE classroom = 110"} {"question": "Find the checking balance and saving balance in the Brown\u2019s account.\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'"} {"question": "What are the ids of stations that have latitude above 37.4 and never had bike availability below 7?\nAdditional table information: table: bike_1", "answer": "SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING MIN(bikes_available) < 7"} {"question": "What are the name, origin and owner of each program?\nAdditional table information: table: program_share", "answer": "SELECT name, origin, OWNER FROM program"} {"question": "How many students are affected by each allergy type?\nAdditional table information: table: allergy_1", "answer": "SELECT T2.allergytype, COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype"} {"question": "What are the names of courses that give either 3 credits, or 1 credit and 4 hours?\nAdditional table information: table: college_3", "answer": "SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4"} {"question": "Find the ids of orders which are shipped after 2000-01-01.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id FROM shipments WHERE shipment_date > '2000-01-01'"} {"question": "What is the total number of products that are in orders with status 'Cancelled'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = 'Cancelled'"} {"question": "Select the average price of each manufacturer's products, showing only the manufacturer's code.\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(Price), manufacturer FROM Products GROUP BY manufacturer"} {"question": "Which buildings have apartments that have more than two bathrooms? Give me the addresses of the buildings.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2"} {"question": "Find the last name of the author with first name 'Amal'.\nAdditional table information: table: icfp_1", "answer": "SELECT lname FROM authors WHERE fname = 'Amal'"} {"question": "What is the average number of hours spent practicing for students who got rejected?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'"} {"question": "What are the dates of transactions with at least 100 share count or amount bigger than 100?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100"} {"question": "How old is the average person for each job?\nAdditional table information: table: network_2", "answer": "SELECT AVG(age), job FROM Person GROUP BY job"} {"question": "What are the first and last names of all customers with between 1000 and 3000 dollars outstanding?\nAdditional table information: table: driving_school", "answer": "SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000"} {"question": "What are the distinct first names, last names, and phone numbers for customers with accounts?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT DISTINCT T1.customer_first_name, T1.customer_last_name, T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id"} {"question": "Which vocal type has the band mate with last name 'Heilo' played the most?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = 'Heilo' GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the id of the files that are available in the format of mp4 and a resolution smaller than 1000?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM files WHERE formats = 'mp4' INTERSECT SELECT f_id FROM song WHERE resolution < 1000"} {"question": "What are the speeds of the longest roller coaster?\nAdditional table information: table: roller_coaster", "answer": "SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1"} {"question": "Find the total number of employees.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM employee"} {"question": "How many main stream browsers whose market share is at least 5 exist?\nAdditional table information: table: browser_web", "answer": "SELECT COUNT(*) FROM browser WHERE market_share >= 5"} {"question": "Return the staff ids and genders for any staff with the title Department Manager.\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Department Manager'"} {"question": "What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies.\nAdditional table information: table: allergy_1", "answer": "SELECT T1.Allergy, T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = 'Lisa' ORDER BY T1.Allergy NULLS FIRST"} {"question": "What information is there on albums from 2010?\nAdditional table information: table: music_2", "answer": "SELECT * FROM Albums WHERE YEAR = 2010"} {"question": "What are the different years for all competitions that are not of type equal to tournament?\nAdditional table information: table: sports_competition", "answer": "SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> 'Tournament'"} {"question": "What are lines 1 and 2 of the addressed of the customer with the email 'vbogisich@example.org'?\nAdditional table information: table: customer_complaints", "answer": "SELECT address_line_1, address_line_2 FROM customers WHERE email_address = 'vbogisich@example.org'"} {"question": "What are the different ranges of the 3 mountains with the highest prominence?\nAdditional table information: table: climbing", "answer": "SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3"} {"question": "What are the different software platforms for devices, ordered by frequency descending?\nAdditional table information: table: device", "answer": "SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC"} {"question": "List the names of editors in ascending order of age.\nAdditional table information: table: journal_committee", "answer": "SELECT Name FROM editor ORDER BY Age ASC NULLS FIRST"} {"question": "What are the minimum and maximum vote percents of elections?\nAdditional table information: table: election_representative", "answer": "SELECT MIN(Vote_Percent), MAX(Vote_Percent) FROM election"} {"question": "What are the different district names in order of descending city area?\nAdditional table information: table: store_product", "answer": "SELECT DISTINCT District_name FROM district ORDER BY city_area DESC"} {"question": "What are the names of all songs produced by the artist with the first name 'Marianne'?\nAdditional table information: table: music_2", "answer": "SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = 'Marianne'"} {"question": "Which customer made the smallest amount of claim in one claim? Return the customer details.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT MIN(amount_piad) FROM claim_headers)"} {"question": "Which order deals with the most items? Return the order id.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the amount of the largest payment.\nAdditional table information: table: sakila_1", "answer": "SELECT amount FROM payment ORDER BY amount DESC LIMIT 1"} {"question": "Find the distinct unit prices for tracks.\nAdditional table information: table: chinook_1", "answer": "SELECT DISTINCT (UnitPrice) FROM TRACK"} {"question": "Find the last names of the students in third grade that are not taught by COVIN JEROME.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> 'COVIN' AND T2.lastname <> 'JEROME'"} {"question": "Find the first name of students who are living in the dorm that has most number of amenities.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What are the names of scientists who have not been assigned a project?\nAdditional table information: table: scientist_1", "answer": "SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)"} {"question": "What are the booking start and end dates of the apartments with more than 2 bedrooms?\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2"} {"question": "What is the color code and description of the product named 'chervil'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.color_code, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = 'chervil'"} {"question": "Return the total points of the gymnast with the lowest age.\nAdditional table information: table: gymnast", "answer": "SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC NULLS FIRST LIMIT 1"} {"question": "What are the different card types, and how many cards are there of each?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_type_code, COUNT(*) FROM Customers_cards GROUP BY card_type_code"} {"question": "Find the last name and hire date of the professor who is in office DRE 102.\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'"} {"question": "Find the first name and last name of the instructor of course that has course name\nAdditional table information: table: college_3", "answer": "SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = 'COMPUTER LITERACY'"} {"question": "What is the average length in feet of the bridges?\nAdditional table information: table: architecture", "answer": "SELECT AVG(length_feet) FROM bridge"} {"question": "List the names of wrestlers in descending order of days held.\nAdditional table information: table: wrestler", "answer": "SELECT Name FROM wrestler ORDER BY Days_held DESC"} {"question": "How many premises are there?\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT COUNT(*) FROM premises"} {"question": "Find the names of all instructors who have taught some course and the course_id.\nAdditional table information: table: college_2", "answer": "SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID"} {"question": "Return the names and ids of each account, as well as the number of transactions.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.account_name, T1.account_id, COUNT(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id"} {"question": "Show the distinct themes of journals.\nAdditional table information: table: journal_committee", "answer": "SELECT DISTINCT Theme FROM journal"} {"question": "Find the marketing region description of China?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = 'China'"} {"question": "List all employees in the circulation history of the document with id 1. List the employee's name.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1"} {"question": "What are the first names of the professors who do not teach a class.\nAdditional table information: table: college_1", "answer": "SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num"} {"question": "Find the id of the order made most recently.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1"} {"question": "Where does the staff member with the first name Elsa live?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa'"} {"question": "What is the investor that has invested in the most number of entrepreneurs?\nAdditional table information: table: entrepreneur", "answer": "SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Who is the oldest person?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person)"} {"question": "Find the name of all customers whose name contains 'Alex'.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers WHERE customer_name LIKE '%Alex%'"} {"question": "Show the transaction type code that occurs the most frequently.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all directors who made one movie?\nAdditional table information: table: movie_1", "answer": "SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1"} {"question": "What are the names of the courses in alphabetical order?\nAdditional table information: table: student_assessment", "answer": "SELECT course_name FROM courses ORDER BY course_name NULLS FIRST"} {"question": "Show all the faculty ranks and the number of students advised by each rank.\nAdditional table information: table: activity_1", "answer": "SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank"} {"question": "What are the all games score and location of the school called Clemson?\nAdditional table information: table: university_basketball", "answer": "SELECT t2.All_Games, t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'"} {"question": "When did the first payment happen?\nAdditional table information: table: sakila_1", "answer": "SELECT payment_date FROM payment ORDER BY payment_date ASC NULLS FIRST LIMIT 1"} {"question": "What are the ids of all songs that have higher resolution of the average resolution in the modern genre?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM song WHERE resolution > (SELECT AVG(resolution) FROM song WHERE genre_is = 'modern')"} {"question": "What are the aircrafts with top 3 shortest lengthes? List their names.\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Aircraft ORDER BY distance NULLS FIRST LIMIT 3"} {"question": "Find the female friends of Alice.\nAdditional table information: table: network_2", "answer": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'"} {"question": "What are the names of courses with 1 credit?\nAdditional table information: table: college_3", "answer": "SELECT CName FROM COURSE WHERE Credits = 1"} {"question": "What is the oldest age among the students?\nAdditional table information: table: voter_2", "answer": "SELECT MAX(Age) FROM STUDENT"} {"question": "Find the name of physicians who are affiliated with both Surgery and Psychiatry departments.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Psychiatry'"} {"question": "List the main industry with highest total market value and its number of companies.\nAdditional table information: table: gas_company", "answer": "SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1"} {"question": "How many policies are listed for the customer named 'Dayana Robel'?\nAdditional table information: table: insurance_fnol", "answer": "SELECT COUNT(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Dayana Robel'"} {"question": "Find the name, checking balance and saving balance of all accounts in the bank.\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid"} {"question": "Return the names of artists and the themes of their exhibitions that had a ticket price higher than average.\nAdditional table information: table: theme_gallery", "answer": "SELECT T1.theme, T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT AVG(ticket_price) FROM exhibition)"} {"question": "What is the name of the nurse has the most appointments?\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many employees who are IT staff are from each city?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*), city FROM employees WHERE title = 'IT Staff' GROUP BY city"} {"question": "What is the campus fee of 'San Francisco State University' in year 1996?\nAdditional table information: table: csu_1", "answer": "SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = 'San Francisco State University' AND T2.year = 1996"} {"question": "Count the number of storms in which at least 1 person died.\nAdditional table information: table: storm_record", "answer": "SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0"} {"question": "List the name and residence for players whose occupation is not 'Researcher'.\nAdditional table information: table: riding_club", "answer": "SELECT Player_name, residence FROM player WHERE Occupation <> 'Researcher'"} {"question": "Compute the total amount of settlement across all the settlements.\nAdditional table information: table: insurance_policies", "answer": "SELECT SUM(Amount_Settled) FROM Settlements"} {"question": "What are the names and genders of staff who have held the title Sales Person, but never Clerical Staff?\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Sales Person' EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Clerical Staff'"} {"question": "What are the different role codes for users, and how many users have each?\nAdditional table information: table: document_management", "answer": "SELECT COUNT(*), role_code FROM users GROUP BY role_code"} {"question": "What are the details of the shops that can be accessed by walk?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk'"} {"question": "Find all the locations whose names contain the word 'film'.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE '%film%'"} {"question": "How many cities are in counties that have populations of over 20000?\nAdditional table information: table: county_public_safety", "answer": "SELECT COUNT(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000)"} {"question": "What is the first name and last name of the customer that has email 'luisg@embraer.com.br'?\nAdditional table information: table: chinook_1", "answer": "SELECT FirstName, LastName FROM CUSTOMER WHERE Email = 'luisg@embraer.com.br'"} {"question": "Find the name and position of the head of the department with the least employees.\nAdditional table information: table: hospital_1", "answer": "SELECT T2.name, T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY COUNT(departmentID) NULLS FIRST LIMIT 1"} {"question": "What are the first name and last name of the players who have weight above 220 or height below 75?\nAdditional table information: table: baseball_1", "answer": "SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75"} {"question": "What is the total salary expenses of team Boston Red Stockings in 2010?\nAdditional table information: table: baseball_1", "answer": "SELECT SUM(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2010"} {"question": "Show the details of all trucks in the order of their license number.\nAdditional table information: table: customer_deliveries", "answer": "SELECT truck_details FROM trucks ORDER BY truck_licence_number NULLS FIRST"} {"question": "What is the average distance and price for all flights from LA?\nAdditional table information: table: flight_1", "answer": "SELECT AVG(distance), AVG(price) FROM Flight WHERE origin = 'Los Angeles'"} {"question": "List the names of all left-footed players who have overall rating between 85 and 90.\nAdditional table information: table: soccer_1", "answer": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = 'left' AND T2.overall_rating >= 85 AND T2.overall_rating <= 90"} {"question": "How many movie ratings have more than 3 stars?\nAdditional table information: table: movie_1", "answer": "SELECT COUNT(*) FROM Rating WHERE stars > 3"} {"question": "What is the total amount of money loaned by banks in New York state?\nAdditional table information: table: loan_1", "answer": "SELECT SUM(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York'"} {"question": "What is the average price for flights from LA to Honolulu?\nAdditional table information: table: flight_1", "answer": "SELECT AVG(price) FROM Flight WHERE origin = 'Los Angeles' AND destination = 'Honolulu'"} {"question": "What is the name of the customer who has made the largest amount of claim in a single claim?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT MAX(amount_claimed) FROM claim_headers)"} {"question": "What are the names of different music genres?\nAdditional table information: table: chinook_1", "answer": "SELECT Name FROM GENRE"} {"question": "Show the name and the nationality of the oldest host.\nAdditional table information: table: party_host", "answer": "SELECT Name, Nationality FROM HOST ORDER BY Age DESC LIMIT 1"} {"question": "What are the different first names for customers from Brazil who have also had an invoice?\nAdditional table information: table: chinook_1", "answer": "SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = 'Brazil'"} {"question": "For each state, find the total account balance of customers whose credit score is above 100.\nAdditional table information: table: loan_1", "answer": "SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state"} {"question": "Find the names of products that were bought by at least two distinct customers.\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT(DISTINCT T1.customer_id) >= 2"} {"question": "What is the description of the product named 'Chocolate'?\nAdditional table information: table: customer_complaints", "answer": "SELECT product_description FROM products WHERE product_name = 'Chocolate'"} {"question": "What is the name of member in charge of greatest number of events?\nAdditional table information: table: party_people", "answer": "SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List all students' first names and last names who majored in 600.\nAdditional table information: table: restaurant_1", "answer": "SELECT Fname, Lname FROM Student WHERE Major = 600"} {"question": "Show the delegate from district 1 in election.\nAdditional table information: table: election", "answer": "SELECT Delegate FROM election WHERE District = 1"} {"question": "What are the ids of documents which don't have expense budgets?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses"} {"question": "Show names for all regions except for Denmark.\nAdditional table information: table: storm_record", "answer": "SELECT region_name FROM region WHERE region_name <> 'Denmark'"} {"question": "How many distinct complaint type codes are there in the database?\nAdditional table information: table: customer_complaints", "answer": "SELECT COUNT(DISTINCT complaint_type_code) FROM complaints"} {"question": "What are the names of documents that do not have any images?\nAdditional table information: table: document_management", "answer": "SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id"} {"question": "What is the campus fee for San Francisco State University in 1996?\nAdditional table information: table: csu_1", "answer": "SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = 'San Francisco State University' AND T2.year = 1996"} {"question": "IN which year did city 'Taizhou ( Zhejiang )' serve as a host city?\nAdditional table information: table: city_record", "answer": "SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = 'Taizhou ( Zhejiang )'"} {"question": "Find the name of songs that does not have a back vocal.\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = 'back'"} {"question": "Given the titles of all courses, in order of titles and credits.\nAdditional table information: table: college_2", "answer": "SELECT title FROM course ORDER BY title NULLS FIRST, credits NULLS FIRST"} {"question": "Find the id of the order whose shipment tracking number is '3452'.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id FROM shipments WHERE shipment_tracking_number = '3452'"} {"question": "What is the number of flights?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Flight"} {"question": "Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee.\nAdditional table information: table: store_1", "answer": "SELECT T2.first_name, T2.last_name, COUNT(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY COUNT(T1.reports_to) DESC LIMIT 1"} {"question": "What are the duration of the longest and shortest pop tracks in milliseconds?\nAdditional table information: table: chinook_1", "answer": "SELECT MAX(Milliseconds), MIN(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Pop'"} {"question": "Which authors have first name 'Amal'? List their last names.\nAdditional table information: table: icfp_1", "answer": "SELECT lname FROM authors WHERE fname = 'Amal'"} {"question": "How many stadiums does each country have?\nAdditional table information: table: swimming", "answer": "SELECT country, COUNT(*) FROM stadium GROUP BY country"} {"question": "Find the names of all stores in Khanewal District.\nAdditional table information: table: store_product", "answer": "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = 'Khanewal District'"} {"question": "Return the code of the document type that is most common.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average attendance of stadiums with capacity percentage higher than 100%?\nAdditional table information: table: game_injury", "answer": "SELECT average_attendance FROM stadium WHERE capacity_percentage > 100"} {"question": "What are the names of all people, ordered by their date of birth?\nAdditional table information: table: candidate_poll", "answer": "SELECT name FROM people ORDER BY date_of_birth NULLS FIRST"} {"question": "What are the amenities in alphabetical order that Anonymous Donor Hall has?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name NULLS FIRST"} {"question": "List the name, origin and owner of each program.\nAdditional table information: table: program_share", "answer": "SELECT name, origin, OWNER FROM program"} {"question": "How many faculty lines are there at San Francisco State University in 2004?\nAdditional table information: table: csu_1", "answer": "SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = 'San Francisco State University'"} {"question": "How many heads of the departments are older than 56 ?\nAdditional table information: table: department_management", "answer": "SELECT COUNT(*) FROM head WHERE age > 56"} {"question": "what are the top 3 highest support rates?\nAdditional table information: table: candidate_poll", "answer": "SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3"} {"question": "What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?\nAdditional table information: table: driving_school", "answer": "SELECT customer_status_code, cell_mobile_phone_number, email_address FROM Customers WHERE first_name = 'Marina' OR last_name = 'Kohler'"} {"question": "When is the last day any resident moved in?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT MAX(date_moved_in) FROM Residents"} {"question": "Find the state of the college which player Charles is attending.\nAdditional table information: table: soccer_2", "answer": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'"} {"question": "How many technicians are there?\nAdditional table information: table: machine_repair", "answer": "SELECT COUNT(*) FROM technician"} {"question": "Count the number of accounts.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Accounts"} {"question": "Find the classrooms in which grade 4 is studying.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT classroom FROM list WHERE grade = 4"} {"question": "What are the start station's name and id for the one that had the most start trips in August?\nAdditional table information: table: bike_1", "answer": "SELECT start_station_name, start_station_id FROM trip WHERE start_date LIKE '8/%' GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which city has the lowest GDP? Please list the city name and its GDP.\nAdditional table information: table: city_record", "answer": "SELECT city, GDP FROM city ORDER BY GDP NULLS FIRST LIMIT 1"} {"question": "What is the document type code for document type 'Paper'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT document_type_code FROM Ref_document_types WHERE document_type_name = 'Paper'"} {"question": "Show all destinations and the number of flights to each destination.\nAdditional table information: table: flight_1", "answer": "SELECT destination, COUNT(*) FROM Flight GROUP BY destination"} {"question": "Find the names of all patients who have an undergoing treatment and are staying in room 111.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111"} {"question": "Show all home cities except for those having a driver older than 40.\nAdditional table information: table: school_bus", "answer": "SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40"} {"question": "Show the name of ships whose nationality is either United States or United Kingdom.\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship WHERE Nationality = 'United States' OR Nationality = 'United Kingdom'"} {"question": "What are the average score and average staff number of all shops?\nAdditional table information: table: coffee_shop", "answer": "SELECT AVG(num_of_staff), AVG(score) FROM shop"} {"question": "What are names of the movies that are either made before 1980 or directed by James Cameron?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE director = 'James Cameron' OR YEAR < 1980"} {"question": "Show all director names who have a movie in the year 1999 or 2000.\nAdditional table information: table: culture_company", "answer": "SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000"} {"question": "How many students are there?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student"} {"question": "Show all investor details.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT Investor_details FROM INVESTORS"} {"question": "What are the names of the pilots that have not won any matches in Australia?\nAdditional table information: table: aircraft", "answer": "SELECT name FROM pilot WHERE NOT pilot_id IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')"} {"question": "Find the name of amenities Smith Hall dorm have. ordered the results by amenity names.\nAdditional table information: table: dorm_1", "answer": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name NULLS FIRST"} {"question": "Find the ids of orders whose status is 'Success'.\nAdditional table information: table: customer_deliveries", "answer": "SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success'"} {"question": "What is the date, average temperature and mean humidity for the days with the 3 largest maximum gust speeds?\nAdditional table information: table: bike_1", "answer": "SELECT date, mean_temperature_f, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3"} {"question": "Find the names of the courses that have just one student enrollment.\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1"} {"question": "What are the names of staff who have been assigned multiple jobs?\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT(*) > 1"} {"question": "What are the names and job titles of every person ordered alphabetically by name?\nAdditional table information: table: network_2", "answer": "SELECT name, job FROM Person ORDER BY name NULLS FIRST"} {"question": "How many enzymes do not have any interactions?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction)"} {"question": "List the name of tracks belongs to genre Rock or genre Jazz.\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = 'Rock' OR T1.name = 'Jazz'"} {"question": "What are names of patients who made an appointment?\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn"} {"question": "How many clubs are located at 'HHH'?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club WHERE clublocation = 'HHH'"} {"question": "For each director, what is the title and score of their most poorly rated movie?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director"} {"question": "What are the names and types of the companies that have ever operated a flight?\nAdditional table information: table: flight_company", "answer": "SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id"} {"question": "List the locations that are shared by more than two wrestlers.\nAdditional table information: table: wrestler", "answer": "SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2"} {"question": "What are the distinct first names of the students who have class president votes?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE"} {"question": "What are the categories of music festivals for which there have been more than 1 music festival?\nAdditional table information: table: music_4", "answer": "SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1"} {"question": "display job title and average salary of employees.\nAdditional table information: table: hr_1", "answer": "SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title"} {"question": "What is the name, city, and country of the airport with the lowest altitude?\nAdditional table information: table: flight_4", "answer": "SELECT name, city, country FROM airports ORDER BY elevation NULLS FIRST LIMIT 1"} {"question": "Count the number of products.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products"} {"question": "What is the description of document type 'Paper'?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = 'Paper'"} {"question": "What is the name of all tracks in the album named Balls to the Wall?\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = 'Balls to the Wall'"} {"question": "What is the stories of highest building?\nAdditional table information: table: company_office", "answer": "SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1"} {"question": "What is the document status description of the document with id 1?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1"} {"question": "Count the number of clubs located at 'HHH'.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club WHERE clublocation = 'HHH'"} {"question": "For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id"} {"question": "List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000"} {"question": "What are the names of the races held after 2017 in Spain?\nAdditional table information: table: formula_1", "answer": "SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = 'Spain' AND T1.year > 2017"} {"question": "Give the name and building of the departments with greater than average budget.\nAdditional table information: table: college_2", "answer": "SELECT dept_name, building FROM department WHERE budget > (SELECT AVG(budget) FROM department)"} {"question": "Show the park of the roller coaster with the highest speed.\nAdditional table information: table: roller_coaster", "answer": "SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1"} {"question": "Count the number of songs.\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM Songs"} {"question": "Show the id, name of each festival and the number of artworks it has nominated.\nAdditional table information: table: entertainment_awards", "answer": "SELECT T1.Festival_ID, T3.Festival_Name, COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID"} {"question": "Show the average, minimum, and maximum age for different majors.\nAdditional table information: table: game_1", "answer": "SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major"} {"question": "How many exhibition are there in year 2005 or after?\nAdditional table information: table: theme_gallery", "answer": "SELECT COUNT(*) FROM exhibition WHERE YEAR >= 2005"} {"question": "What is the name, account type, and account balance corresponding to the customer with the highest credit score?\nAdditional table information: table: loan_1", "answer": "SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1"} {"question": "What are the job ids corresponding to jobs with average salary above 8000?\nAdditional table information: table: hr_1", "answer": "SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000"} {"question": "What are the names of documents that contain the substring 'CV'?\nAdditional table information: table: document_management", "answer": "SELECT document_name FROM documents WHERE document_name LIKE '%CV%'"} {"question": "Which faculty members advise two ore more students? Give me their faculty ids.\nAdditional table information: table: activity_1", "answer": "SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2"} {"question": "Count the number of colors.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM ref_colors"} {"question": "What are the teams that have the 5 oldest players?\nAdditional table information: table: school_player", "answer": "SELECT Team FROM player ORDER BY Age DESC LIMIT 5"} {"question": "list the first and last names, and the addresses of all employees in the ascending order of their birth date.\nAdditional table information: table: company_1", "answer": "SELECT fname, lname, address FROM employee ORDER BY Bdate NULLS FIRST"} {"question": "Count the number of cities in the state of Colorado.\nAdditional table information: table: e_government", "answer": "SELECT COUNT(*) FROM addresses WHERE state_province_county = 'Colorado'"} {"question": "What are names for top three branches with most number of membership?\nAdditional table information: table: shop_membership", "answer": "SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3"} {"question": "Find the name of students who took some course offered by Statistics department.\nAdditional table information: table: college_2", "answer": "SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'"} {"question": "Show the names of people, and dates and venues of debates they are on the affirmative side.\nAdditional table information: table: debate", "answer": "SELECT T3.Name, T2.Date, T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID"} {"question": "What is the name of the shop that has the greatest quantity of devices in stock?\nAdditional table information: table: device", "answer": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1"} {"question": "Return the lot details of lots that belong to investors with details 'l'?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = 'l'"} {"question": "Find the names of bank branches that have provided a loan to any customer whose credit score is below 100.\nAdditional table information: table: loan_1", "answer": "SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100"} {"question": "List the cities which have more than 2 airports sorted by the number of airports.\nAdditional table information: table: flight_4", "answer": "SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) NULLS FIRST"} {"question": "Show the number of documents with document type code CV or BK.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM All_documents WHERE document_type_code = 'CV' OR document_type_code = 'BK'"} {"question": "How many workshops did each author submit to? Return the author name and the number of workshops.\nAdditional table information: table: workshop_paper", "answer": "SELECT T2.Author, COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author"} {"question": "What is the team name and acc regular season score of the school that was founded for the longest time?\nAdditional table information: table: university_basketball", "answer": "SELECT t2.team_name, t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded NULLS FIRST LIMIT 1"} {"question": "What are the numbers of all flights that can cover a distance of more than 2000?\nAdditional table information: table: flight_1", "answer": "SELECT flno FROM Flight WHERE distance > 2000"} {"question": "What are the maximum and minimum number of silver medals for all the clubs?\nAdditional table information: table: sports_competition", "answer": "SELECT MAX(Silver), MIN(Silver) FROM club_rank"} {"question": "What is the number of faculty lines in campus 'Long Beach State University' in 2002?\nAdditional table information: table: csu_1", "answer": "SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = 'Long Beach State University'"} {"question": "List all document ids and receipt dates of documents.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_id, receipt_date FROM Documents"} {"question": "Retrieve all the last names of authors in alphabetical order.\nAdditional table information: table: icfp_1", "answer": "SELECT lname FROM authors ORDER BY lname NULLS FIRST"} {"question": "How many students does one classroom have?\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*), classroom FROM list GROUP BY classroom"} {"question": "What is the first and last name of the oldest employee?\nAdditional table information: table: college_1", "answer": "SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob NULLS FIRST LIMIT 1"} {"question": "Return the names of the regions affected by storms that had a death count of at least 10.\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Count the number of ships.\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(*) FROM ship"} {"question": "Count the number of rooms in Lamberton with capacity lower than 50.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50"} {"question": "List the id of students who never attends courses?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM students WHERE NOT student_id IN (SELECT student_id FROM student_course_attendance)"} {"question": "What are the names of customers with a higher checking balance than savings balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance"} {"question": "How many services are there?\nAdditional table information: table: e_government", "answer": "SELECT COUNT(*) FROM services"} {"question": "How many games were played in city Atlanta in 2000?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta'"} {"question": "Find the distinct names of all songs that have a higher resolution than some songs in English.\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT MIN(resolution) FROM song WHERE languages = 'english')"} {"question": "What are the names and decor of rooms with a king bed? Sort them by their price\nAdditional table information: table: inn_1", "answer": "SELECT roomName, decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice NULLS FIRST"} {"question": "Return the name of the member who is in charge of the most events.\nAdditional table information: table: party_people", "answer": "SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which major has least number of students? List the major and the number of students.\nAdditional table information: table: restaurant_1", "answer": "SELECT Major, COUNT(*) FROM Student GROUP BY Major ORDER BY COUNT(Major) ASC NULLS FIRST LIMIT 1"} {"question": "Who is the person that has no friend?\nAdditional table information: table: network_2", "answer": "SELECT name FROM person EXCEPT SELECT name FROM PersonFriend"} {"question": "Which cities have regional population above 8000000 or below 5000000?\nAdditional table information: table: city_record", "answer": "SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000"} {"question": "Find the city with the most number of stores.\nAdditional table information: table: store_product", "answer": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the names of companies in the banking or retailing industry?\nAdditional table information: table: company_employee", "answer": "SELECT Name FROM company WHERE Industry = 'Banking' OR Industry = 'Retailing'"} {"question": "What is the name and age of the pilot younger than 30 who has won the most number of times?\nAdditional table information: table: aircraft", "answer": "SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "For each director, how many reviews have they received?\nAdditional table information: table: movie_1", "answer": "SELECT COUNT(*), T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director"} {"question": "What are the names and type codes of products?\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Name, Product_Type_Code FROM Products"} {"question": "Show names of ships involved in a mission launched after 1928.\nAdditional table information: table: ship_mission", "answer": "SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928"} {"question": "Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM procedures WHERE cost < 5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "Find the total revenue created by the companies whose headquarter is located at Austin.\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue) FROM manufacturers WHERE headquarter = 'Austin'"} {"question": "Which program is broadcast most frequently? Give me the program name.\nAdditional table information: table: program_share", "answer": "SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the degrees conferred in 'San Francisco State University' in 2001.\nAdditional table information: table: csu_1", "answer": "SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Francisco State University' AND t2.year = 2001"} {"question": "What are the distinct types of the companies that have operated any flights with velocity less than 200?\nAdditional table information: table: flight_company", "answer": "SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200"} {"question": "What are the maximum and minimum number of transit passengers of all aiports.\nAdditional table information: table: aircraft", "answer": "SELECT MAX(Transit_Passengers), MIN(Transit_Passengers) FROM airport"} {"question": "What is all the information of all the products that have a price between 60 and 120?\nAdditional table information: table: manufactory_1", "answer": "SELECT * FROM products WHERE price BETWEEN 60 AND 120"} {"question": "What are the descriptions for each color?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT color_description FROM ref_colors"} {"question": "Show the status shared by cities with population bigger than 1500 and smaller than 500.\nAdditional table information: table: farm", "answer": "SELECT Status FROM city WHERE Population > 1500 INTERSECT SELECT Status FROM city WHERE Population < 500"} {"question": "What are the ranks of captains that are both in the Cutter and Armed schooner classes?\nAdditional table information: table: ship_1", "answer": "SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'"} {"question": "Find all procedures which cost more than 1000 or which physician John Wen was trained in.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM procedures WHERE cost > 1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "Show name, class, and date for all races.\nAdditional table information: table: race_track", "answer": "SELECT name, CLASS, date FROM race"} {"question": "What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000?\nAdditional table information: table: flight_1", "answer": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List phone number and email address of customer with more than 2000 outstanding balance.\nAdditional table information: table: driving_school", "answer": "SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000"} {"question": "What are the enrollment and primary conference for the university which was founded the earliest?\nAdditional table information: table: university_basketball", "answer": "SELECT enrollment, primary_conference FROM university ORDER BY founded NULLS FIRST LIMIT 1"} {"question": "Show the average amount of transactions for different lots.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id"} {"question": "How many different scientists are assigned to any project?\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(DISTINCT scientist) FROM assignedto"} {"question": "What are the names of ships, ordered by year they were built and their class?\nAdditional table information: table: ship_1", "answer": "SELECT name FROM ship ORDER BY built_year NULLS FIRST, CLASS NULLS FIRST"} {"question": "Tell me the location of the club 'Hopkins Student Enterprises'.\nAdditional table information: table: club_1", "answer": "SELECT clublocation FROM club WHERE clubname = 'Hopkins Student Enterprises'"} {"question": "What are the names of scientists who are assigned to any project?\nAdditional table information: table: scientist_1", "answer": "SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn"} {"question": "Find the total student enrollment for different affiliation type schools.\nAdditional table information: table: university_basketball", "answer": "SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation"} {"question": "What is the name of the department that offers a course that has a description including the word 'Statistics'?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%'"} {"question": "What are the names of the tracks that are Rock or Jazz songs?\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = 'Rock' OR T1.name = 'Jazz'"} {"question": "Show the company of the tallest entrepreneur.\nAdditional table information: table: entrepreneur", "answer": "SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1"} {"question": "What are the details of all sales and purchases?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases"} {"question": "List the file size and format for all songs that have resolution lower than 800.\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800"} {"question": "Which department offers the most credits all together?\nAdditional table information: table: college_1", "answer": "SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY SUM(T1.crs_credit) DESC LIMIT 1"} {"question": "display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working.\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T1.last_name, T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id"} {"question": "Show all directors.\nAdditional table information: table: cinema", "answer": "SELECT DISTINCT directed_by FROM film"} {"question": "What are the ids of the trips that lasted the longest and how long did they last?\nAdditional table information: table: bike_1", "answer": "SELECT id, duration FROM trip ORDER BY duration DESC LIMIT 3"} {"question": "How many players played each position?\nAdditional table information: table: match_season", "answer": "SELECT POSITION, COUNT(*) FROM match_season GROUP BY POSITION"} {"question": "What are the most common types of interactions between enzymes and medicine, and how many types are there?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT interaction_type, COUNT(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the number of parties.\nAdditional table information: table: party_host", "answer": "SELECT COUNT(*) FROM party"} {"question": "List the names of all courses ordered by their titles and credits.\nAdditional table information: table: college_2", "answer": "SELECT title FROM course ORDER BY title NULLS FIRST, credits NULLS FIRST"} {"question": "How many products are there?\nAdditional table information: table: solvency_ii", "answer": "SELECT COUNT(*) FROM Products"} {"question": "What are the draft pick numbers and draft classes for players who play the Defender position?\nAdditional table information: table: match_season", "answer": "SELECT Draft_Pick_Number, Draft_Class FROM match_season WHERE POSITION = 'Defender'"} {"question": "What is the average price of the products for each category?\nAdditional table information: table: customer_complaints", "answer": "SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code"} {"question": "Find the total budgets of the Marketing or Finance department.\nAdditional table information: table: college_2", "answer": "SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'"} {"question": "What are the names of representatives in descending order of votes?\nAdditional table information: table: election_representative", "answer": "SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC"} {"question": "Find the first names of the faculty members who are playing Canoeing or Kayaking.\nAdditional table information: table: activity_1", "answer": "SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'"} {"question": "What is the most common result of the music festival?\nAdditional table information: table: music_4", "answer": "SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names and revenues of the companies with the highest revenues in each headquarter city?\nAdditional table information: table: manufactory_1", "answer": "SELECT name, MAX(revenue), Headquarter FROM manufacturers GROUP BY Headquarter"} {"question": "How many colleges has more than 15000 students?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM College WHERE enr > 15000"} {"question": "What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '254 Ottilie Junction' OR T2.How_to_Get_There = 'bus'"} {"question": "Please show different denominations and the corresponding number of schools in descending order.\nAdditional table information: table: school_player", "answer": "SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC"} {"question": "What is the average price of clothes?\nAdditional table information: table: department_store", "answer": "SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes'"} {"question": "What is the name of teh studio that created the most films?\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the storm name and max speed which affected the greatest number of regions?\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Find the names of programs that are never broadcasted in the morning.\nAdditional table information: table: program_share", "answer": "SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = 'Morning'"} {"question": "What city and state is the bank with the name morningside in?\nAdditional table information: table: loan_1", "answer": "SELECT city, state FROM bank WHERE bname = 'morningside'"} {"question": "Find the names of customers who never placed an order.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id"} {"question": "Find the number of different airports which are the destinations of the American Airlines.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'"} {"question": "What address was the document with id 4 mailed to?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4"} {"question": "What are the ids and details of events that have more than one participants?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT T1.event_id, T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING COUNT(*) > 1"} {"question": "What are the titles of the books whose writer is not 'Elaine Lee'?\nAdditional table information: table: book_2", "answer": "SELECT Title FROM book WHERE Writer <> 'Elaine Lee'"} {"question": "How many credits is the course that the student with the last name Smithson took, and what is its description?\nAdditional table information: table: college_1", "answer": "SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'"} {"question": "What are the ids of courses offered in Fall of 2009 but not in Spring of 2010?\nAdditional table information: table: college_2", "answer": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "Find the grade studying in room 105.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT grade FROM list WHERE classroom = 105"} {"question": "What is the name of the course with the most registered students?\nAdditional table information: table: student_assessment", "answer": "SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the actual delivery dates of orders with quantity 1?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1"} {"question": "What are the grapes and appelations of each wine?\nAdditional table information: table: wine_1", "answer": "SELECT Grape, Appelation FROM WINE"} {"question": "Show names and seatings, ordered by seating for all tracks opened after 2000.\nAdditional table information: table: race_track", "answer": "SELECT name, seating FROM track WHERE year_opened > 2000 ORDER BY seating NULLS FIRST"} {"question": "Find the name and flag of ships that are not steered by any captain with Midshipman rank.\nAdditional table information: table: ship_1", "answer": "SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')"} {"question": "What are the names of all races held after 2000 in Spain?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = 'Spain' AND T1.year > 2000"} {"question": "What are the distinct ids of products ordered between 1975-01-01 and 1976-01-01??\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= '1975-01-01' AND T1.date_order_placed <= '1976-01-01'"} {"question": "Show the names of editors and the theme of journals for which they serve on committees.\nAdditional table information: table: journal_committee", "answer": "SELECT T2.Name, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID"} {"question": "What are the heights of body builders with total score smaller than 315?\nAdditional table information: table: body_builder", "answer": "SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315"} {"question": "What are the wifi and screen mode type of the hardware model named 'LG-P760'?\nAdditional table information: table: phone_1", "answer": "SELECT T1.WiFi, T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = 'LG-P760'"} {"question": "Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order.\nAdditional table information: table: manufactory_1", "answer": "SELECT name, headquarter, revenue FROM manufacturers ORDER BY revenue DESC"} {"question": "What is the course description and number of credits for QM-261?\nAdditional table information: table: college_1", "answer": "SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261'"} {"question": "What is the maximum OMIM value in the database?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT MAX(OMIM) FROM enzyme"} {"question": "How many documents are there of each type?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code"} {"question": "Show the name of track with most number of races.\nAdditional table information: table: race_track", "answer": "SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the dorm with both a TV Lounge and Study Room listed as amenities?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'"} {"question": "What are the countries for appelations with at most 3 wines?\nAdditional table information: table: wine_1", "answer": "SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING COUNT(*) <= 3"} {"question": "Please show the most common occupation of players.\nAdditional table information: table: riding_club", "answer": "SELECT Occupation FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the manager with the most gas stations that opened after 2000?\nAdditional table information: table: gas_company", "answer": "SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "display the employee ID for each employee and the date on which he ended his previous job.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id"} {"question": "What is the number of branches that have more than the average number of memberships?\nAdditional table information: table: shop_membership", "answer": "SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch)"} {"question": "How many project staff worked as leaders or started working before '1989-04-24 23:51:54'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'"} {"question": "What is the total number of people who could stay in the modern rooms in this inn?\nAdditional table information: table: inn_1", "answer": "SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern'"} {"question": "Where does the customer with the first name Linda live? And what is her email?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.address, T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA'"} {"question": "List the names of pilots that do not have any record.\nAdditional table information: table: pilot_record", "answer": "SELECT Pilot_name FROM pilot WHERE NOT Pilot_ID IN (SELECT Pilot_ID FROM pilot_record)"} {"question": "What is the total number of hours per week and number of games played by students under 20?\nAdditional table information: table: game_1", "answer": "SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20"} {"question": "Find the team of each player and sort them in ascending alphabetical order.\nAdditional table information: table: school_player", "answer": "SELECT Team FROM player ORDER BY Team ASC NULLS FIRST"} {"question": "Find the number of apartments that have no facility.\nAdditional table information: table: apartment_rentals", "answer": "SELECT COUNT(*) FROM Apartments WHERE NOT apt_id IN (SELECT apt_id FROM Apartment_Facilities)"} {"question": "Return the type code of the document named 'David CV'.\nAdditional table information: table: document_management", "answer": "SELECT document_type_code FROM documents WHERE document_name = 'David CV'"} {"question": "What is the number of routes whose destinations are Italian airports?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'"} {"question": "What is the venue of the competition '1994 FIFA World Cup qualification' hosted by 'Nanjing ( Jiangsu )'?\nAdditional table information: table: city_record", "answer": "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'"} {"question": "What are the description and credit of the course which the student whose last name is Smithson took?\nAdditional table information: table: college_1", "answer": "SELECT T4.crs_description, T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'"} {"question": "How many budgets are above 3000 in year 2001 or before?\nAdditional table information: table: school_finance", "answer": "SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001"} {"question": "Find the common login name of course authors and students.\nAdditional table information: table: e_learning", "answer": "SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students"} {"question": "Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.\nAdditional table information: table: music_4", "answer": "SELECT RESULT, COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC"} {"question": "List the name of ships whose nationality is not 'United States'.\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship WHERE Nationality <> 'United States'"} {"question": "How many students who are female are allergic to milk or eggs?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = 'F' AND T1.allergy = 'Milk' OR T1.allergy = 'Eggs'"} {"question": "What are the ids of all students who are not video game players?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games"} {"question": "Count the number of tests with 'Fail' result.\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(*) FROM Student_Tests_Taken WHERE test_result = 'Fail'"} {"question": "Give me the names of members whose address is in Harford or Waterbury.\nAdditional table information: table: coffee_shop", "answer": "SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury'"} {"question": "List the description of the outcomes for all projects.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code"} {"question": "Show the police force shared by counties with location on the east and west.\nAdditional table information: table: county_public_safety", "answer": "SELECT Police_force FROM county_public_safety WHERE LOCATION = 'East' INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = 'West'"} {"question": "How many proteins are associated with an institution founded after 1880 or an institution with type 'Private'?\nAdditional table information: table: protein_institute", "answer": "SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private'"} {"question": "Show customer ids who don't have an account.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts"} {"question": "How many locations are listed in the database?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM Ref_locations"} {"question": "List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15.\nAdditional table information: table: phone_1", "answer": "SELECT DISTINCT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15"} {"question": "How many products are there in the records?\nAdditional table information: table: product_catalog", "answer": "SELECT COUNT(*) FROM catalog_contents"} {"question": "Show the role description and the id of the project staff involved in most number of project outcomes?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the ids, full names, and phones of each customer?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, customer_first_name, customer_last_name, customer_phone FROM Customers"} {"question": "Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.\nAdditional table information: table: scientist_1", "answer": "SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Puzzling Parallax'"} {"question": "What are the names and damage in millions for storms, ordered by their max speeds descending?\nAdditional table information: table: storm_record", "answer": "SELECT name, damage_millions_USD FROM storm ORDER BY max_speed DESC"} {"question": "How many different products are produced in each headquarter city?\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(DISTINCT T1.name), T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.Headquarter"} {"question": "Return the name of the document that has the most sections.\nAdditional table information: table: document_management", "answer": "SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the number of artists who are older than 46 and joined after 1990.\nAdditional table information: table: theme_gallery", "answer": "SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990"} {"question": "How many employees live in Georgia?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Addresses WHERE state_province_county = 'Georgia'"} {"question": "How many songs use drums as an instrument?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM instruments WHERE instrument = 'drums'"} {"question": "Which organizations are not a parent organization of others? List the organization id.\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations"} {"question": "What are the different ids and stop durations of all the drivers whose stop lasted longer than the driver in the race with the id 841?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)"} {"question": "Find the distinct locations that has a cinema.\nAdditional table information: table: cinema", "answer": "SELECT DISTINCT LOCATION FROM cinema"} {"question": "Count the total number of apartment bookings.\nAdditional table information: table: apartment_rentals", "answer": "SELECT COUNT(*) FROM Apartment_Bookings"} {"question": "What are the ids of instructors who didnt' teach?\nAdditional table information: table: college_2", "answer": "SELECT id FROM instructor EXCEPT SELECT id FROM teaches"} {"question": "Count the number of Professors who have office in building NEB.\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Faculty WHERE Rank = 'Professor' AND building = 'NEB'"} {"question": "How many members are in each party?\nAdditional table information: table: party_people", "answer": "SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id"} {"question": "What is the maximum, minimum and average years spent working on a school bus?\nAdditional table information: table: school_bus", "answer": "SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus"} {"question": "What are all the document type codes and document type names?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT document_type_code, document_type_name FROM Ref_document_types"} {"question": "How many products have their color described as 'white' or have a characteristic with the name 'hot'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'white' OR t3.characteristic_name = 'hot'"} {"question": "Please show the titles of films and the types of market estimations.\nAdditional table information: table: film_rank", "answer": "SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID"} {"question": "Which wineries produce at least four wines?\nAdditional table information: table: wine_1", "answer": "SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4"} {"question": "What are the details and opening hours of the museums?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Museum_Details, T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID"} {"question": "display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%')"} {"question": "What are the locations that have both tracks with more than 90000 seats, and tracks with fewer than 70000 seats?\nAdditional table information: table: race_track", "answer": "SELECT LOCATION FROM track WHERE seating > 90000 INTERSECT SELECT LOCATION FROM track WHERE seating < 70000"} {"question": "What are the names of everybody who has exactly one friend?\nAdditional table information: table: network_2", "answer": "SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1"} {"question": "What are the names of managers in ascending order of level?\nAdditional table information: table: railway", "answer": "SELECT Name FROM manager ORDER BY LEVEL ASC NULLS FIRST"} {"question": "What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor'"} {"question": "How many instruments does the song 'Badlands' use?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Badlands'"} {"question": "Return the name and id of the furniture with the highest market rate.\nAdditional table information: table: manufacturer", "answer": "SELECT name, furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1"} {"question": "How many distinct allergies are there?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(DISTINCT allergytype) FROM Allergy_type"} {"question": "Find the name all districts with city area greater than 10 or population larger than 100000\nAdditional table information: table: store_product", "answer": "SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000"} {"question": "Which tourist attractions are visited at least twice? Give me their names and ids.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) >= 2"} {"question": "Find the ids of the students who participate in Canoeing and Kayaking.\nAdditional table information: table: activity_1", "answer": "SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking'"} {"question": "How many sections does each course has?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code"} {"question": "What are the code and description of the least frequent detention type ?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.detention_type_code, T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Show first name for all students with major 600.\nAdditional table information: table: game_1", "answer": "SELECT Fname FROM Student WHERE Major = 600"} {"question": "Show names for all aircraft with at least two flights.\nAdditional table information: table: flight_1", "answer": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2"} {"question": "What is the type of the organization with the most research staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the room name and base price of the room with the lowest base price?\nAdditional table information: table: inn_1", "answer": "SELECT roomName, basePrice FROM Rooms ORDER BY basePrice ASC NULLS FIRST LIMIT 1"} {"question": "Show distinct first and last names for all customers with an account.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id"} {"question": "Find the brand and name for each camera lens, and sort in descending order of maximum aperture.\nAdditional table information: table: mountain_photos", "answer": "SELECT brand, name FROM camera_lens ORDER BY max_aperture DESC"} {"question": "What are the names of all wines produced in 2008?\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE WHERE YEAR = '2008'"} {"question": "How many rooms does each block floor have?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*), T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor"} {"question": "What are the names of all songs that have a lower rating than some song of blues genre?\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = 'blues')"} {"question": "Which statuses correspond to both cities that have a population over 1500 and cities that have a population lower than 500?\nAdditional table information: table: farm", "answer": "SELECT Status FROM city WHERE Population > 1500 INTERSECT SELECT Status FROM city WHERE Population < 500"} {"question": "What are the different card type codes, and how many different customers hold each type?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_type_code, COUNT(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code"} {"question": "What is the name of the country with the most number of home airlines?\nAdditional table information: table: flight_4", "answer": "SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the most common apartment type code.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the starting years shared by technicians from team 'CLE' and 'CWS'.\nAdditional table information: table: machine_repair", "answer": "SELECT Starting_Year FROM technician WHERE Team = 'CLE' INTERSECT SELECT Starting_Year FROM technician WHERE Team = 'CWS'"} {"question": "Show last names for all student who are on scholarship.\nAdditional table information: table: game_1", "answer": "SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'"} {"question": "Show the parties that have both representatives in New York state and representatives in Pennsylvania state.\nAdditional table information: table: election_representative", "answer": "SELECT Party FROM representative WHERE State = 'New York' INTERSECT SELECT Party FROM representative WHERE State = 'Pennsylvania'"} {"question": "How many bookings does each booking status have? List the booking status code and the number of corresponding bookings.\nAdditional table information: table: apartment_rentals", "answer": "SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code"} {"question": "Find the average age of students who are living in the dorm with the largest capacity.\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT MAX(student_capacity) FROM dorm)"} {"question": "What is Astrid Gruber's email and phone number?\nAdditional table information: table: store_1", "answer": "SELECT email, phone FROM customers WHERE first_name = 'Astrid' AND last_name = 'Gruber'"} {"question": "How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?\nAdditional table information: table: inn_1", "answer": "SELECT Adults FROM Reservations WHERE CheckIn = '2010-10-23' AND FirstName = 'CONRAD' AND LastName = 'SELBIG'"} {"question": "Find the name and salary of the instructors who are advisors of any student from History department?\nAdditional table information: table: college_2", "answer": "SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'"} {"question": "What are the names of all tryout participants who are from the largest college?\nAdditional table information: table: soccer_2", "answer": "SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)"} {"question": "What are all the distinct details of the customers?\nAdditional table information: table: insurance_policies", "answer": "SELECT DISTINCT customer_details FROM Customers"} {"question": "Find the number of kids staying in the rooms reserved by a person called ROY SWEAZ.\nAdditional table information: table: inn_1", "answer": "SELECT kids FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'"} {"question": "How many music festivals have had each kind of result, ordered descending by count?\nAdditional table information: table: music_4", "answer": "SELECT RESULT, COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC"} {"question": "Wat is the tax source system code and master customer id of the taxes related to each parking fine id?\nAdditional table information: table: local_govt_mdm", "answer": "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"} {"question": "How many parties are there?\nAdditional table information: table: party_host", "answer": "SELECT COUNT(*) FROM party"} {"question": "Which faculty do not participate in any activity? Find their faculty ids.\nAdditional table information: table: activity_1", "answer": "SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in"} {"question": "What are the states or counties of the address of the stores with marketing region code 'CA'?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = 'CA'"} {"question": "List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_id FROM Documents WHERE document_status_code = 'done' AND document_type_code = 'Paper' EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = 'USPS'"} {"question": "How many customers do not have an account?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Accounts)"} {"question": "What is the average age of the female students with secretary votes in the spring election cycle?\nAdditional table information: table: voter_2", "answer": "SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = 'F' AND T2.Election_Cycle = 'Spring'"} {"question": "What are total salaries and department id for each department that has more than 2 employees?\nAdditional table information: table: hr_1", "answer": "SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2"} {"question": "Find the names of females who are friends with Zach\nAdditional table information: table: network_2", "answer": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'"} {"question": "Return the name of the wrestler who had the lowest number of days held.\nAdditional table information: table: wrestler", "answer": "SELECT Name FROM wrestler ORDER BY Days_held ASC NULLS FIRST LIMIT 1"} {"question": "Find the name of the tryout players who are from the college with largest size.\nAdditional table information: table: soccer_2", "answer": "SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)"} {"question": "List all the types of forms.\nAdditional table information: table: e_government", "answer": "SELECT DISTINCT form_type_code FROM forms"} {"question": "What are the countries of all airlines whose names start with Orbit?\nAdditional table information: table: flight_4", "answer": "SELECT country FROM airlines WHERE name LIKE 'Orbit%'"} {"question": "What is the average latitude and longitude of all starting stations for the trips?\nAdditional table information: table: bike_1", "answer": "SELECT AVG(T1.lat), AVG(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id"} {"question": "Find the number of students for the cities where have more than one student.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1"} {"question": "What is the maximum and minimum grade point of students who live in NYC?\nAdditional table information: table: college_3", "answer": "SELECT MAX(T2.gradepoint), MIN(T2.gradepoint) FROM ENROLLED_IN AS T1, GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = 'NYC'"} {"question": "Return the total number of distinct customers.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(*) FROM customers"} {"question": "What are the names of artists who did not have an exhibition in 2004?\nAdditional table information: table: theme_gallery", "answer": "SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004"} {"question": "What are the last names that are used by customers and staff?\nAdditional table information: table: driving_school", "answer": "SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff"} {"question": "Return the phone number of the customer who filed the complaint that was raised most recently.\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1"} {"question": "Show the hometowns shared by people older than 23 and younger than 20.\nAdditional table information: table: gymnast", "answer": "SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20"} {"question": "What is the average age and how many male students are there in each city?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code"} {"question": "Select the name of the products with a price less than or equal to $200.\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM products WHERE price <= 200"} {"question": "Give the phones for departments in room 268.\nAdditional table information: table: college_3", "answer": "SELECT DPhone FROM DEPARTMENT WHERE Room = 268"} {"question": "What is the average, maximum, and minimum budget for all movies before 2000.\nAdditional table information: table: culture_company", "answer": "SELECT AVG(budget_million), MAX(budget_million), MIN(budget_million) FROM movie WHERE YEAR < 2000"} {"question": "Count the total number of roles listed.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM ROLES"} {"question": "How many members does the club 'Tennis Club' has?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'"} {"question": "Show the first names and last names of customers without any account.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_first_name, customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id"} {"question": "What is the average rating for right-footed players and left-footed players?\nAdditional table information: table: soccer_1", "answer": "SELECT preferred_foot, AVG(overall_rating) FROM Player_Attributes GROUP BY preferred_foot"} {"question": "how many people are there whose weight is higher than 85 for each gender?\nAdditional table information: table: candidate_poll", "answer": "SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex"} {"question": "Show all region code and region name sorted by the codes.\nAdditional table information: table: storm_record", "answer": "SELECT region_code, region_name FROM region ORDER BY region_code NULLS FIRST"} {"question": "Find the average age and number of male students (with sex M) from each city.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code"} {"question": "Give me the title and highest price for each film.\nAdditional table information: table: cinema", "answer": "SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id"} {"question": "List the name of actors whose age is not 20.\nAdditional table information: table: musical", "answer": "SELECT Name FROM actor WHERE Age <> 20"} {"question": "Show all the locations with at least two cinemas with capacity above 300.\nAdditional table information: table: cinema", "answer": "SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2"} {"question": "List the publication dates of publications with 3 lowest prices.\nAdditional table information: table: book_2", "answer": "SELECT Publication_Date FROM publication ORDER BY Price ASC NULLS FIRST LIMIT 3"} {"question": "Return the first names of the 5 staff members who have handled the most complaints.\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY COUNT(*) NULLS FIRST LIMIT 5"} {"question": "Show all artist names and the number of exhibitions for each artist.\nAdditional table information: table: theme_gallery", "answer": "SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id"} {"question": "What is all the information on the airport with the largest number of international passengers?\nAdditional table information: table: aircraft", "answer": "SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1"} {"question": "How many services are there?\nAdditional table information: table: insurance_fnol", "answer": "SELECT COUNT(*) FROM services"} {"question": "Show the times used by climbers to climb mountains in Country Uganda.\nAdditional table information: table: climbing", "answer": "SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = 'Uganda'"} {"question": "What are the coupon amount of the coupons owned by both good and bad customers?\nAdditional table information: table: products_for_hire", "answer": "SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad'"} {"question": "What is the total number of degrees granted after 2000 for each Orange county campus?\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = 'Orange' AND T2.year >= 2000 GROUP BY T1.campus"} {"question": "What are the phones of departments in Room 268?\nAdditional table information: table: college_3", "answer": "SELECT DPhone FROM DEPARTMENT WHERE Room = 268"} {"question": "What are the years of opening for tracks with seating between 4000 and 5000?\nAdditional table information: table: race_track", "answer": "SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000"} {"question": "How many distinct kinds of injuries happened after season 2010?\nAdditional table information: table: game_injury", "answer": "SELECT COUNT(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010"} {"question": "Return the cell phone number and email address for all students.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT cell_mobile_number, email_address FROM STUDENTS"} {"question": "List the height and weight of people in descending order of height.\nAdditional table information: table: body_builder", "answer": "SELECT Height, Weight FROM people ORDER BY Height DESC"} {"question": "Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.\nAdditional table information: table: music_4", "answer": "SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2"} {"question": "List the id, color scheme, and name for all the photos.\nAdditional table information: table: mountain_photos", "answer": "SELECT id, color, name FROM photos"} {"question": "Find the name of the products that are not using the most frequently-used max page size.\nAdditional table information: table: store_product", "answer": "SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What is the name of the artist, for each language, that has the most songs with a higher resolution than 500?\nAdditional table information: table: music_1", "answer": "SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many regions do we have?\nAdditional table information: table: storm_record", "answer": "SELECT COUNT(*) FROM region"} {"question": "How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'"} {"question": "List all club names in descending alphabetical order.\nAdditional table information: table: sports_competition", "answer": "SELECT name FROM club ORDER BY name DESC"} {"question": "How many characteristics does the product named 'laurel' have?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'laurel'"} {"question": "How many papers are written by authors from the institution 'University of Pennsylvania'?\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'University of Pennsylvania'"} {"question": "Count the number of invoices.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Invoices"} {"question": "What is the average number of bank customers?\nAdditional table information: table: loan_1", "answer": "SELECT AVG(no_of_customers) FROM bank"} {"question": "List the names of roller coasters by ascending order of length.\nAdditional table information: table: roller_coaster", "answer": "SELECT Name FROM roller_coaster ORDER BY LENGTH ASC NULLS FIRST"} {"question": "Find the number of web accelerators used for each Operating system.\nAdditional table information: table: browser_web", "answer": "SELECT Operating_system, COUNT(*) FROM web_client_accelerator GROUP BY Operating_system"} {"question": "Find the locations that have more than one movie theater with capacity above 300.\nAdditional table information: table: cinema", "answer": "SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1"} {"question": "display those employees who joined after 7th September, 1987.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE hire_date > '1987-09-07'"} {"question": "Find the names of all physicians and their primary affiliated departments' names.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name, T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1"} {"question": "List all the document names which contains 'CV'.\nAdditional table information: table: document_management", "answer": "SELECT document_name FROM documents WHERE document_name LIKE '%CV%'"} {"question": "How many Bangladeshi artists are listed?\nAdditional table information: table: music_1", "answer": "SELECT COUNT(*) FROM artist WHERE country = 'Bangladesh'"} {"question": "Among the procedures that cost more than 1000, which were not specialized in by physician John Wen?\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM procedures WHERE cost > 1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "Show the addresses and phones of all the buildings managed by 'Brenden'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = 'Brenden'"} {"question": "What is the name and price of the cheapest product?\nAdditional table information: table: manufactory_1", "answer": "SELECT name, price FROM Products ORDER BY price ASC NULLS FIRST LIMIT 1"} {"question": "How many products were not included in any order?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM products WHERE NOT product_id IN (SELECT product_id FROM Order_items)"} {"question": "Find the name and salary of instructors whose salary is below the average salary of the instructors in the Physics department.\nAdditional table information: table: college_2", "answer": "SELECT name, salary FROM instructor WHERE salary < (SELECT AVG(salary) FROM instructor WHERE dept_name = 'Physics')"} {"question": "What are the names of all campuses located at Chico?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE LOCATION = 'Chico'"} {"question": "Find the texts of assessment notes for teachers with last name 'Schuster'.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = 'Schuster'"} {"question": "Find the id and address of the shops whose score is below the average score.\nAdditional table information: table: coffee_shop", "answer": "SELECT shop_id, address FROM shop WHERE score < (SELECT AVG(score) FROM shop)"} {"question": "Find the name of the activity that has the largest number of student participants.\nAdditional table information: table: activity_1", "answer": "SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which students participate in both Canoeing and Kayaking as their activities? Tell me their student ids.\nAdditional table information: table: activity_1", "answer": "SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking'"} {"question": "What details are there on the research staff? List the result in ascending alphabetical order.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT staff_details FROM Research_Staff ORDER BY staff_details ASC NULLS FIRST"} {"question": "Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.\nAdditional table information: table: train_station", "answer": "SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25"} {"question": "What are the authors of submissions and their colleges?\nAdditional table information: table: workshop_paper", "answer": "SELECT Author, College FROM submission"} {"question": "Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is 'LG-P760'.\nAdditional table information: table: phone_1", "answer": "SELECT T1.Char_cells, T1.Pixels, T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = 'LG-P760'"} {"question": "What is the name of each course and the corresponding number of student enrollment?\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name"} {"question": "display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC"} {"question": "How many students live in each city?\nAdditional table information: table: allergy_1", "answer": "SELECT city_code, COUNT(*) FROM Student GROUP BY city_code"} {"question": "What are the three largest cities in terms of regional population?\nAdditional table information: table: city_record", "answer": "SELECT city FROM city ORDER BY regional_population DESC LIMIT 3"} {"question": "What are the song titles on the album 'A Kiss Before You Go: Live in Hamburg'?\nAdditional table information: table: music_2", "answer": "SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = 'A Kiss Before You Go: Live in Hamburg'"} {"question": "Which head's name has the substring 'Ha'? List the id and name.\nAdditional table information: table: department_management", "answer": "SELECT head_id, name FROM head WHERE name LIKE '%Ha%'"} {"question": "What are the issue dates of volumes associated with the artist aged 23 or younger?\nAdditional table information: table: music_4", "answer": "SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23"} {"question": "What are the names of all the subjects.\nAdditional table information: table: e_learning", "answer": "SELECT subject_name FROM SUBJECTS"} {"question": "Give the unit of measure for the product with the name 'cumin'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'cumin'"} {"question": "What is the average age of all gymnasts?\nAdditional table information: table: gymnast", "answer": "SELECT AVG(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID"} {"question": "What are the average prices of products for each manufacturer?\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name"} {"question": "What is the first name of each student enrolled in class ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'"} {"question": "In which country and state does Janessa Sawayn live?\nAdditional table information: table: driving_school", "answer": "SELECT T1.country, T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "Find the total access count of all documents in the most popular document type.\nAdditional table information: table: document_management", "answer": "SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the code of the city with the most students?\nAdditional table information: table: dorm_1", "answer": "SELECT city_code FROM student GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the alphabetically ordered list of all distinct medications?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT name FROM medication ORDER BY name NULLS FIRST"} {"question": "Which range contains the most mountains?\nAdditional table information: table: climbing", "answer": "SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the title and director of the films without any schedule?\nAdditional table information: table: cinema", "answer": "SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule)"} {"question": "Return the famous titles of the artist called 'Triumfall'.\nAdditional table information: table: music_4", "answer": "SELECT Famous_Title FROM artist WHERE Artist = 'Triumfall'"} {"question": "How many students are taught by teacher TARRING LEIA?\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'TARRING' AND T2.lastname = 'LEIA'"} {"question": "Show the ids of all employees who have either destroyed a document or made an authorization to do this.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "Show the number of trains\nAdditional table information: table: train_station", "answer": "SELECT COUNT(*) FROM train"} {"question": "Find the dates of the tests taken with result 'Pass'.\nAdditional table information: table: e_learning", "answer": "SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = 'Pass'"} {"question": "Find the first names of all instructors who have taught some course and the course description.\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code"} {"question": "Find the names of users whose emails contain \u2018superstar\u2019 or \u2018edu\u2019.\nAdditional table information: table: twitter_1", "answer": "SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'"} {"question": "What are the ids, names, dates of opening, and other details for accounts corresponding to the customer with the first name 'Meaghan'?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.account_id, T1.date_account_opened, T1.account_name, T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan'"} {"question": "List the names of studios that have at least two films.\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2"} {"question": "Find the first name and age of the students who are playing both Football and Lacrosse.\nAdditional table information: table: game_1", "answer": "SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = 'Football' INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = 'Lacrosse')"} {"question": "Find the patient who most recently stayed in room 111.\nAdditional table information: table: hospital_1", "answer": "SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1"} {"question": "Find the number of trains for each station, as well as the station network name and services.\nAdditional table information: table: station_weather", "answer": "SELECT COUNT(*), t1.network_name, t1.services FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id"} {"question": "List the top 5 genres by number of tracks. List genres name and total tracks.\nAdditional table information: table: store_1", "answer": "SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5"} {"question": "List the names of journalists who have not reported any event.\nAdditional table information: table: news_report", "answer": "SELECT Name FROM journalist WHERE NOT journalist_ID IN (SELECT journalist_ID FROM news_report)"} {"question": "Show the premise type and address type code for all customer addresses.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT T2.premises_type, T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id"} {"question": "What is the description, code and the corresponding count of each service type?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Service_Type_Description, T2.Service_Type_Code, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code"} {"question": "Find the total number of instructors who teach a course in the Spring 2010 semester.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "What are the names of the reviewers who have rated a movie more than 3 stars before?\nAdditional table information: table: movie_1", "answer": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3"} {"question": "What is the minimum snatch score?\nAdditional table information: table: body_builder", "answer": "SELECT MIN(snatch) FROM body_builder"} {"question": "In which buildings are there at least ten professors?\nAdditional table information: table: activity_1", "answer": "SELECT building FROM Faculty WHERE rank = 'Professor' GROUP BY building HAVING COUNT(*) >= 10"} {"question": "What is the last name of the musician who was in the most songs?\nAdditional table information: table: music_2", "answer": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average, minimum, maximum, and total transaction amount?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT AVG(transaction_amount), MIN(transaction_amount), MAX(transaction_amount), SUM(transaction_amount) FROM Financial_transactions"} {"question": "What is the name of the activity with the most students?\nAdditional table information: table: activity_1", "answer": "SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names and year of construction for the mills of 'Grondzeiler' type?\nAdditional table information: table: architecture", "answer": "SELECT name, built_year FROM mill WHERE TYPE = 'Grondzeiler'"} {"question": "For each type, how many ships are there?\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE"} {"question": "Show all student IDs with the number of sports and total number of games played\nAdditional table information: table: game_1", "answer": "SELECT StuID, COUNT(*), SUM(gamesplayed) FROM Sportsinfo GROUP BY StuID"} {"question": "What are the ids of the students who are not involved in any activity\nAdditional table information: table: activity_1", "answer": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in"} {"question": "How many hosts does each nationality have? List the nationality and the count.\nAdditional table information: table: party_host", "answer": "SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality"} {"question": "What are the names of companies with revenue between 100 and 150?\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150"} {"question": "What are the names of products with price at most 200?\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM products WHERE price <= 200"} {"question": "Who is the instructor with the highest salary?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor ORDER BY salary DESC LIMIT 1"} {"question": "List the first name middle name and last name of all staff.\nAdditional table information: table: driving_school", "answer": "SELECT first_name, middle_name, last_name FROM Staff"} {"question": "How many customers have an account?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(DISTINCT customer_id) FROM Accounts"} {"question": "Give the number of students living in either HKG or CHI.\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student WHERE city_code = 'HKG' OR city_code = 'CHI'"} {"question": "How many instructors are in the department with the highest budget, and what is their average salary?\nAdditional table information: table: college_2", "answer": "SELECT AVG(T1.salary), COUNT(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1"} {"question": "What are the names of wines made from red grapes?\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red'"} {"question": "Please show the names of aircrafts associated with airport with name 'London Gatwick'.\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick'"} {"question": "What are all the customer phone numbers under the most popular policy type?\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What is the maximum and minimum resolution of all songs that are approximately 3 minutes long?\nAdditional table information: table: music_1", "answer": "SELECT MAX(T2.resolution), MIN(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE '3:%'"} {"question": "What is the id and last name of the driver with the longest laptime?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1"} {"question": "What are the names of the top 8 countries by total invoice size and what are those sizes?\nAdditional table information: table: store_1", "answer": "SELECT billing_country, SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8"} {"question": "Show names and phones of customers who do not have address information.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_address_history)"} {"question": "How many different card types are there?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(DISTINCT card_type_code) FROM Customers_Cards"} {"question": "What are the starting years shared by the technicians from the team 'CLE' or 'CWS'?\nAdditional table information: table: machine_repair", "answer": "SELECT Starting_Year FROM technician WHERE Team = 'CLE' INTERSECT SELECT Starting_Year FROM technician WHERE Team = 'CWS'"} {"question": "What are the names of hosts who did not host any party in our record?\nAdditional table information: table: party_host", "answer": "SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host)"} {"question": "Return the address of customer 10.\nAdditional table information: table: department_store", "answer": "SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10"} {"question": "Find the name of the department that has the biggest number of students minored in?\nAdditional table information: table: college_3", "answer": "SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the first and last name of the students who do not have any food type allergy.\nAdditional table information: table: allergy_1", "answer": "SELECT fname, lname FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'food')"} {"question": "Which customer made the most orders? Find the customer name.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the id and color description of the products with at least 2 characteristics.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.product_id, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING COUNT(*) >= 2"} {"question": "What are the names of circuits that belong to UK or Malaysia?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM circuits WHERE country = 'UK' OR country = 'Malaysia'"} {"question": "How many products are there under the category 'Seeds'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products WHERE product_category_code = 'Seeds'"} {"question": "What is the minimum salary in each department?\nAdditional table information: table: hr_1", "answer": "SELECT MIN(salary), department_id FROM employees GROUP BY department_id"} {"question": "Show the country name and capital of all countries.\nAdditional table information: table: match_season", "answer": "SELECT Country_name, Capital FROM country"} {"question": "What are the total points of gymnasts, ordered by their floor exercise points descending?\nAdditional table information: table: gymnast", "answer": "SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC"} {"question": "When did the staff member named Janessa Sawayn join the company?\nAdditional table information: table: driving_school", "answer": "SELECT date_joined_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'"} {"question": "What are the dates when customers with ids between 10 and 20 became customers?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20"} {"question": "What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2"} {"question": "What is the name of the district with the most residents?\nAdditional table information: table: store_product", "answer": "SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1"} {"question": "Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T1.name, T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = 'X'"} {"question": "What is the name of the oldest manager?\nAdditional table information: table: railway", "answer": "SELECT Name FROM manager ORDER BY Age DESC LIMIT 1"} {"question": "Show the ids of students whose advisors are professors.\nAdditional table information: table: activity_1", "answer": "SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = 'Professor'"} {"question": "What are the different police forces of counties that are not located in the East?\nAdditional table information: table: county_public_safety", "answer": "SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION <> 'East'"} {"question": "How many customers are there of each gender?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT gender, COUNT(*) FROM Customers GROUP BY gender"} {"question": "what are the details of the cmi masters that have the cross reference code 'Tax'?\nAdditional table information: table: local_govt_mdm", "answer": "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'"} {"question": "List names for drivers from Hartford city and younger than 40.\nAdditional table information: table: school_bus", "answer": "SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40"} {"question": "Which room has the highest base price?\nAdditional table information: table: inn_1", "answer": "SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1"} {"question": "Show the number of buildings with a height above the average or a number of floors above the average.\nAdditional table information: table: protein_institute", "answer": "SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(floors) FROM building)"} {"question": "What is the entry name of the most expensive catalog (in USD)?\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1"} {"question": "Find the maximum and minimum sales of the companies that are not in the 'Banking' industry.\nAdditional table information: table: company_office", "answer": "SELECT MAX(Sales_billion), MIN(Sales_billion) FROM Companies WHERE Industry <> 'Banking'"} {"question": "What are the first names of the different drivers who won in position 1 as driver standing and had more than 20 points?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20"} {"question": "Tell me the the date when the first claim was made.\nAdditional table information: table: insurance_policies", "answer": "SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC NULLS FIRST LIMIT 1"} {"question": "What are the last names of employees who serve at most 20 customers?\nAdditional table information: table: chinook_1", "answer": "SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20"} {"question": "How many products have prices of at least 180?\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(*) FROM products WHERE price >= 180"} {"question": "List the name, nationality and id of all male architects ordered by their names lexicographically.\nAdditional table information: table: architecture", "answer": "SELECT name, nationality, id FROM architect WHERE gender = 'male' ORDER BY name NULLS FIRST"} {"question": "Count the number of tracks.\nAdditional table information: table: race_track", "answer": "SELECT COUNT(*) FROM track"} {"question": "How many rooms are there?\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM Rooms"} {"question": "What is the most common company type, and how many are there?\nAdditional table information: table: flight_company", "answer": "SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many customers does Steve Johnson support?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = 'Steve' AND T1.last_name = 'Johnson'"} {"question": "List the locations of schools in descending order of founded year.\nAdditional table information: table: school_player", "answer": "SELECT LOCATION FROM school ORDER BY Founded DESC"} {"question": "What are the ids of all students along with how many sports and games did they play?\nAdditional table information: table: game_1", "answer": "SELECT StuID, COUNT(*), SUM(gamesplayed) FROM Sportsinfo GROUP BY StuID"} {"question": "Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009.\nAdditional table information: table: hr_1", "answer": "SELECT job_id, hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'"} {"question": "What is the weight of the shortest person?\nAdditional table information: table: entrepreneur", "answer": "SELECT Weight FROM people ORDER BY Height ASC NULLS FIRST LIMIT 1"} {"question": "HOw many engineers are older than 30?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer'"} {"question": "Show the names of authors from college 'Florida' or 'Temple'\nAdditional table information: table: workshop_paper", "answer": "SELECT Author FROM submission WHERE College = 'Florida' OR College = 'Temple'"} {"question": "Find the number of settlements each claim corresponds to. Show the number together with the claim id.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.Claim_id, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id"} {"question": "Show all member names who are not in charge of any event.\nAdditional table information: table: party_people", "answer": "SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id"} {"question": "Which tourist attractions can we get to by bus? Tell me the names of the attractions.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = 'bus'"} {"question": "What are the numbers of races for each constructor id?\nAdditional table information: table: formula_1", "answer": "SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid"} {"question": "What are the greatest and average capacity for rooms in each building?\nAdditional table information: table: college_2", "answer": "SELECT MAX(capacity), AVG(capacity), building FROM classroom GROUP BY building"} {"question": "What is the name of the technician whose team is not 'NYY'?\nAdditional table information: table: machine_repair", "answer": "SELECT Name FROM technician WHERE Team <> 'NYY'"} {"question": "Show the first names and last names of all the guests that have apartment bookings with status code 'Confirmed'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.guest_first_name, T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = 'Confirmed'"} {"question": "What country is the artist who made the fewest songs from?\nAdditional table information: table: music_1", "answer": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Return the device carriers that do not have Android as their software platform.\nAdditional table information: table: device", "answer": "SELECT Carrier FROM device WHERE Software_Platform <> 'Android'"} {"question": "What is the average access count of documents that have the least common structure?\nAdditional table information: table: document_management", "answer": "SELECT AVG(access_count) FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Find the birth dates corresponding to employees who live in the city of Edmonton.\nAdditional table information: table: chinook_1", "answer": "SELECT BirthDate FROM EMPLOYEE WHERE City = 'Edmonton'"} {"question": "Find the name and position of physicians who prescribe some medication whose brand is X?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T1.name, T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = 'X'"} {"question": "What are the claim dates and settlement dates of all the settlements?\nAdditional table information: table: insurance_policies", "answer": "SELECT Date_Claim_Made, Date_Claim_Settled FROM Settlements"} {"question": "What is the id of the reviewer named Daniel Lewis?\nAdditional table information: table: movie_1", "answer": "SELECT rID FROM Reviewer WHERE name = 'Daniel Lewis'"} {"question": "On what day was the order with invoice number 10 placed?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10"} {"question": "What is the number of distinct cities the stations are located at?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(DISTINCT city) FROM station"} {"question": "How many residents does each property have? List property id and resident count.\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT T1.property_id, COUNT(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id"} {"question": "What is the flight number, origin, and destination for all flights in alphabetical order by departure cities?\nAdditional table information: table: flight_1", "answer": "SELECT flno, origin, destination FROM Flight ORDER BY origin NULLS FIRST"} {"question": "Return the full name and phone of the customer who has card number 4560596484842.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = '4560596484842'"} {"question": "List the names of the city with the top 5 white percentages.\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM city ORDER BY White DESC LIMIT 5"} {"question": "Which channels broadcast both in the morning and at night? Give me the channel names.\nAdditional table information: table: program_share", "answer": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night'"} {"question": "What is the id and stop number for each driver that has a shorter pit stop than the driver in the race with id 841?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)"} {"question": "Retrieve the list of all cities.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT DISTINCT city FROM addresses"} {"question": "Return the most frequent result across all musicals.\nAdditional table information: table: musical", "answer": "SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "In which year were most departments established?\nAdditional table information: table: department_management", "answer": "SELECT creation FROM department GROUP BY creation ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names, color descriptions, and product descriptions for products in the 'Herbs' category?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT T1.product_name, T2.color_description, T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = 'Herbs'"} {"question": "Show each premise type and the number of premises in that type.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type"} {"question": "Find the login name of the course author that teaches the course with name 'advanced database'.\nAdditional table information: table: e_learning", "answer": "SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = 'advanced database'"} {"question": "Find the policy type the most customers choose.\nAdditional table information: table: insurance_policies", "answer": "SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many customers have email that contains 'gmail.com'?\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE '%gmail.com%'"} {"question": "Count the number of films whose title contains the word 'Dummy'.\nAdditional table information: table: cinema", "answer": "SELECT COUNT(*) FROM film WHERE title LIKE '%Dummy%'"} {"question": "What are the order dates of orders with price higher than 1000?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000"} {"question": "What are the first and last name of the faculty who has the most students?\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the codes of all the courses that are located in room KLR209?\nAdditional table information: table: college_1", "answer": "SELECT class_code FROM CLASS WHERE class_room = 'KLR209'"} {"question": "Find the names of users who have more than one tweet.\nAdditional table information: table: twitter_1", "answer": "SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING COUNT(*) > 1"} {"question": "Show the employee ids for all employees with role name 'Human Resource' or 'Manager'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Human Resource' OR T2.role_name = 'Manager'"} {"question": "List the names and the locations that the enzymes can make an effect.\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name, LOCATION FROM enzyme"} {"question": "Show the name of the party that has at least two records.\nAdditional table information: table: election", "answer": "SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2"} {"question": "What is the course title of the prerequisite of course Mobile Computing?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')"} {"question": "What are the staff ids and genders of all staffs whose job title is Department Manager?\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Department Manager'"} {"question": "Count the number of products that were never ordered.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM products WHERE NOT product_id IN (SELECT product_id FROM Order_items)"} {"question": "What are the top three apartment types in terms of the average room count? Give me the\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY AVG(room_count) DESC LIMIT 3"} {"question": "How many universities have a campus fee greater than the average?\nAdditional table information: table: csu_1", "answer": "SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)"} {"question": "What is the name of the youngest editor?\nAdditional table information: table: journal_committee", "answer": "SELECT Name FROM editor ORDER BY Age ASC NULLS FIRST LIMIT 1"} {"question": "What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'"} {"question": "What are the ids of songs that are available in either mp4 format or have resolution above 720?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM files WHERE formats = 'mp4' UNION SELECT f_id FROM song WHERE resolution > 720"} {"question": "Show all allergy type with number of students affected.\nAdditional table information: table: allergy_1", "answer": "SELECT T2.allergytype, COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype"} {"question": "Which countries have at least 3 cities?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3"} {"question": "Show all main industry and total market value in each industry.\nAdditional table information: table: gas_company", "answer": "SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry"} {"question": "Which status code is the most common of all the bookings?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the least popular kind of decor?\nAdditional table information: table: inn_1", "answer": "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"} {"question": "Return the names of entrepreneurs.\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID"} {"question": "Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000"} {"question": "What is the average salary of employees who have a commission percentage that is not null?\nAdditional table information: table: hr_1", "answer": "SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> 'null' GROUP BY department_id"} {"question": "What are the names, locations, and years of opening for tracks with seating higher than average?\nAdditional table information: table: race_track", "answer": "SELECT name, LOCATION, year_opened FROM track WHERE seating > (SELECT AVG(seating) FROM track)"} {"question": "What is the name and address of the department with the most students?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name, T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which institution is the author 'Matthias Blume' belong to? Give me the name of the institution.\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = 'Matthias' AND t1.lname = 'Blume'"} {"question": "Find the last name and age of the student who has allergy to both milk and cat.\nAdditional table information: table: allergy_1", "answer": "SELECT lname, age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = 'Milk' INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = 'Cat')"} {"question": "How many climbers are there?\nAdditional table information: table: climbing", "answer": "SELECT COUNT(*) FROM climber"} {"question": "In the year 2000, what is the campus fee for San Francisco State University?\nAdditional table information: table: csu_1", "answer": "SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = 'San Francisco State University' AND t1.year = 2000"} {"question": "What are all the different zip codes that have a maximum dew point that was always below 70?\nAdditional table information: table: bike_1", "answer": "SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70"} {"question": "Show all distinct city where branches with at least 100 memberships are located.\nAdditional table information: table: shop_membership", "answer": "SELECT DISTINCT city FROM branch WHERE membership_amount >= 100"} {"question": "How many movies were made before 2000?\nAdditional table information: table: movie_1", "answer": "SELECT COUNT(*) FROM Movie WHERE YEAR < 2000"} {"question": "What is the name and hours for the project which has the most scientists assigned to it?\nAdditional table information: table: scientist_1", "answer": "SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the total number of gas stations that opened between 2000 and 2005?\nAdditional table information: table: gas_company", "answer": "SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005"} {"question": "Return the different nominees of musicals that have an award that is not the Tony Award.\nAdditional table information: table: musical", "answer": "SELECT DISTINCT Nominee FROM musical WHERE Award <> 'Tony Award'"} {"question": "Show the names of people who have been on the negative side of debates at least twice.\nAdditional table information: table: debate", "answer": "SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2"} {"question": "What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT DISTINCT T2.thing_id, T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21'"} {"question": "Which payment method is used the most often?\nAdditional table information: table: insurance_policies", "answer": "SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the highest mountain?\nAdditional table information: table: climbing", "answer": "SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1"} {"question": "What type of game is Call of Destiny?\nAdditional table information: table: game_1", "answer": "SELECT gtype FROM Video_games WHERE gname = 'Call of Destiny'"} {"question": "What is the total home game attendance of team Boston Red Stockings from 2000 to 2010?\nAdditional table information: table: baseball_1", "answer": "SELECT SUM(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010"} {"question": "What are the names of all reviewers that have rated 3 or more movies?\nAdditional table information: table: movie_1", "answer": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3"} {"question": "Which staff members are assigned to the problem with id 1? Give me their first and last names.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1"} {"question": "What is the starting year for the oldest technician?\nAdditional table information: table: machine_repair", "answer": "SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1"} {"question": "What are the names of workshop groups in which services with product name 'film' are performed?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = 'film'"} {"question": "Who is performing in the back stage position for the song 'Badlands'? Show the first name and the last name.\nAdditional table information: table: music_2", "answer": "SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Badlands' AND T1.StagePosition = 'back'"} {"question": "Find the product names that are colored 'white' but do not have unit of measurement 'Handful'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = 'white' AND t2.unit_of_measure <> 'Handful'"} {"question": "How many tourists did not make any visit?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT COUNT(*) FROM Visitors WHERE NOT Tourist_ID IN (SELECT Tourist_ID FROM Visits)"} {"question": "Which poll resource provided the most number of candidate information?\nAdditional table information: table: candidate_poll", "answer": "SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the ids of the problems reported after 1978-06-26.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_id FROM problems WHERE date_problem_reported > '1978-06-26'"} {"question": "Show the names of all the donors except those whose donation amount less than 9.\nAdditional table information: table: school_finance", "answer": "SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9"} {"question": "What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?\nAdditional table information: table: formula_1", "answer": "SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5"} {"question": "What is the average price for wines not produced in Sonoma county?\nAdditional table information: table: wine_1", "answer": "SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma')"} {"question": "Show the start dates and end dates of all the apartment bookings.\nAdditional table information: table: apartment_rentals", "answer": "SELECT booking_start_date, booking_end_date FROM Apartment_Bookings"} {"question": "how many programs are there?\nAdditional table information: table: program_share", "answer": "SELECT COUNT(*) FROM program"} {"question": "Who are the friends of Alice that are doctors?\nAdditional table information: table: network_2", "answer": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'"} {"question": "Find the id of the candidate who got the lowest oppose rate.\nAdditional table information: table: candidate_poll", "answer": "SELECT Candidate_ID FROM candidate ORDER BY oppose_rate NULLS FIRST LIMIT 1"} {"question": "Find all the papers published by 'Aaron Turon'.\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Aaron' AND t1.lname = 'Turon'"} {"question": "Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.\nAdditional table information: table: phone_1", "answer": "SELECT Hardware_Model_name, Company_name FROM phone WHERE Accreditation_type LIKE 'Full'"} {"question": "List the position of players and the average number of points of players of each position.\nAdditional table information: table: sports_competition", "answer": "SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION"} {"question": "What is the language used most often in the songs?\nAdditional table information: table: music_1", "answer": "SELECT languages FROM song GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many female students live in Smith Hall?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F'"} {"question": "What are the name, phone number and email address of the customer who made the largest number of orders?\nAdditional table information: table: department_store", "answer": "SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which physicians have never taken any appointment? Find their names.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID"} {"question": "Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.\nAdditional table information: table: entrepreneur", "answer": "SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000"} {"question": "Find the max, average and min training hours of all players.\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(HS), MAX(HS), MIN(HS) FROM Player"} {"question": "What is the average latitude and longitude of stations located in San Jose city?\nAdditional table information: table: bike_1", "answer": "SELECT AVG(lat), AVG(long) FROM station WHERE city = 'San Jose'"} {"question": "List the names of gymnasts in ascending order by their heights.\nAdditional table information: table: gymnast", "answer": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC NULLS FIRST"} {"question": "Show all ministers and parties they belong to in descending order of the time they took office.\nAdditional table information: table: party_people", "answer": "SELECT minister, party_name FROM party ORDER BY took_office DESC"} {"question": "Count the total number of students.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM student"} {"question": "For each branch id, what are the names of the branches that were registered after 2015?\nAdditional table information: table: shop_membership", "answer": "SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id"} {"question": "Show the name of drivers in descending order of age.\nAdditional table information: table: school_bus", "answer": "SELECT name FROM driver ORDER BY age DESC"} {"question": "Count the number of schools.\nAdditional table information: table: school_finance", "answer": "SELECT COUNT(*) FROM school"} {"question": "Find the number of scientists involved for each project name.\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name"} {"question": "List the name of the county with the largest population.\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1"} {"question": "Find the id of the customer who made the most orders.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the different schools and their nicknames, ordered by their founding years?\nAdditional table information: table: university_basketball", "answer": "SELECT school, nickname FROM university ORDER BY founded NULLS FIRST"} {"question": "What are the first names for all faculty professors, ordered by first name?\nAdditional table information: table: college_3", "answer": "SELECT Fname FROM FACULTY WHERE Rank = 'Professor' ORDER BY Fname NULLS FIRST"} {"question": "What are the entry names of catalog with the attribute possessed by most entries.\nAdditional table information: table: product_catalog", "answer": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "Which film has the most copies in the inventory? List both title and id.\nAdditional table information: table: sakila_1", "answer": "SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Who has a friend that is from new york city?\nAdditional table information: table: network_2", "answer": "SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'"} {"question": "Show the locations of parties with hosts older than 50.\nAdditional table information: table: party_host", "answer": "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"} {"question": "How many documents are with document type code BK for each product id?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = 'BK' GROUP BY project_id"} {"question": "What are the names of the different artists that have produced a song in English but have never receieved a rating higher than 8?\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT artist_name FROM song WHERE languages = 'english' EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8"} {"question": "Show the school name and type for schools without a school bus.\nAdditional table information: table: school_bus", "answer": "SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus)"} {"question": "Find the number of employees of each gender whose salary is lower than 50000.\nAdditional table information: table: company_1", "answer": "SELECT COUNT(*), sex FROM employee WHERE salary < 50000 GROUP BY sex"} {"question": "Which club has the most female students as their members? Give me the name of the club.\nAdditional table information: table: club_1", "answer": "SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = 'F' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average hours across all projects?\nAdditional table information: table: scientist_1", "answer": "SELECT AVG(hours) FROM projects"} {"question": "Find the starting date and ending data in location for the document named 'Robin CV'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T1.date_in_location_from, T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = 'Robin CV'"} {"question": "Find the average fee on a CSU campus in 1996\nAdditional table information: table: csu_1", "answer": "SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996"} {"question": "Find the names of channels that are not owned by CCTV.\nAdditional table information: table: program_share", "answer": "SELECT name FROM channel WHERE OWNER <> 'CCTV'"} {"question": "What are the names of different tracks, and how many races has each had?\nAdditional table information: table: race_track", "answer": "SELECT T2.name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id"} {"question": "List the details of the customers who do not have any policies.\nAdditional table information: table: insurance_policies", "answer": "SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id"} {"question": "What are the names of the airports which are not in the country 'Iceland'?\nAdditional table information: table: flight_company", "answer": "SELECT name FROM airport WHERE country <> 'Iceland'"} {"question": "Find all the catalog publishers whose name contains 'Murray'\nAdditional table information: table: product_catalog", "answer": "SELECT DISTINCT (catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE '%Murray%'"} {"question": "How many distinct students are enrolled in courses?\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(DISTINCT student_id) FROM Student_Course_Enrolment"} {"question": "From which hometowns did no gymnasts come from?\nAdditional table information: table: gymnast", "answer": "SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID"} {"question": "What is the name of the department with the most students minoring in it?\nAdditional table information: table: college_3", "answer": "SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average base price of different bed type? List bed type and average base price.\nAdditional table information: table: inn_1", "answer": "SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType"} {"question": "Find the names and phone numbers of customers living in California state.\nAdditional table information: table: customer_deliveries", "answer": "SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'"} {"question": "Count the number of different positions in the club 'Bootup Baltimore'.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = 'Bootup Baltimore'"} {"question": "What are the first names and support rep ids for employees serving 10 or more customers?\nAdditional table information: table: chinook_1", "answer": "SELECT T1.FirstName, T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10"} {"question": "What are the case burdens of counties, ordered descending by population?\nAdditional table information: table: county_public_safety", "answer": "SELECT Case_burden FROM county_public_safety ORDER BY Population DESC"} {"question": "What is the partition id of the user named 'Iron Man'.\nAdditional table information: table: twitter_1", "answer": "SELECT partitionid FROM user_profiles WHERE name = 'Iron Man'"} {"question": "How many tracks are in the AAC audio file media type?\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = 'AAC audio file'"} {"question": "Show the location codes and the number of documents in each location.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code, COUNT(*) FROM Document_locations GROUP BY location_code"} {"question": "How many employees are there?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Staff"} {"question": "Return the issue dates of volumes that are by the artist named Gorgoroth.\nAdditional table information: table: music_4", "answer": "SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = 'Gorgoroth'"} {"question": "Show me the distinct payment method codes from the invoice record.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT DISTINCT payment_method_code FROM INVOICES"} {"question": "What is the list of school locations sorted in ascending order of school enrollment?\nAdditional table information: table: school_player", "answer": "SELECT LOCATION FROM school ORDER BY Enrollment ASC NULLS FIRST"} {"question": "Show the names of people aged either 35 or 36.\nAdditional table information: table: debate", "answer": "SELECT Name FROM people WHERE Age = 35 OR Age = 36"} {"question": "What is the list of program names, sorted by the order of launch date?\nAdditional table information: table: program_share", "answer": "SELECT name FROM program ORDER BY launch NULLS FIRST"} {"question": "Show the minimum, average, maximum order quantity of all invoices.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES"} {"question": "What are the names and types of the dorms that have a capacity greater than 300 or less than 100?\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100"} {"question": "What is the name and country for the artist with most number of exhibitions?\nAdditional table information: table: theme_gallery", "answer": "SELECT T2.name, T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the name and age of the person who is a friend of both Dan and Alice.\nAdditional table information: table: network_2", "answer": "SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'"} {"question": "Who are the members of the club named 'Bootup Baltimore'? Give me their last names.\nAdditional table information: table: club_1", "answer": "SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore'"} {"question": "What is the average capacity of the stadiums that were opened in year 2005?\nAdditional table information: table: swimming", "answer": "SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005"} {"question": "What is the name and age of every male? Order the results by age.\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE gender = 'male' ORDER BY age NULLS FIRST"} {"question": "What are the maximum duration and resolution of all songs, for each language, ordered alphabetically by language?\nAdditional table information: table: music_1", "answer": "SELECT MAX(T1.duration), MAX(T2.resolution), T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.languages ORDER BY T2.languages NULLS FIRST"} {"question": "Find the number and averaged salary of all instructors who are in the department with the highest budget.\nAdditional table information: table: college_2", "answer": "SELECT AVG(T1.salary), COUNT(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1"} {"question": "Return the total revenue of companies with headquarters in Tokyo or Taiwan.\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan'"} {"question": "How many architects haven't built a mill before year 1850?\nAdditional table information: table: architecture", "answer": "SELECT COUNT(*) FROM architect WHERE NOT id IN (SELECT architect_id FROM mill WHERE built_year < 1850)"} {"question": "Find the titles of papers whose first author is affiliated with an institution in the country 'Japan' and has last name 'Ohori'?\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = 'Japan' AND t2.authorder = 1 AND t1.lname = 'Ohori'"} {"question": "Return the address content for the customer whose name is 'Maudie Kertzmann'.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = 'Maudie Kertzmann'"} {"question": "List the description of all aircrafts.\nAdditional table information: table: aircraft", "answer": "SELECT Description FROM aircraft"} {"question": "How many instrument does the musician with last name 'Heilo' use?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = 'Heilo'"} {"question": "Show the cinema name and location for cinemas with capacity above average.\nAdditional table information: table: cinema", "answer": "SELECT name, LOCATION FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema)"} {"question": "Which customers have ever canceled the purchase of the product 'food' (the item status is 'Cancel')?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1, orders AS T2, order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = 'Cancel' AND T4.product_name = 'food' GROUP BY T1.customer_id HAVING COUNT(*) >= 1"} {"question": "What is the campus fee of 'San Francisco State University' in year 2000?\nAdditional table information: table: csu_1", "answer": "SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = 'San Francisco State University' AND t1.year = 2000"} {"question": "What are the different product names for products that have the 'warm' characteristic:?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'warm'"} {"question": "Which party has two or more records?\nAdditional table information: table: election", "answer": "SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2"} {"question": "List the names of all distinct wines that are made of red color grape.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red'"} {"question": "Return each apartment type code along with the maximum and minimum number of rooms among each type.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM Apartments GROUP BY apt_type_code"} {"question": "List the most common type of artworks.\nAdditional table information: table: entertainment_awards", "answer": "SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the id of the product that is booked for 3 times?\nAdditional table information: table: products_for_hire", "answer": "SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3"} {"question": "Find the first name and office of history professor who did not get a Ph.D. degree.\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree <> 'Ph.D.'"} {"question": "What is the carrier of the most expensive phone?\nAdditional table information: table: phone_market", "answer": "SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1"} {"question": "What are the name and id of the team with the most victories in 2008 postseason?\nAdditional table information: table: baseball_1", "answer": "SELECT T2.name, T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many faculty members did the university that conferred the most degrees in 2002 have?\nAdditional table information: table: csu_1", "answer": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1"} {"question": "Give the maximum and minimum weeks on top across all volumes.\nAdditional table information: table: music_4", "answer": "SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume"} {"question": "Which authors belong to the institution 'Google'? Show the first names and last names.\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'Google'"} {"question": "What is the name of party with most number of members?\nAdditional table information: table: party_people", "answer": "SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which states have more than 2 parks?\nAdditional table information: table: baseball_1", "answer": "SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2"} {"question": "List the research staff details, and order in ascending order.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT staff_details FROM Research_Staff ORDER BY staff_details ASC NULLS FIRST"} {"question": "Find the first names of students whose first names contain letter 'a'.\nAdditional table information: table: college_3", "answer": "SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'"} {"question": "How many accounts are there?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Accounts"} {"question": "What are the first names of students in room 108?\nAdditional table information: table: student_1", "answer": "SELECT firstname FROM list WHERE classroom = 108"} {"question": "What are the names of all songs that are ordered by their resolution numbers?\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song ORDER BY resolution NULLS FIRST"} {"question": "Which Payments were processed with Visa? List the payment Id, the date and the amount.\nAdditional table information: table: insurance_policies", "answer": "SELECT Payment_ID, Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'"} {"question": "Which advisors have more than two students?\nAdditional table information: table: voter_2", "answer": "SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2"} {"question": "Find all the phone numbers.\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_phone FROM available_policies"} {"question": "What are the name of rooms that cost more than the average.\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms)"} {"question": "List the names of hosts who did not serve as a host of any party in our record.\nAdditional table information: table: party_host", "answer": "SELECT Name FROM HOST WHERE NOT Host_ID IN (SELECT Host_ID FROM party_host)"} {"question": "What is the name of the song that was released in the most recent year?\nAdditional table information: table: music_1", "answer": "SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1"} {"question": "What are the years of film market estimation for the market of Japan, ordered by year descending?\nAdditional table information: table: film_rank", "answer": "SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = 'Japan' ORDER BY T1.Year DESC"} {"question": "Which delegates are from counties with population smaller than 100000?\nAdditional table information: table: election", "answer": "SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000"} {"question": "How many accounts do we have?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Accounts"} {"question": "What are the names and seatings for all tracks opened after 2000, ordered by seating?\nAdditional table information: table: race_track", "answer": "SELECT name, seating FROM track WHERE year_opened > 2000 ORDER BY seating NULLS FIRST"} {"question": "List the names of all routes in alphabetic order.\nAdditional table information: table: customer_deliveries", "answer": "SELECT route_name FROM Delivery_Routes ORDER BY route_name NULLS FIRST"} {"question": "Who is the president of the club 'Bootup Baltimore'? Give me the first and last name.\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t2.position = 'President'"} {"question": "Give the average quantity of stocks.\nAdditional table information: table: device", "answer": "SELECT AVG(Quantity) FROM stock"} {"question": "How many project members were leaders or started working before '1989-04-24 23:51:54'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'"} {"question": "What is the maximum, minimum, and average amount of money outsanding for all customers?\nAdditional table information: table: driving_school", "answer": "SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers"} {"question": "What are names of the movies that are either made after 2000 or reviewed by Brittany Harris?\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000"} {"question": "order all gas station locations by the opening year.\nAdditional table information: table: gas_company", "answer": "SELECT LOCATION FROM gas_station ORDER BY open_year NULLS FIRST"} {"question": "What are the statement ids, statement details, and account details, for all accounts?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.statement_id, T2.statement_details, T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id"} {"question": "What are the types and nationalities of every ship?\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE, Nationality FROM ship"} {"question": "Find the catalog publisher that has the most catalogs.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the description of the product called 'Chocolate'.\nAdditional table information: table: customer_complaints", "answer": "SELECT product_description FROM products WHERE product_name = 'Chocolate'"} {"question": "What are the names of the songs that have a lower rating than at least one blues song?\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = 'blues')"} {"question": "What are the names of organizations that contain the word 'Party'?\nAdditional table information: table: e_government", "answer": "SELECT organization_name FROM organizations WHERE organization_name LIKE '%Party%'"} {"question": "What instruments did the musician with the last name 'Heilo' play in 'Badlands'?\nAdditional table information: table: music_2", "answer": "SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = 'Heilo' AND T3.title = 'Badlands'"} {"question": "Show all student ids and the number of hours played.\nAdditional table information: table: game_1", "answer": "SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid"} {"question": "Find the name of physicians who are affiliated with Surgery or Psychiatry department.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' OR T3.name = 'Psychiatry'"} {"question": "What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20?\nAdditional table information: table: products_for_hire", "answer": "SELECT product_name, product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20"} {"question": "Find id of the candidate who most recently accessed the course?\nAdditional table information: table: student_assessment", "answer": "SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1"} {"question": "Show the 3 counties with the smallest population.\nAdditional table information: table: election", "answer": "SELECT County_name FROM county ORDER BY Population ASC NULLS FIRST LIMIT 3"} {"question": "What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.\nAdditional table information: table: perpetrator", "answer": "SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country"} {"question": "What are the different instruments listed in the database?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT instrument FROM Instruments"} {"question": "display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%' ORDER BY department_id NULLS FIRST"} {"question": "Show the different headquarters and number of companies at each headquarter.\nAdditional table information: table: company_employee", "answer": "SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters"} {"question": "How many patents outcomes were listed for all the projects?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'"} {"question": "Find the movies with the highest average rating. Return the movie titles and average rating.\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) DESC LIMIT 1"} {"question": "What are the different states that had students successfully try out?\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'"} {"question": "What are the id of problems reported by the staff named Dameon Frami or Jolie Weber?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Dameon' AND T2.staff_last_name = 'Frami' UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Jolie' AND T2.staff_last_name = 'Weber'"} {"question": "How many lessons have been cancelled?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = 'Cancelled'"} {"question": "Which paper's title contains the word 'Database'?\nAdditional table information: table: icfp_1", "answer": "SELECT title FROM papers WHERE title LIKE '%Database%'"} {"question": "How much amount in total were claimed in the most recently created document?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT SUM(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date NULLS FIRST LIMIT 1)"} {"question": "List all role codes, role names, and role descriptions.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code, role_name, role_description FROM ROLES"} {"question": "What is the total population for all the districts that have an area larger tahn the average city area?\nAdditional table information: table: store_product", "answer": "SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district)"} {"question": "List all the policy types used by the customer enrolled in the most policies.\nAdditional table information: table: insurance_fnol", "answer": "SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What are all the payment methods?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT DISTINCT payment_method FROM customers"} {"question": "What is the name of the patient who made the most recent appointment?\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1"} {"question": "What is the last name of the author that has published the most papers?\nAdditional table information: table: icfp_1", "answer": "SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the most common location of performances.\nAdditional table information: table: performance_attendance", "answer": "SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the number of projects.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Projects"} {"question": "Show the headquarters that have both companies in banking industry and companies in oil and gas industry.\nAdditional table information: table: company_employee", "answer": "SELECT Headquarters FROM company WHERE Industry = 'Banking' INTERSECT SELECT Headquarters FROM company WHERE Industry = 'Oil and gas'"} {"question": "Return the first names and last names of all guests\nAdditional table information: table: apartment_rentals", "answer": "SELECT guest_first_name, guest_last_name FROM Guests"} {"question": "What is the birthday of the staff member with first name as Janessa and last name as Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT date_of_birth FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'"} {"question": "Find the number of teachers who teach the student called MADLOCK RAY.\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'MADLOCK' AND T1.lastname = 'RAY'"} {"question": "How many buildings are there?\nAdditional table information: table: protein_institute", "answer": "SELECT COUNT(*) FROM building"} {"question": "Find the name, class and rank of all captains.\nAdditional table information: table: ship_1", "answer": "SELECT name, CLASS, rank FROM captain"} {"question": "Show the title and director for all films.\nAdditional table information: table: cinema", "answer": "SELECT title, directed_by FROM film"} {"question": "Which park did the most people attend in 2008?\nAdditional table information: table: baseball_1", "answer": "SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1"} {"question": "What are the names of the stations which serve both 'Ananthapuri Express' and 'Guruvayur Express' trains?\nAdditional table information: table: train_station", "answer": "SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = 'Ananthapuri Express' INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = 'Guruvayur Express'"} {"question": "What is the payment method code and party phone of the party with the email 'enrico09@example.com'?\nAdditional table information: table: e_government", "answer": "SELECT payment_method_code, party_phone FROM parties WHERE party_email = 'enrico09@example.com'"} {"question": "Show all distinct building descriptions.\nAdditional table information: table: apartment_rentals", "answer": "SELECT DISTINCT building_description FROM Apartment_Buildings"} {"question": "Give the names of characteristics that are in two or more products?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2"} {"question": "How many film are there?\nAdditional table information: table: film_rank", "answer": "SELECT COUNT(*) FROM film"} {"question": "What is the average number of years spent working as a journalist?\nAdditional table information: table: news_report", "answer": "SELECT AVG(Years_working) FROM journalist"} {"question": "What are the descriptions of the service types with product price above 100?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100"} {"question": "Give the distinct famous release dates for all artists.\nAdditional table information: table: music_4", "answer": "SELECT DISTINCT (Famous_Release_date) FROM artist"} {"question": "Show the different countries and the number of members from each.\nAdditional table information: table: decoration_competition", "answer": "SELECT Country, COUNT(*) FROM member GROUP BY Country"} {"question": "What is the type of vocals that the band member with the last name 'Heilo' played the most?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = 'Heilo' GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "what are the names and classes of the ships that do not have any captain yet?\nAdditional table information: table: ship_1", "answer": "SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)"} {"question": "What are the number of different course codes?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT crs_code) FROM CLASS"} {"question": "Count the number of clubs for which the student named 'Eric Tai' is a member.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Eric' AND t3.lname = 'Tai'"} {"question": "Find the total hours of all projects.\nAdditional table information: table: scientist_1", "answer": "SELECT SUM(hours) FROM projects"} {"question": "What are the login names used both by some course authors and some students?\nAdditional table information: table: e_learning", "answer": "SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students"} {"question": "Which nationality has the most hosts?\nAdditional table information: table: party_host", "answer": "SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many different departments are there?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_name) FROM department"} {"question": "What is the date of enrollment of the course named 'Spanish'?\nAdditional table information: table: e_learning", "answer": "SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'Spanish'"} {"question": "Which contact channel codes were used less than 5 times?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5"} {"question": "What are the first names of all teachers who have taught a course and the corresponding course codes?\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num"} {"question": "Which major has most number of students?\nAdditional table information: table: allergy_1", "answer": "SELECT major FROM Student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the campus fee for San Jose State University in 1996?\nAdditional table information: table: csu_1", "answer": "SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND T2.year = 1996"} {"question": "What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?\nAdditional table information: table: entrepreneur", "answer": "SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor"} {"question": "Find names and ids of all documents with document type code BK.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_name, document_id FROM Documents WHERE document_type_code = 'BK'"} {"question": "What are the id and name of the stations that have ever had more than 12 bikes available?\nAdditional table information: table: bike_1", "answer": "SELECT DISTINCT T1.id, T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12"} {"question": "Find the number of papers published by the institution 'University of Pennsylvania'.\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'University of Pennsylvania'"} {"question": "List Aerosmith's albums.\nAdditional table information: table: store_1", "answer": "SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = 'Aerosmith'"} {"question": "What are the full names of faculty members who are a part of department 520?\nAdditional table information: table: college_3", "answer": "SELECT T1.Fname, T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520"} {"question": "List the most common result of the musicals.\nAdditional table information: table: musical", "answer": "SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average price range of hotels for each each star rating code?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code"} {"question": "What is the average balance in checking accounts?\nAdditional table information: table: small_bank_1", "answer": "SELECT AVG(balance) FROM checking"} {"question": "Return the low and high estimates for all film markets.\nAdditional table information: table: film_rank", "answer": "SELECT Low_Estimate, High_Estimate FROM film_market_estimation"} {"question": "What is the number of routes that end at John F Kennedy International Airport?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'"} {"question": "Return the maximum and minimum customer codes.\nAdditional table information: table: department_store", "answer": "SELECT MAX(customer_code), MIN(customer_code) FROM Customers"} {"question": "What are the names of enzymes whose product is not 'Heme'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name FROM enzyme WHERE product <> 'Heme'"} {"question": "Return the total number of deaths and total damange in millions for storms that had a max speed greater than the average.\nAdditional table information: table: storm_record", "answer": "SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)"} {"question": "What are the name and assets of each company, sorted in ascending order of company name?\nAdditional table information: table: company_office", "answer": "SELECT name, Assets_billion FROM Companies ORDER BY name ASC NULLS FIRST"} {"question": "Which skill is used in fixing the most number of faults? List the skill id and description.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.skill_id, T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the budget type codes, budget type descriptions and document ids for documents with expenses.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code"} {"question": "What are the first name and last name of the players who were paid salary by team Washington Nationals in both 2005 and 2007?\nAdditional table information: table: baseball_1", "answer": "SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'"} {"question": "How many students are affected by food related allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = 'food'"} {"question": "Find the players whose names contain letter 'a'.\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'"} {"question": "Find all information about student addresses, and sort by monthly rental in descending order.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC"} {"question": "Find the title of the course that is offered by more than one department.\nAdditional table information: table: college_2", "answer": "SELECT title FROM course GROUP BY title HAVING COUNT(*) > 1"} {"question": "Find the name of the storm that affected both Afghanistan and Albania regions.\nAdditional table information: table: storm_record", "answer": "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'"} {"question": "Find the personal names of students not enrolled in any course.\nAdditional table information: table: e_learning", "answer": "SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id"} {"question": "Which tourist attractions does the visitor with detail 'Vincent' visit?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = 'Vincent'"} {"question": "Find the first names of the teachers that teach first grade.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1"} {"question": "How many customers are living in city 'Lake Geovannyton'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = 'Lake Geovannyton'"} {"question": "List the id of students who attended some courses?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_attendance"} {"question": "For each customer status code, how many customers are classified that way?\nAdditional table information: table: driving_school", "answer": "SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code"} {"question": "Which cities' temperature in March is lower than that in July or higher than that in Oct?\nAdditional table information: table: city_record", "answer": "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"} {"question": "Show the types of schools that have two schools.\nAdditional table information: table: school_bus", "answer": "SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2"} {"question": "What campus has the most degrees conferrred over its entire existence?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1"} {"question": "What are the movie titles and average rating of the movies with the lowest average rating?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) NULLS FIRST LIMIT 1"} {"question": "What are the names of the characteristics of the product 'sesame' that have the characteristic type code 'Grade'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'sesame' AND t3.characteristic_type_code = 'Grade'"} {"question": "What is the id, forename, and number of races for all drivers that have participated in at least 2 races?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2"} {"question": "List the codes of all courses that take place in room KLR209.\nAdditional table information: table: college_1", "answer": "SELECT class_code FROM CLASS WHERE class_room = 'KLR209'"} {"question": "Find the name of instructors who are advisors of the students from the Math department, and sort the results by students' total credit.\nAdditional table information: table: college_2", "answer": "SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred NULLS FIRST"} {"question": "Show the pair of male and female names in all weddings after year 2014\nAdditional table information: table: wedding", "answer": "SELECT T2.name, T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014"} {"question": "What are the allergies and their types?\nAdditional table information: table: allergy_1", "answer": "SELECT allergy, allergytype FROM Allergy_type"} {"question": "What is average age of male for different job title?\nAdditional table information: table: network_2", "answer": "SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job"} {"question": "Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = 'John Anthony')"} {"question": "List the id of students who registered course statistics in the order of registration date.\nAdditional table information: table: student_assessment", "answer": "SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'statistics' ORDER BY T2.registration_date NULLS FIRST"} {"question": "Show the names of cities in counties that have a crime rate less than 100.\nAdditional table information: table: county_public_safety", "answer": "SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100)"} {"question": "Find products with max page size as 'A4' and pages per minute color smaller than 5.\nAdditional table information: table: store_product", "answer": "SELECT product FROM product WHERE max_page_size = 'A4' AND pages_per_minute_color < 5"} {"question": "How many games in 1885 postseason resulted in ties (that is, the value of 'ties' is '1')?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM postseason WHERE YEAR = 1885 AND ties = 1"} {"question": "What categories have two or more corresponding books that were made after 1989?\nAdditional table information: table: culture_company", "answer": "SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING COUNT(*) >= 2"} {"question": "What are the titles of films that do not have a film market estimation?\nAdditional table information: table: film_rank", "answer": "SELECT Title FROM film WHERE NOT Film_ID IN (SELECT Film_ID FROM film_market_estimation)"} {"question": "Return the names of all counties sorted by county name in descending alphabetical order.\nAdditional table information: table: election", "answer": "SELECT County_name FROM county ORDER BY County_name DESC"} {"question": "What is the campus fee in the year 2000 for San Jose State University?\nAdditional table information: table: csu_1", "answer": "SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = 'San Jose State University' AND t1.year = 2000"} {"question": "Show the names of products that are in at least two events in ascending alphabetical order of product name.\nAdditional table information: table: solvency_ii", "answer": "SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 ORDER BY T1.Product_Name NULLS FIRST"} {"question": "What is the day Number and date of all the documents?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date"} {"question": "What is the sum of hours for projects that scientists with the name Michael Rogers or Carol Smith are assigned to?\nAdditional table information: table: scientist_1", "answer": "SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith'"} {"question": "List the wheels and locations of the railways.\nAdditional table information: table: railway", "answer": "SELECT Wheels, LOCATION FROM railway"} {"question": "find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.\nAdditional table information: table: gas_company", "answer": "SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion NULLS FIRST, profits_billion NULLS FIRST"} {"question": "Find the name and building of the department with the highest budget.\nAdditional table information: table: college_2", "answer": "SELECT dept_name, building FROM department ORDER BY budget DESC LIMIT 1"} {"question": "What are the distinct first names for students with a grade point of 3.8 or above in at least one course?\nAdditional table information: table: college_3", "answer": "SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1, GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8"} {"question": "How many tracks do we have?\nAdditional table information: table: race_track", "answer": "SELECT COUNT(*) FROM track"} {"question": "What is the winery at which the wine with the highest score was made?\nAdditional table information: table: wine_1", "answer": "SELECT Winery FROM WINE ORDER BY SCORE NULLS FIRST LIMIT 1"} {"question": "How many trips did not end in San Francisco?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city <> 'San Francisco'"} {"question": "Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?\nAdditional table information: table: city_record", "answer": "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"} {"question": "Find the titles of all the papers written by 'Jeremy Gibbons'\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Jeremy' AND t1.lname = 'Gibbons'"} {"question": "What is the average fee for a CSU campus in the year of 2005?\nAdditional table information: table: csu_1", "answer": "SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005"} {"question": "Give the section titles of the document with the name 'David CV'.\nAdditional table information: table: document_management", "answer": "SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = 'David CV'"} {"question": "For each position, what is the average number of points for players in that position?\nAdditional table information: table: sports_competition", "answer": "SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION"} {"question": "Give the maximum and minimum product prices for each product type, grouped and ordered by product type.\nAdditional table information: table: department_store", "answer": "SELECT MAX(product_price), MIN(product_price), product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code NULLS FIRST"} {"question": "Count the number of institutions.\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(*) FROM inst"} {"question": "For each classroom, show the classroom number and find how many students are using it.\nAdditional table information: table: student_1", "answer": "SELECT classroom, COUNT(*) FROM list GROUP BY classroom"} {"question": "Which tourist attractions are related to royal family? Tell me their details and how we can get there.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Royal_Family_Details, T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID"} {"question": "List the countries having more than 4 addresses listed.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4"} {"question": "Show the description and code of the attraction type most tourist attractions belong to.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Attraction_Type_Description, T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Who advises student 1004?\nAdditional table information: table: allergy_1", "answer": "SELECT Advisor FROM Student WHERE StuID = 1004"} {"question": "What are the average profits of companies?\nAdditional table information: table: company_office", "answer": "SELECT AVG(Profits_billion) FROM Companies"} {"question": "How many friends does Dan have?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'"} {"question": "How many rooms have king beds? Report the number for each decor type.\nAdditional table information: table: inn_1", "answer": "SELECT decor, COUNT(*) FROM Rooms WHERE bedType = 'King' GROUP BY decor"} {"question": "Which patient is undergoing the most recent treatment?\nAdditional table information: table: hospital_1", "answer": "SELECT patient FROM undergoes ORDER BY dateundergoes NULLS FIRST LIMIT 1"} {"question": "What are the names of all the circuits that are in the UK or Malaysia?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM circuits WHERE country = 'UK' OR country = 'Malaysia'"} {"question": "What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\nAdditional table information: table: department_management", "answer": "SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama'"} {"question": "What are the names of customers who live in Colorado state?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'Colorado'"} {"question": "Show each author and the number of workshops they submitted to.\nAdditional table information: table: workshop_paper", "answer": "SELECT T2.Author, COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author"} {"question": "How many books fall into each category?\nAdditional table information: table: culture_company", "answer": "SELECT category, COUNT(*) FROM book_club GROUP BY category"} {"question": "What are the names and ids of products costing between 600 and 700?\nAdditional table information: table: department_store", "answer": "SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700"} {"question": "What is the last name of the student who received an A in the class with the code 10018?\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018"} {"question": "What is the average and minimum age of all artists from United States.\nAdditional table information: table: theme_gallery", "answer": "SELECT AVG(age), MIN(age) FROM artist WHERE country = 'United States'"} {"question": "How many different teams have had eliminated wrestlers?\nAdditional table information: table: wrestler", "answer": "SELECT COUNT(DISTINCT team) FROM elimination"} {"question": "List the season, home team, away team of all the games.\nAdditional table information: table: game_injury", "answer": "SELECT season, home_team, away_team FROM game"} {"question": "Which county do the delegates on 'Appropriations' committee belong to? Give me the county names.\nAdditional table information: table: election", "answer": "SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = 'Appropriations'"} {"question": "Show the names of journalists and the number of events they reported.\nAdditional table information: table: news_report", "answer": "SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name"} {"question": "display the employee number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, job_id FROM employees WHERE salary < (SELECT MIN(salary) FROM employees WHERE job_id = 'MK_MAN')"} {"question": "Find the number of distinct gender for dorms.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(DISTINCT gender) FROM dorm"} {"question": "Show the name of the shop that has the most kind of devices in stock.\nAdditional table information: table: device", "answer": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which players won awards in both 1960 and 1961? Return their first names and last names.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_first, T1.name_last FROM player AS T1, player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1, player_award AS T2 WHERE T2.year = 1961"} {"question": "How many advisors are there?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(DISTINCT advisor) FROM Student"} {"question": "How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?\nAdditional table information: table: inn_1", "answer": "SELECT Kids FROM Reservations WHERE CheckIn = '2010-09-21' AND FirstName = 'DAMIEN' AND LastName = 'TRACHSEL'"} {"question": "Count the number of universities that do not participate in the baketball match.\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match)"} {"question": "Return the minister who left office at the latest time.\nAdditional table information: table: party_people", "answer": "SELECT minister FROM party ORDER BY left_office DESC LIMIT 1"} {"question": "Show all calendar dates and day Numbers.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT calendar_date, day_Number FROM Ref_calendar"} {"question": "Find the name and training hours of players whose hours are below 1500.\nAdditional table information: table: soccer_2", "answer": "SELECT pName, HS FROM Player WHERE HS < 1500"} {"question": "Find the names of the customers who have an deputy policy.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = 'Deputy'"} {"question": "Find the distinct winery of wines having price between 50 and 100.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100"} {"question": "Find the name of the organization that has published the largest number of papers.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Who were the governors of the parties associated with delegates from district 1?\nAdditional table information: table: election", "answer": "SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1"} {"question": "What is the average number of audience for festivals?\nAdditional table information: table: entertainment_awards", "answer": "SELECT AVG(Num_of_Audience) FROM festival_detail"} {"question": "Give me the the customer details and id for the customers who had two or more policies but did not file any claims.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id"} {"question": "display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding Clara.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = 'Clara') AND first_name <> 'Clara'"} {"question": "What are the names of cities that are in counties that have a crime rate below 100?\nAdditional table information: table: county_public_safety", "answer": "SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100)"} {"question": "Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount.\nAdditional table information: table: insurance_policies", "answer": "SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC NULLS FIRST LIMIT 1"} {"question": "How many companies are headquartered in the US?\nAdditional table information: table: company_employee", "answer": "SELECT COUNT(*) FROM company WHERE Headquarters = 'USA'"} {"question": "Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.\nAdditional table information: table: loan_1", "answer": "SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY SUM(T1.amount) DESC LIMIT 1"} {"question": "How many different cities are they from?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(DISTINCT city) FROM Person"} {"question": "For each product which has problems, what are the number of problems and the product id?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id"} {"question": "Find the names of all instructors in computer science department\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'"} {"question": "How many different cities have these stations?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(DISTINCT city) FROM station"} {"question": "Count the number of statements.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Statements"} {"question": "Show the leader names and locations of colleges.\nAdditional table information: table: decoration_competition", "answer": "SELECT Leader_Name, College_Location FROM college"} {"question": "What is the zip code of staff with first name as Janessa and last name as Sawayn lived?\nAdditional table information: table: driving_school", "answer": "SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "What are the first names of all the students aged above 22?\nAdditional table information: table: voter_2", "answer": "SELECT Fname FROM STUDENT WHERE Age > 22"} {"question": "Find the number of bands.\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM Band"} {"question": "What is the total number of ratings that has more than 3 stars?\nAdditional table information: table: movie_1", "answer": "SELECT COUNT(*) FROM Rating WHERE stars > 3"} {"question": "What are the drivers' first names,last names, and ids for all those that had more than 8 stops or participated in more than 5 races?\nAdditional table information: table: formula_1", "answer": "SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5"} {"question": "What are the different allergy types?\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT allergytype FROM Allergy_type"} {"question": "Show the names of products that are in at least two events.\nAdditional table information: table: solvency_ii", "answer": "SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2"} {"question": "What is the average number of bedrooms of all apartments?\nAdditional table information: table: apartment_rentals", "answer": "SELECT AVG(bedroom_count) FROM Apartments"} {"question": "Which document has the most draft copies? List its document id and number of draft copies.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_id, COUNT(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY COUNT(copy_number) DESC LIMIT 1"} {"question": "List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.\nAdditional table information: table: flight_company", "answer": "SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services'"} {"question": "Find the start and end dates of detentions of teachers with last name 'Schultz'.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.datetime_detention_start, datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = 'Schultz'"} {"question": "What are the names of the customers and staff members?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT customer_details FROM customers UNION SELECT staff_details FROM staff"} {"question": "What are the clean and jerk score of the body builder with the highest total score?\nAdditional table information: table: body_builder", "answer": "SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1"} {"question": "What are the investors that have invested in at least two entrepreneurs?\nAdditional table information: table: entrepreneur", "answer": "SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2"} {"question": "Find the number of rooms with king bed for each decor type.\nAdditional table information: table: inn_1", "answer": "SELECT decor, COUNT(*) FROM Rooms WHERE bedType = 'King' GROUP BY decor"} {"question": "What are the different locations of the school with the code BUS?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_address) FROM department WHERE school_code = 'BUS'"} {"question": "Find the names of all reviewers who rated Gone with the Wind.\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind'"} {"question": "Please show the date of ceremony of the volumes that last more than 2 weeks on top.\nAdditional table information: table: music_4", "answer": "SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2"} {"question": "Return the completion date for all the tests that have 'Fail' result.\nAdditional table information: table: e_learning", "answer": "SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = 'Fail'"} {"question": "What are the opening years in which at least two shops opened?\nAdditional table information: table: shop_membership", "answer": "SELECT open_year FROM branch GROUP BY open_year HAVING COUNT(*) >= 2"} {"question": "What are the types of vocals that the band member with the first name 'Solveig' played the most?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = 'Solveig' GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the rating of the restaurant Subway?\nAdditional table information: table: restaurant_1", "answer": "SELECT Rating FROM Restaurant WHERE ResName = 'Subway'"} {"question": "Return the last name of the staff member who handled the complaint with the earliest date raised.\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised NULLS FIRST LIMIT 1"} {"question": "What is the number of professors who are in the Accounting or Biology departments?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'"} {"question": "Give me a list of the names of all songs ordered by their resolution.\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song ORDER BY resolution NULLS FIRST"} {"question": "When did the first staff for the projects started working?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT date_from FROM Project_Staff ORDER BY date_from ASC NULLS FIRST LIMIT 1"} {"question": "Find the physicians who are trained in a procedure that costs more than 5000.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T3.cost > 5000"} {"question": "Find the number of characteristics that the product 'flax' has.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'flax'"} {"question": "Find the name of the candidates whose oppose percentage is the lowest for each sex.\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex"} {"question": "What is the description for the results whose project detail is 'sint'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'"} {"question": "What are the names of the colleges that are larger than at least one college in Florida?\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT cName FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL')"} {"question": "What is the status code with the least number of customers?\nAdditional table information: table: driving_school", "answer": "SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What are the IDs of customers who have 'Diana' in part of their names?\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_id FROM customers WHERE customer_name LIKE '%Diana%'"} {"question": "What are the order ids and customer ids for orders that have been Cancelled, sorted by their order dates?\nAdditional table information: table: department_store", "answer": "SELECT order_id, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' ORDER BY order_date NULLS FIRST"} {"question": "What are the 3 counties that have the smallest population? Give me the county names.\nAdditional table information: table: election", "answer": "SELECT County_name FROM county ORDER BY Population ASC NULLS FIRST LIMIT 3"} {"question": "List the phone numbers of all employees.\nAdditional table information: table: chinook_1", "answer": "SELECT Phone FROM EMPLOYEE"} {"question": "What is the average number of international passengers of all airports?\nAdditional table information: table: aircraft", "answer": "SELECT AVG(International_Passengers) FROM airport"} {"question": "Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on Sep 21, 2010.\nAdditional table information: table: inn_1", "answer": "SELECT Kids FROM Reservations WHERE CheckIn = '2010-09-21' AND FirstName = 'DAMIEN' AND LastName = 'TRACHSEL'"} {"question": "For each project id, how many tasks are there?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id"} {"question": "What is the card type code with most number of cards?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the countries that have more than one mountain.\nAdditional table information: table: climbing", "answer": "SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1"} {"question": "Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts.\nAdditional table information: table: apartment_rentals", "answer": "SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC"} {"question": "For each company id, what are the companies and how many gas stations does each one operate?\nAdditional table information: table: gas_company", "answer": "SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id"} {"question": "Show the names of products and the number of events they are in.\nAdditional table information: table: solvency_ii", "answer": "SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name"} {"question": "What are the maximum price and score of wines produced by St. Helena appelation?\nAdditional table information: table: wine_1", "answer": "SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = 'St. Helena'"} {"question": "Count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10.\nAdditional table information: table: theme_gallery", "answer": "SELECT COUNT(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10"} {"question": "Find the number of items without any review.\nAdditional table information: table: epinions_1", "answer": "SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review)"} {"question": "What are the names of all employees who have a salary higher than average?\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Employee WHERE salary > (SELECT AVG(salary) FROM Employee)"} {"question": "Find the total number of students living in the male dorm (with gender M).\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M'"} {"question": "How many songs have used the instrument 'drums'?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM instruments WHERE instrument = 'drums'"} {"question": "What are the ids of all students who have advisor number 1121?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE Advisor = 1121"} {"question": "Which team has the oldest player?\nAdditional table information: table: school_player", "answer": "SELECT Team FROM player ORDER BY Age DESC LIMIT 1"} {"question": "How many counties are there in total?\nAdditional table information: table: election", "answer": "SELECT COUNT(*) FROM county"} {"question": "For grants that have descriptions of Regular and Initial Applications, what are their start dates?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'"} {"question": "Which membership card has more than 5 members?\nAdditional table information: table: coffee_shop", "answer": "SELECT Membership_card FROM member GROUP BY Membership_card HAVING COUNT(*) > 5"} {"question": "How many patients are not using Procrastin-X as medication?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*) FROM patient WHERE NOT SSN IN (SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X')"} {"question": "Show the number of cities in counties that have a population more than 20000.\nAdditional table information: table: county_public_safety", "answer": "SELECT COUNT(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000)"} {"question": "Return the name of the heaviest entrepreneur.\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1"} {"question": "What are the distinct districts for elections?\nAdditional table information: table: election", "answer": "SELECT DISTINCT District FROM election"} {"question": "Show the id and builder of the railway that are associated with the most trains.\nAdditional table information: table: railway", "answer": "SELECT T2.Railway_ID, T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the minimum, maximum, and average seating for all tracks.\nAdditional table information: table: race_track", "answer": "SELECT MIN(seating), MAX(seating), AVG(seating) FROM track"} {"question": "Find the founded year of the newest non public school.\nAdditional table information: table: university_basketball", "answer": "SELECT founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC LIMIT 1"} {"question": "How many departments offer courses?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT dept_name) FROM course"} {"question": "Show the number of transactions for different investors.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT investor_id, COUNT(*) FROM TRANSACTIONS GROUP BY investor_id"} {"question": "Return the name and job title of the staff with the latest date assigned.\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_name, T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1"} {"question": "Find the names of customers who either have an deputy policy or uniformed policy.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = 'Deputy' OR t1.policy_type_code = 'Uniform'"} {"question": "What are the names of all male British artists?\nAdditional table information: table: music_1", "answer": "SELECT artist_name FROM artist WHERE country = 'UK' AND gender = 'Male'"} {"question": "What is the type of allergy Cat?\nAdditional table information: table: allergy_1", "answer": "SELECT allergytype FROM Allergy_type WHERE allergy = 'Cat'"} {"question": "For each college, return the college name and the count of authors with submissions from that college.\nAdditional table information: table: workshop_paper", "answer": "SELECT College, COUNT(*) FROM submission GROUP BY College"} {"question": "what is the last name and gender of all students who played both Call of Destiny and Works of Widenius?\nAdditional table information: table: game_1", "answer": "SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = 'Call of Destiny' INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = 'Works of Widenius')"} {"question": "Show all headquarters with both a company in banking industry and a company in Oil and gas.\nAdditional table information: table: gas_company", "answer": "SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'"} {"question": "How many companies are in either 'Banking' industry or 'Conglomerate' industry?\nAdditional table information: table: company_office", "answer": "SELECT COUNT(*) FROM Companies WHERE Industry = 'Banking' OR Industry = 'Conglomerate'"} {"question": "What are the email addresses of teachers whose address has zip code '918'?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = '918'"} {"question": "For how many clubs is 'Tracy Kim' a member?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Tracy' AND t3.lname = 'Kim'"} {"question": "List first name and last name of customers that have more than 2 payments.\nAdditional table information: table: driving_school", "answer": "SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2"} {"question": "how many degrees were conferred between 1998 and 2002?\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus"} {"question": "How many games in total did team Boston Red Stockings attend from 2000 to 2010?\nAdditional table information: table: baseball_1", "answer": "SELECT SUM(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010"} {"question": "What are the names of the services that have never been used?\nAdditional table information: table: e_government", "answer": "SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id"} {"question": "Which problem log was created most recently? Give me the log id.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1"} {"question": "Count the number of customers that have an email containing 'gmail.com'.\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE '%gmail.com%'"} {"question": "Show white percentages of cities and the crime rates of counties they are in.\nAdditional table information: table: county_public_safety", "answer": "SELECT T1.White, T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID"} {"question": "What are the names of gymnasts?\nAdditional table information: table: gymnast", "answer": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID"} {"question": "What are the descriptions of the categories that products with product descriptions that contain the letter t are in?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'"} {"question": "Show the employee ids and the number of documents destroyed by each employee.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID"} {"question": "How many voting records do we have?\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(*) FROM VOTING_RECORD"} {"question": "What are the vocal types used in song 'Badlands'?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Badlands'"} {"question": "Select the name and price of the cheapest product.\nAdditional table information: table: manufactory_1", "answer": "SELECT name, price FROM Products ORDER BY price ASC NULLS FIRST LIMIT 1"} {"question": "What is the least common media type in all tracks?\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT product, chromosome, porphyria FROM enzyme WHERE LOCATION = 'Cytosol'"} {"question": "Find the name of the airport in the city of Goroka.\nAdditional table information: table: flight_4", "answer": "SELECT name FROM airports WHERE city = 'Goroka'"} {"question": "What is the name of the ship that is commanded by the youngest captain?\nAdditional table information: table: ship_1", "answer": "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"} {"question": "What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff?\nAdditional table information: table: department_store", "answer": "SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT MAX(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff')"} {"question": "What is the id of the instructor who advises of all students from History department?\nAdditional table information: table: college_2", "answer": "SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'"} {"question": "Count the number of captains that have each rank.\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(*), rank FROM captain GROUP BY rank"} {"question": "For each product, return its id and the number of times it was ordered.\nAdditional table information: table: tracking_orders", "answer": "SELECT COUNT(*), T3.product_id FROM orders AS T1, order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id"} {"question": "Find the number of manufactures that are based in Tokyo or Beijing.\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'"} {"question": "What are the names of players who have the best dribbling?\nAdditional table information: table: soccer_1", "answer": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = (SELECT MAX(overall_rating) FROM Player_Attributes)"} {"question": "Find the number of classes in each school.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code"} {"question": "List in alphabetic order all different amenities.\nAdditional table information: table: dorm_1", "answer": "SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name NULLS FIRST"} {"question": "What are the names and sum of checking and savings balances for accounts with savings balances higher than the average savings balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT AVG(balance) FROM savings)"} {"question": "What is the first name and job id for all employees in the Finance department?\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'"} {"question": "What is the id of the student who most recently registered course 301?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1"} {"question": "What are the ids of suppliers which have an average amount purchased of above 50000 or below 30000?\nAdditional table information: table: department_store", "answer": "SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING AVG(total_amount_purchased) > 50000 OR AVG(total_amount_purchased) < 30000"} {"question": "Show the names of customers who have both an order in completed status and an order in part status.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Part'"} {"question": "How many distinct transaction types are used in the transactions?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS"} {"question": "What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?\nAdditional table information: table: formula_1", "answer": "SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5"} {"question": "Find the settlement amount of the claim with the largest claim amount. Show both the settlement amount and claim amount.\nAdditional table information: table: insurance_policies", "answer": "SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1"} {"question": "How many parks are there in the state of NY?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM park WHERE state = 'NY'"} {"question": "who is the manufacturer for the order year 1998? \nAdditional table information: table: \"vehicles\".\"cars\"\ncolumns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion", "answer": "SELECT manufacturer FROM \"vehicles\".\"cars\" WHERE order_year = '1998'"} {"question": "Find the first name of students in the descending order of age.\nAdditional table information: table: college_3", "answer": "SELECT Fname FROM STUDENT ORDER BY Age DESC"} {"question": "Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There"} {"question": "For each type, what is the average tonnage?\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE"} {"question": "What is the list of school locations sorted in descending order of school foundation year?\nAdditional table information: table: school_player", "answer": "SELECT LOCATION FROM school ORDER BY Founded DESC"} {"question": "List the name and gender for all artists who released songs in March.\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE '%Mar%'"} {"question": "What is the average pages per minute color?\nAdditional table information: table: store_product", "answer": "SELECT AVG(pages_per_minute_color) FROM product"} {"question": "What are the first names of all students who got a grade C in a class?\nAdditional table information: table: college_1", "answer": "SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'"} {"question": "What are the names of all colleges with a larger enrollment than the largest college in Florida?\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL')"} {"question": "Find the number of games taken place in city Atlanta in 2000.\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta'"} {"question": "Find all details for each swimmer.\nAdditional table information: table: swimming", "answer": "SELECT * FROM swimmer"} {"question": "Who are Bob's friends?\nAdditional table information: table: network_2", "answer": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'"} {"question": "Find the states which do not have any employee in their record.\nAdditional table information: table: customer_deliveries", "answer": "SELECT state_province_county FROM addresses WHERE NOT address_id IN (SELECT employee_address_id FROM Employees)"} {"question": "List the physicians' employee ids together with their primary affiliation departments' ids.\nAdditional table information: table: hospital_1", "answer": "SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1"} {"question": "Find the name and id of accounts whose checking balance is below the maximum checking balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.custid, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT MAX(balance) FROM checking)"} {"question": "What are the names of directors who directed movies with 5 star rating? Also return the title of these movies.\nAdditional table information: table: movie_1", "answer": "SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5"} {"question": "Show the unique first names, last names, and phone numbers for all customers with any account.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT DISTINCT T1.customer_first_name, T1.customer_last_name, T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id"} {"question": "Count the number of male students who had class senator votes in the fall election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = 'M' AND T2.Election_Cycle = 'Fall'"} {"question": "Find the names of all instructors in the Art department who have taught some course and the course_id.\nAdditional table information: table: college_2", "answer": "SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art'"} {"question": "Find the names of furnitures whose prices are lower than the highest price.\nAdditional table information: table: manufacturer", "answer": "SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT MAX(Price_in_Dollar) FROM furniture_manufacte)"} {"question": "What are the ids for employees who do not work in departments with managers that have ids between 100 and 200?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200)"} {"question": "What is the name of the activity that has the most faculty members involved in?\nAdditional table information: table: activity_1", "answer": "SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is average lesson price taught by staff with first name as Janessa and last name as Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "What are the first names and last names of all the guests?\nAdditional table information: table: apartment_rentals", "answer": "SELECT guest_first_name, guest_last_name FROM Guests"} {"question": "return the smallest salary for every departments.\nAdditional table information: table: hr_1", "answer": "SELECT MIN(salary), department_id FROM employees GROUP BY department_id"} {"question": "Return the maximum number of points for climbers from the United Kingdom.\nAdditional table information: table: climbing", "answer": "SELECT MAX(Points) FROM climber WHERE Country = 'United Kingdom'"} {"question": "What are the names and ids of the tourist attractions that are visited at most once?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) <= 1"} {"question": "Find the name, city, and country of the airport that has the lowest altitude.\nAdditional table information: table: flight_4", "answer": "SELECT name, city, country FROM airports ORDER BY elevation NULLS FIRST LIMIT 1"} {"question": "Find the number of reviews.\nAdditional table information: table: epinions_1", "answer": "SELECT COUNT(*) FROM review"} {"question": "What are the names of students who have more than one advisor?\nAdditional table information: table: college_2", "answer": "SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING COUNT(*) > 1"} {"question": "What are all the album titles, in alphabetical order?\nAdditional table information: table: chinook_1", "answer": "SELECT Title FROM ALBUM ORDER BY Title NULLS FIRST"} {"question": "What are the title and director of each film?\nAdditional table information: table: cinema", "answer": "SELECT title, directed_by FROM film"} {"question": "For each aircraft that has won an award, what is its name and how many time has it won?\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft"} {"question": "Find the physician who prescribed the highest dose. What is his or her name?\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1"} {"question": "Show publishers with a book published in 1989 and a book in 1990.\nAdditional table information: table: culture_company", "answer": "SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990"} {"question": "Find the name of the project for which a scientist whose name contains \u2018Smith\u2019 is assigned to.\nAdditional table information: table: scientist_1", "answer": "SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%'"} {"question": "Compute the average price of all the products.\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(price) FROM products"} {"question": "Find the last names of all the authors that have written a paper with title containing the word 'Monadic'.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE '%Monadic%'"} {"question": "Show the total number of rooms of all apartments with facility code 'Gym'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT SUM(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = 'Gym'"} {"question": "Find the id of the song that lasts the longest.\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM files ORDER BY duration DESC LIMIT 1"} {"question": "What are the names, ages, and countries of artists, sorted by the year they joined?\nAdditional table information: table: theme_gallery", "answer": "SELECT name, age, country FROM artist ORDER BY Year_Join NULLS FIRST"} {"question": "What is the total amount of money spent by Lucas Mancini?\nAdditional table information: table: store_1", "answer": "SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = 'Lucas' AND T1.last_name = 'Mancini'"} {"question": "Show the names of members and the decoration themes they have.\nAdditional table information: table: decoration_competition", "answer": "SELECT T1.Name, T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID"} {"question": "What are the name and description for location code x?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_name, location_description FROM Ref_locations WHERE location_code = 'x'"} {"question": "Which services type had both successful and failure event details?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'"} {"question": "What are the names of instructors who have taught C Programming courses?\nAdditional table information: table: college_2", "answer": "SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'"} {"question": "What are the response received dates for the documents described as 'Regular' or granted with more than 100?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100"} {"question": "Which city has hosted the most events?\nAdditional table information: table: city_record", "answer": "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"} {"question": "Find the total number of scientists.\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*) FROM scientists"} {"question": "Find the appelations that produce wines after the year of 2008 but not in Central Coast area.\nAdditional table information: table: wine_1", "answer": "SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = 'Central Coast'"} {"question": "Find the name and address of the department that has the highest number of students.\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name, T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the hardware product with the greatest price?\nAdditional table information: table: department_store", "answer": "SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1"} {"question": "For each station, return its longitude and the average duration of trips that started from the station.\nAdditional table information: table: bike_1", "answer": "SELECT T1.name, T1.long, AVG(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id"} {"question": "Find the number of voting records in total.\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(*) FROM VOTING_RECORD"} {"question": "Are the customers holding coupons with amount 500 bad or good?\nAdditional table information: table: products_for_hire", "answer": "SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500"} {"question": "What is the sex of the candidate who had the highest unsure rate?\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1"} {"question": "Find all the female members of club 'Bootup Baltimore'. Show the first name and last name.\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.sex = 'F'"} {"question": "For each main industry, what is the total number of companies for the industry with the highest total market value?\nAdditional table information: table: gas_company", "answer": "SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1"} {"question": "Show the order ids and the number of items in each order.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT order_id, COUNT(*) FROM Order_items GROUP BY order_id"} {"question": "Which countries have more than one mountain?\nAdditional table information: table: climbing", "answer": "SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1"} {"question": "What are the names of the albums that have more than 10 tracks?\nAdditional table information: table: store_1", "answer": "SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING COUNT(T1.id) > 10"} {"question": "Count the number of schools.\nAdditional table information: table: school_player", "answer": "SELECT COUNT(*) FROM school"} {"question": "Give the different reigns of wrestlers who are not located in Tokyo, Japan.\nAdditional table information: table: wrestler", "answer": "SELECT DISTINCT Reign FROM wrestler WHERE LOCATION <> 'Tokyo , Japan'"} {"question": "how many times is the fuel propulsion is cng? \nAdditional table information: table: \"vehicles\".\"cars\"\ncolumns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion", "answer": "SELECT COUNT fleet_series_quantity FROM \"vehicles\".\"cars\" WHERE fuel_propulsion = 'CNG'"} {"question": "Find the top 3 products which have the largest number of problems?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Find the names of states that have some college students playing in goalie and mid positions.\nAdditional table information: table: soccer_2", "answer": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'"} {"question": "How many customers have opened an account?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(DISTINCT customer_id) FROM Accounts"} {"question": "Find the names of stadiums that the most swimmers have been to.\nAdditional table information: table: swimming", "answer": "SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the total credit does each department offer?\nAdditional table information: table: college_1", "answer": "SELECT SUM(crs_credit), dept_code FROM course GROUP BY dept_code"} {"question": "Find the total revenue for each manufacturer.\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue), name FROM manufacturers GROUP BY name"} {"question": "Find the name of customers who did not pay with Cash.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers WHERE payment_method <> 'Cash'"} {"question": "How many performances are there?\nAdditional table information: table: performance_attendance", "answer": "SELECT COUNT(*) FROM performance"} {"question": "How many problems are there for product voluptatem?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = 'voluptatem'"} {"question": "What is the maximum price of wines from the appelation in the Central Coast area, which was produced before 2005?\nAdditional table information: table: wine_1", "answer": "SELECT MAX(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'Central Coast' AND T2.year < 2005"} {"question": "What is the role with the smallest number of employees? Find the role codes.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Count the number of different characteristic names the product 'cumin' has.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'sesame'"} {"question": "What are the id and the amount of refund of the booking that incurred the most times of payments?\nAdditional table information: table: products_for_hire", "answer": "SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show names of parties that does not have any members.\nAdditional table information: table: party_people", "answer": "SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member)"} {"question": "What are the names of stations that have latitude lower than 37.5?\nAdditional table information: table: bike_1", "answer": "SELECT name FROM station WHERE lat < 37.5"} {"question": "Return the full name of the staff who provided a customer with the first name April and the last name Burns with a film rental.\nAdditional table information: table: sakila_1", "answer": "SELECT DISTINCT T1.first_name, T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'"} {"question": "Show different types of ships and the average tonnage of ships of each type.\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE"} {"question": "What are first and last names of players participating in all star game in 1998?\nAdditional table information: table: baseball_1", "answer": "SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998"} {"question": "How many different items were reviewed by some users?\nAdditional table information: table: epinions_1", "answer": "SELECT COUNT(DISTINCT i_id) FROM review"} {"question": "When and in what zip code did max temperature reach 80?\nAdditional table information: table: bike_1", "answer": "SELECT date, zip_code FROM weather WHERE max_temperature_f >= 80"} {"question": "What is the name of the person whose age is below 30?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE age < 30"} {"question": "Show the statement id and the statement detail for the statement with most number of accounts.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.statement_id, T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of organizations, ordered by the date they were formed, ascending?\nAdditional table information: table: e_government", "answer": "SELECT organization_name FROM organizations ORDER BY date_formed ASC NULLS FIRST"} {"question": "How many kids stay in the rooms reserved by ROY SWEAZY?\nAdditional table information: table: inn_1", "answer": "SELECT kids FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'"} {"question": "Which staff members who reported problems from the product 'rem' but not 'aut'? Give me their first and last names.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1, product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = 'rem' EXCEPT SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1, product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = 'aut'"} {"question": "Find all the distinct visit dates.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT DISTINCT Visit_Date FROM VISITS"} {"question": "Where is store 1 located?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1"} {"question": "Find the number of professors in accounting department.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = 'Accounting'"} {"question": "Find the dates of assessment notes for students with first name 'Fanny'.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = 'Fanny'"} {"question": "Find the average and total capacity of dorms for the students with gender X.\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'"} {"question": "Find the first names and last names of the authors whose institution affiliation is 'Google'.\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'Google'"} {"question": "Select all the data from the products and each product's manufacturer.\nAdditional table information: table: manufactory_1", "answer": "SELECT * FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code"} {"question": "How many people graduated from San Francisco State University in 2004?\nAdditional table information: table: csu_1", "answer": "SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = 'San Francisco State University'"} {"question": "Which students study under the teacher named OTHA MOYER? Give me the first and last names of the students.\nAdditional table information: table: student_1", "answer": "SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'"} {"question": "What are the names of cities in ascending alphabetical order?\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM city ORDER BY Name ASC NULLS FIRST"} {"question": "Return the song in the volume that has spent the most weeks on top?\nAdditional table information: table: music_4", "answer": "SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1"} {"question": "Find the phone number of performer 'Ashley'.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = 'Ashley'"} {"question": "Hom many albums does the artist 'Metallica' have?\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = 'Metallica'"} {"question": "What are the first names and last names of students with address in Wisconsin state?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = 'Wisconsin'"} {"question": "What is the party that has the largest number of representatives?\nAdditional table information: table: election_representative", "answer": "SELECT Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many patients stay in room 112?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(patient) FROM stay WHERE room = 112"} {"question": "List the distinct region of clubs in ascending alphabetical order.\nAdditional table information: table: sports_competition", "answer": "SELECT DISTINCT Region FROM club ORDER BY Region ASC NULLS FIRST"} {"question": "What are the names and ids of the different categories, and how many films are in each?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id"} {"question": "What are the payment method codes that have been used by more than 3 parties?\nAdditional table information: table: e_government", "answer": "SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3"} {"question": "Find the average and minimum price of the rooms in different decor.\nAdditional table information: table: inn_1", "answer": "SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor"} {"question": "For each nationality, how many different constructors are there?\nAdditional table information: table: formula_1", "answer": "SELECT COUNT(*), nationality FROM constructors GROUP BY nationality"} {"question": "Find the average number of factories for the manufacturers that have more than 20 shops.\nAdditional table information: table: manufacturer", "answer": "SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20"} {"question": "What is the number of airlines based in Russia?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airlines WHERE country = 'Russia'"} {"question": "What are the full names and cities of employees who have the letter Z in their first names?\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T1.last_name, T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'"} {"question": "What is the id and market share of the browser Safari?\nAdditional table information: table: browser_web", "answer": "SELECT id, market_share FROM browser WHERE name = 'Safari'"} {"question": "Show the locations of schools that have more than 1 player.\nAdditional table information: table: school_player", "answer": "SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1"} {"question": "How many documents have expenses?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Documents_with_expenses"} {"question": "Find the city and name of bank branches that provide business loans.\nAdditional table information: table: loan_1", "answer": "SELECT T1.bname, T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'"} {"question": "display those departments where more than ten employees work who got a commission percentage.\nAdditional table information: table: hr_1", "answer": "SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10"} {"question": "Which customer had at least 2 policies but did not file any claims? List the customer details and id.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id"} {"question": "Find the number of students taught by the teacher KAWA GORDON.\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'KAWA' AND T2.lastname = 'GORDON'"} {"question": "What are the names of the county that the delegates on 'Appropriations' committee belong to?\nAdditional table information: table: election", "answer": "SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = 'Appropriations'"} {"question": "What are the different carriers for devices, listed in alphabetical order?\nAdditional table information: table: device", "answer": "SELECT Carrier FROM device ORDER BY Carrier ASC NULLS FIRST"} {"question": "Count the number of tourists who did not visit any place.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT COUNT(*) FROM Visitors WHERE NOT Tourist_ID IN (SELECT Tourist_ID FROM Visits)"} {"question": "What are the names of the members and branches at which they are registered sorted by year of registration?\nAdditional table information: table: shop_membership", "answer": "SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year NULLS FIRST"} {"question": "Show origins of all flights with destination Honolulu.\nAdditional table information: table: flight_1", "answer": "SELECT origin FROM Flight WHERE destination = 'Honolulu'"} {"question": "What are the names of the storms that affected Denmark?\nAdditional table information: table: storm_record", "answer": "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'"} {"question": "How many employees do we have?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Employee"} {"question": "Find the name of department that offers the class whose description has the word 'Statistics'.\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%'"} {"question": "Find the id of the courses that do not have any prerequisite?\nAdditional table information: table: college_2", "answer": "SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq"} {"question": "What are the names of climbers and the corresponding names of mountains that they climb?\nAdditional table information: table: climbing", "answer": "SELECT T1.Name, T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID"} {"question": "What activities do we have?\nAdditional table information: table: activity_1", "answer": "SELECT activity_name FROM Activity"} {"question": "What is the first name of the professor who is teaching CIS-220 and QM-261?\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261'"} {"question": "Find the dates of orders which belong to the customer named 'Jeramie'.\nAdditional table information: table: tracking_orders", "answer": "SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'"} {"question": "List the names, phone numbers, and emails of all customers sorted by their dates of becoming customers.\nAdditional table information: table: customer_deliveries", "answer": "SELECT customer_name, customer_phone, customer_email FROM Customers ORDER BY date_became_customer NULLS FIRST"} {"question": "Find the booking start date and end date for the apartments that have more than two bedrooms.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2"} {"question": "Return the address of store 1.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1"} {"question": "Find the customer who started a policy most recently.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.start_date = (SELECT MAX(start_date) FROM policies)"} {"question": "How many different industries are the companies in?\nAdditional table information: table: company_office", "answer": "SELECT COUNT(DISTINCT Industry) FROM Companies"} {"question": "How many different captain ranks are there?\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(DISTINCT rank) FROM captain"} {"question": "Show the names of people that are on affirmative side of debates with number of audience bigger than 200.\nAdditional table information: table: debate", "answer": "SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200"} {"question": "Return the maximum and minimum population among all counties.\nAdditional table information: table: election", "answer": "SELECT MAX(Population), MIN(Population) FROM county"} {"question": "How many distinct colleges are associated with players from the team with name 'Columbus Crew'.\nAdditional table information: table: match_season", "answer": "SELECT COUNT(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Columbus Crew'"} {"question": "What is the average age for each gender?\nAdditional table information: table: network_2", "answer": "SELECT AVG(age), gender FROM Person GROUP BY gender"} {"question": "How many students are there for each major?\nAdditional table information: table: allergy_1", "answer": "SELECT major, COUNT(*) FROM Student GROUP BY major"} {"question": "What are the ids of the two department store chains with the largest number of department stores?\nAdditional table information: table: department_store", "answer": "SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY COUNT(*) DESC LIMIT 2"} {"question": "Count the number of characteristics of the product named 'laurel'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'laurel'"} {"question": "What are the cell phone numbers of the candidates that received an assessment code of 'Fail'?\nAdditional table information: table: student_assessment", "answer": "SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = 'Fail'"} {"question": "Return the code of the city that has the most students.\nAdditional table information: table: voter_2", "answer": "SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the countries of markets and their corresponding years of market estimation?\nAdditional table information: table: film_rank", "answer": "SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID"} {"question": "For each party, find its location and the name of its host. Sort the result in ascending order of the age of the host.\nAdditional table information: table: party_host", "answer": "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"} {"question": "Show all cities where at least one customer lives in but no performer lives in.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID"} {"question": "List the names of all players who have a crossing score higher than 90 and prefer their right foot.\nAdditional table information: table: soccer_1", "answer": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = 'right'"} {"question": "display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.\nAdditional table information: table: hr_1", "answer": "SELECT email FROM employees WHERE commission_pct = 'null' AND salary BETWEEN 7000 AND 12000 AND department_id = 50"} {"question": "Find the number of distinct students enrolled in courses.\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(DISTINCT student_id) FROM Student_Course_Enrolment"} {"question": "What are the names of parties that have no members?\nAdditional table information: table: party_people", "answer": "SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member)"} {"question": "What are the names of all of Alice's friends of friends?\nAdditional table information: table: network_2", "answer": "SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice'"} {"question": "Find the product type whose average price is higher than the average price of all products.\nAdditional table information: table: department_store", "answer": "SELECT product_type_code FROM products GROUP BY product_type_code HAVING AVG(product_price) > (SELECT AVG(product_price) FROM products)"} {"question": "What is the total grant amount of the organisations described as research?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT SUM(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research'"} {"question": "Return the average and minimum age of captains in each class.\nAdditional table information: table: ship_1", "answer": "SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS"} {"question": "List the number of customers that did not have any payment history.\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments)"} {"question": "From what date and to what date do the staff work on a project that has the most staff and has staff in a leader role?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader'"} {"question": "Count the number of distinct player positions.\nAdditional table information: table: school_player", "answer": "SELECT COUNT(DISTINCT POSITION) FROM player"} {"question": "Which position is most popular among players in the tryout?\nAdditional table information: table: soccer_2", "answer": "SELECT pPos FROM tryout GROUP BY pPos ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which countries do not have a stadium that was opened after 2006?\nAdditional table information: table: swimming", "answer": "SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006"} {"question": "Give the name of each department and the number of employees in each.\nAdditional table information: table: hr_1", "answer": "SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name"} {"question": "What are the locations that have gas stations owned by a company with a market value greater than 100?\nAdditional table information: table: gas_company", "answer": "SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100"} {"question": "What distinct accelerator names are compatible with the browswers that have market share higher than 15?\nAdditional table information: table: browser_web", "answer": "SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15"} {"question": "How many flights have a velocity larger than 200?\nAdditional table information: table: flight_company", "answer": "SELECT COUNT(*) FROM flight WHERE velocity > 200"} {"question": "Which state has the greatest total number of bank customers?\nAdditional table information: table: loan_1", "answer": "SELECT state FROM bank GROUP BY state ORDER BY SUM(no_of_customers) DESC LIMIT 1"} {"question": "Which services have been used more than twice in first notification of loss? Return the service name.\nAdditional table information: table: insurance_fnol", "answer": "SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING COUNT(*) > 2"} {"question": "What is the sum of revenue from companies with headquarters in Austin?\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue) FROM manufacturers WHERE headquarter = 'Austin'"} {"question": "List the maximum, minimum and average number of used kb in screen mode.\nAdditional table information: table: phone_1", "answer": "SELECT MAX(used_kb), MIN(used_kb), AVG(used_kb) FROM screen_mode"} {"question": "Give the average number of working horses on farms with more than 5000 total horses.\nAdditional table information: table: farm", "answer": "SELECT AVG(Working_Horses) FROM farm WHERE Total_Horses > 5000"} {"question": "What are the different names of all reviewers whose ratings do not have a date field?\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = 'null'"} {"question": "For every student who is registered for some course, how many courses are they registered for?\nAdditional table information: table: student_assessment", "answer": "SELECT T1.student_id, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id"} {"question": "What is the name of the project that requires the fewest number of hours, and the names of the scientists assigned to it?\nAdditional table information: table: scientist_1", "answer": "SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)"} {"question": "Find the ids and names of members who are under age 30 or with black membership card.\nAdditional table information: table: coffee_shop", "answer": "SELECT name, member_id FROM member WHERE Membership_card = 'Black' OR age < 30"} {"question": "Find the name, city, country, and altitude (or elevation) of the airports in the city of New York.\nAdditional table information: table: flight_4", "answer": "SELECT name, city, country, elevation FROM airports WHERE city = 'New York'"} {"question": "What are the first names and last names of the employees who live in Calgary city.\nAdditional table information: table: chinook_1", "answer": "SELECT FirstName, LastName FROM EMPLOYEE WHERE City = 'Calgary'"} {"question": "Find the driver id and number of races of all drivers who have at most participated in 30 races?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30"} {"question": "Find names of all students who took some course and got A or C.\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'"} {"question": "What are the names of customers with accounts, and what are the total savings balances for each?\nAdditional table information: table: small_bank_1", "answer": "SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name"} {"question": "What is the name of the department in the Building Mergenthaler?\nAdditional table information: table: college_3", "answer": "SELECT DName FROM DEPARTMENT WHERE Building = 'Mergenthaler'"} {"question": "What is the publisher with most number of books?\nAdditional table information: table: culture_company", "answer": "SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many faculty members participate in each activity? Return the activity names and the number of faculty members.\nAdditional table information: table: activity_1", "answer": "SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID"} {"question": "Show statement id, statement detail, account detail for accounts.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.statement_id, T2.statement_details, T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id"} {"question": "Return the maximum and minimum number of cows across all farms.\nAdditional table information: table: farm", "answer": "SELECT MAX(Cows), MIN(Cows) FROM farm"} {"question": "How many customers have an active value of 1?\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM customer WHERE active = '1'"} {"question": "What campuses opened before 1800?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE YEAR < 1800"} {"question": "What are the unique names of all race held between 2014 and 2017?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017"} {"question": "Find the cell mobile number of the candidates whose assessment code is 'Fail'?\nAdditional table information: table: student_assessment", "answer": "SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = 'Fail'"} {"question": "What are the crime rates of counties that contain cities that have white percentages of over 90?\nAdditional table information: table: county_public_safety", "answer": "SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90"} {"question": "Return the characteristic names of the 'sesame' product.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'sesame'"} {"question": "Find the name of customers whose credit score is below the average credit scores of all customers.\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer WHERE credit_score < (SELECT AVG(credit_score) FROM customer)"} {"question": "Give the different hometowns of gymnasts that have a total point score of above 57.5.\nAdditional table information: table: gymnast", "answer": "SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5"} {"question": "What is the name of the race that occurred most recently?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM races ORDER BY date DESC LIMIT 1"} {"question": "What are the names of the customers who have made two or less orders?\nAdditional table information: table: tracking_orders", "answer": "SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2"} {"question": "How many students are attending English courses?\nAdditional table information: table: student_assessment", "answer": "SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'English'"} {"question": "List the software platform shared by the greatest number of devices.\nAdditional table information: table: device", "answer": "SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of the drama workshop groups with address in Feliciaberg city?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = 'Feliciaberg'"} {"question": "List the most common type of Status across cities.\nAdditional table information: table: farm", "answer": "SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many courses are offered by the Computer Info. Systems department?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = 'Computer Info. Systems'"} {"question": "display the employee id and salary of all employees who report to Payam (first name).\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam')"} {"question": "For each team, how many technicians are there?\nAdditional table information: table: machine_repair", "answer": "SELECT Team, COUNT(*) FROM technician GROUP BY Team"} {"question": "Find the team names of the universities whose enrollments are smaller than the average enrollment size.\nAdditional table information: table: university_basketball", "answer": "SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT AVG(enrollment) FROM university)"} {"question": "For each position, what is the minimum time students spent practicing?\nAdditional table information: table: soccer_2", "answer": "SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos"} {"question": "What is the name of every city that has at least 15 stations and how many stations does it have?\nAdditional table information: table: bike_1", "answer": "SELECT city, COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15"} {"question": "What is the flight number and its distance for the one with the maximum price?\nAdditional table information: table: flight_1", "answer": "SELECT flno, distance FROM Flight ORDER BY price DESC LIMIT 1"} {"question": "Return the phone numbers for all customers and suppliers.\nAdditional table information: table: department_store", "answer": "SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers"} {"question": "Give the different locations of tracks.\nAdditional table information: table: race_track", "answer": "SELECT DISTINCT LOCATION FROM track"} {"question": "Find the payment method and phone of the party with email 'enrico09@example.com'.\nAdditional table information: table: e_government", "answer": "SELECT payment_method_code, party_phone FROM parties WHERE party_email = 'enrico09@example.com'"} {"question": "What are the titles and authors or editors that correspond to books made after 1989?\nAdditional table information: table: culture_company", "answer": "SELECT book_title, author_or_editor FROM book_club WHERE YEAR > 1989"} {"question": "Show the ministers and the time they took and left office, listed by the time they left office.\nAdditional table information: table: party_people", "answer": "SELECT minister, took_office, left_office FROM party ORDER BY left_office NULLS FIRST"} {"question": "How many candidates are there?\nAdditional table information: table: candidate_poll", "answer": "SELECT COUNT(*) FROM candidate"} {"question": "Which teacher teaches the most students? Give me the first name and last name of the teacher.\nAdditional table information: table: student_1", "answer": "SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname, T2.lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the average enrollment of universities founded before 1850.\nAdditional table information: table: university_basketball", "answer": "SELECT AVG(enrollment) FROM university WHERE founded < 1850"} {"question": "Show all video games and their types in the order of their names.\nAdditional table information: table: game_1", "answer": "SELECT gname, gtype FROM Video_games ORDER BY gname NULLS FIRST"} {"question": "Find the white grape used to produce wines with scores above 90.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White' AND T2.score > 90"} {"question": "Show the lieutenant governor and comptroller from the democratic party.\nAdditional table information: table: election", "answer": "SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = 'Democratic'"} {"question": "Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?\nAdditional table information: table: formula_1", "answer": "SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Australian Grand Prix' INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Chinese Grand Prix'"} {"question": "Show id and location of railways that are associated with more than one train.\nAdditional table information: table: railway", "answer": "SELECT T2.Railway_ID, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1"} {"question": "Show the customer ids and firstname without a credit card.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, customer_first_name FROM Customers EXCEPT SELECT T1.customer_id, T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE card_type_code = 'Credit'"} {"question": "How many claim processing stages are there in total?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT COUNT(*) FROM claims_processing_stages"} {"question": "What are the delegate and name of the county they belong to, for each county?\nAdditional table information: table: election", "answer": "SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District"} {"question": "What is the most common major among female (sex is F) students?\nAdditional table information: table: voter_2", "answer": "SELECT Major FROM STUDENT WHERE Sex = 'F' GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names of all the product characteristics.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT DISTINCT characteristic_name FROM CHARACTERISTICS"} {"question": "In which year are there festivals both inside the 'United States' and outside the 'United States'?\nAdditional table information: table: entertainment_awards", "answer": "SELECT YEAR FROM festival_detail WHERE LOCATION = 'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION <> 'United States'"} {"question": "How many distinct order ids correspond to each product?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT product_id, COUNT(DISTINCT order_id) FROM Order_items GROUP BY product_id"} {"question": "Show the name, open date, and organizer for all churches.\nAdditional table information: table: wedding", "answer": "SELECT name, open_date, organized_by FROM Church"} {"question": "List the names of buildings with at least 200 feet of height and with at least 20 floors.\nAdditional table information: table: protein_institute", "answer": "SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20"} {"question": "Find the names of all instructors in Comp. Sci. department with salary > 80000.\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000"} {"question": "What are the names and number of hours spent training for each player who trains for less than 1500 hours?\nAdditional table information: table: soccer_2", "answer": "SELECT pName, HS FROM Player WHERE HS < 1500"} {"question": "Find the payment method that is used most frequently.\nAdditional table information: table: customer_deliveries", "answer": "SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Who is the advisor of Linda Smith? Give me the first name and last name.\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = 'Linda' AND T2.lname = 'Smith'"} {"question": "When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?\nAdditional table information: table: browser_web", "answer": "SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer'"} {"question": "What are the names of all clubs that do not have any players?\nAdditional table information: table: sports_competition", "answer": "SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_ID FROM player)"} {"question": "What are the names of all employees who can fly both the Boeing 737-800 and the Airbus A340-300?\nAdditional table information: table: flight_1", "answer": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Boeing 737-800' INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Airbus A340-300'"} {"question": "Find the names of instructors who didn't each any courses in any Spring semester.\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches WHERE semester = 'Spring')"} {"question": "What is the age of the tallest person?\nAdditional table information: table: gymnast", "answer": "SELECT Age FROM people ORDER BY Height DESC LIMIT 1"} {"question": "What is the student capacity and type of gender for the dorm whose name as the phrase Donor in it?\nAdditional table information: table: dorm_1", "answer": "SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'"} {"question": "List the name of rooms with king or queen bed.\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms WHERE bedType = 'King' OR bedType = 'Queen'"} {"question": "What are the names and countries of origin for the artists who produced the top three highly rated songs.\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3"} {"question": "Find the number of matches in different competitions.\nAdditional table information: table: city_record", "answer": "SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition"} {"question": "Find the name of customers who have more than one loan.\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING COUNT(*) > 1"} {"question": "What are the names of the five cities with the greatest proportion of white people?\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM city ORDER BY White DESC LIMIT 5"} {"question": "List all payment methods and number of payments using each payment methods.\nAdditional table information: table: driving_school", "answer": "SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code"} {"question": "Who is the 'CTO' of club 'Hopkins Student Enterprises'? Show the first name and last name.\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises' AND t2.position = 'CTO'"} {"question": "What are the names of the clients who do not have any booking?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID"} {"question": "Find the unit of measurement and product category code of product named 'chervil'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'chervil'"} {"question": "What are the names of the ships that are not involved in any missions?\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission)"} {"question": "For each bed type, find the average base price of different bed type.\nAdditional table information: table: inn_1", "answer": "SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType"} {"question": "What is the area for the appelation which produced the most wines prior to 2010?\nAdditional table information: table: wine_1", "answer": "SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many characteristics does the product named 'sesame' have?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = 'sesame'"} {"question": "What are the full name, hire date, salary, and department id for employees without the letter M in their first name?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, hire_date, salary, department_id FROM employees WHERE NOT first_name LIKE '%M%'"} {"question": "What are the characters of actors in descending order of age?\nAdditional table information: table: musical", "answer": "SELECT Character FROM actor ORDER BY age DESC"} {"question": "Find the name and credit score of the customers who have some loans.\nAdditional table information: table: loan_1", "answer": "SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id"} {"question": "Show all the locations where some cinemas were opened in both year 2010 and year 2011.\nAdditional table information: table: cinema", "answer": "SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011"} {"question": "display the department name, city, and state province for each department.\nAdditional table information: table: hr_1", "answer": "SELECT T1.department_name, T2.city, T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id"} {"question": "Find the city with post code 255.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT city FROM addresses WHERE zip_postcode = 255"} {"question": "What are the visit date and details of the visitor whose detail is 'Vincent'?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.Visit_Date, T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = 'Vincent'"} {"question": "List the companies of entrepreneurs in descending order of money requested.\nAdditional table information: table: entrepreneur", "answer": "SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC"} {"question": "What is the name of the school with smallest enrollment size per state?\nAdditional table information: table: soccer_2", "answer": "SELECT cName, state, MIN(enr) FROM college GROUP BY state"} {"question": "Find the salaries of all distinct instructors that are less than the largest salary.\nAdditional table information: table: college_2", "answer": "SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT MAX(salary) FROM instructor)"} {"question": "List the course name of courses sorted by credits.\nAdditional table information: table: college_3", "answer": "SELECT CName FROM COURSE ORDER BY Credits NULLS FIRST"} {"question": "Show theme and year for all exhibitions in an descending order of ticket price.\nAdditional table information: table: theme_gallery", "answer": "SELECT theme, YEAR FROM exhibition ORDER BY ticket_price DESC"} {"question": "What is the season of the game which causes the player 'Walter Samuel' to get injured?\nAdditional table information: table: game_injury", "answer": "SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel'"} {"question": "What are the different card types, and how many transactions have been made with each?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T2.card_type_code, COUNT(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code"} {"question": "Find the name of the item with the lowest average rating.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rating) NULLS FIRST LIMIT 1"} {"question": "What are the cities that do not have any branches with more than 100 members?\nAdditional table information: table: shop_membership", "answer": "SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100"} {"question": "Find the number of routes with destination airports in Italy.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'"} {"question": "Show the names of members in ascending order of their rank in rounds.\nAdditional table information: table: decoration_competition", "answer": "SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round ASC NULLS FIRST"} {"question": "Find the total capacity of all dorms.\nAdditional table information: table: dorm_1", "answer": "SELECT SUM(student_capacity) FROM dorm"} {"question": "What are the names of all genres in alphabetical order, combined with its ratings?\nAdditional table information: table: music_1", "answer": "SELECT g_name, rating FROM genre ORDER BY g_name NULLS FIRST"} {"question": "Sort the list of all the first and last names of authors in alphabetical order of the last names.\nAdditional table information: table: icfp_1", "answer": "SELECT fname, lname FROM authors ORDER BY lname NULLS FIRST"} {"question": "What are the phone numbers of all customers and suppliers.\nAdditional table information: table: department_store", "answer": "SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers"} {"question": "Which 3 players won the most player awards? List their full name and id.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_first, T1.name_last, T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "List from which date and to which date these staff work: project staff of the project which hires the most staffs\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader'"} {"question": "On what dates did the student whose personal name is 'Karson' enroll in and complete the courses?\nAdditional table information: table: e_learning", "answer": "SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = 'Karson'"} {"question": "List the state names and the number of customers living in each state.\nAdditional table information: table: customer_deliveries", "answer": "SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county"} {"question": "Find the number of customers in the banks at New York City.\nAdditional table information: table: loan_1", "answer": "SELECT SUM(no_of_customers) FROM bank WHERE city = 'New York City'"} {"question": "How many students are not involved in any behavior incident?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT COUNT(*) FROM STUDENTS WHERE NOT student_id IN (SELECT student_id FROM Behavior_Incident)"} {"question": "Find the highest rank of all reviews.\nAdditional table information: table: epinions_1", "answer": "SELECT MIN(rank) FROM review"} {"question": "What are the star rating descriptions of the hotels with price above 10000?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000"} {"question": "What are the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'?\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = 'Simon Woodroffe' OR T1.Investor = 'Peter Jones'"} {"question": "Find the start and end dates of behavior incidents of students with last name 'Fahey'.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.date_incident_start, date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = 'Fahey'"} {"question": "List the id, genre and artist name of English songs ordered by rating.\nAdditional table information: table: music_1", "answer": "SELECT f_id, genre_is, artist_name FROM song WHERE languages = 'english' ORDER BY rating NULLS FIRST"} {"question": "What are the first name, last name, and gender of all the good customers? Order by their last name.\nAdditional table information: table: products_for_hire", "answer": "SELECT first_name, last_name, gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name NULLS FIRST"} {"question": "Please show the different statuses of cities and the average population of cities with each status.\nAdditional table information: table: farm", "answer": "SELECT Status, AVG(Population) FROM city GROUP BY Status"} {"question": "Give the average price and case of wines made from Zinfandel grapes in the year 2009.\nAdditional table information: table: wine_1", "answer": "SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = 'Zinfandel'"} {"question": "Show the institution type with the largest number of institutions.\nAdditional table information: table: protein_institute", "answer": "SELECT TYPE FROM institution GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many debates are there?\nAdditional table information: table: debate", "answer": "SELECT COUNT(*) FROM debate"} {"question": "Show each state and the number of addresses in each state.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county"} {"question": "Find the names of catalog entries with level number 8.\nAdditional table information: table: product_catalog", "answer": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = '8'"} {"question": "Which manager won the most manager award? Give me the manager's first name, last name and id.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_first, T1.name_last, T2.player_id FROM player AS T1 JOIN manager_award AS T2 ON T1.player_id = T2.player_id GROUP BY T2.player_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which customers have orders with status 'Packing'? Give me the customer names.\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Packing'"} {"question": "Find the visit date and details of the tourist whose detail is 'Vincent'\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.Visit_Date, T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = 'Vincent'"} {"question": "Find the average hours for the students whose tryout decision is no.\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'"} {"question": "How many dorms are there?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM dorm"} {"question": "What is the average training hours of all players?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(HS) FROM Player"} {"question": "What are the names of wrestlers and the elimination moves?\nAdditional table information: table: wrestler", "answer": "SELECT T2.Name, T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID"} {"question": "Show the name of employees with three lowest salaries.\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Employee ORDER BY salary ASC NULLS FIRST LIMIT 3"} {"question": "What are the planned delivery date and actual delivery date for each booking?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Planned_Delivery_Date, Actual_Delivery_Date FROM BOOKINGS"} {"question": "What are the names and opening hours of the tourist attractions that can be accessed by bus or walk?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Name, Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = 'bus' OR How_to_Get_There = 'walk'"} {"question": "Find the total claimed amount of all the claims.\nAdditional table information: table: insurance_policies", "answer": "SELECT SUM(Amount_Claimed) FROM Claims"} {"question": "What are the ids of the problems reported before the date of any problem reported by Lysanne Turcotte?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < (SELECT MIN(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = 'Lysanne' AND T4.staff_last_name = 'Turcotte')"} {"question": "List the name of tracks belongs to genre Rock or media type is MPEG audio file.\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = 'Rock' OR T3.name = 'MPEG audio file'"} {"question": "What is the first and last name of the students who are not in the largest major?\nAdditional table information: table: dorm_1", "answer": "SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "How many faculty is there in total in the year of 2002?\nAdditional table information: table: csu_1", "answer": "SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002"} {"question": "Show the apartment numbers of apartments with bookings that have status code both 'Provisional' and 'Confirmed'\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Confirmed' INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Provisional'"} {"question": "Give the codes of document types that have more than 2 corresponding documents.\nAdditional table information: table: document_management", "answer": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 2"} {"question": "Show all allergies and their types.\nAdditional table information: table: allergy_1", "answer": "SELECT allergy, allergytype FROM Allergy_type"} {"question": "Find the number of activities available.\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Activity"} {"question": "What are the naems of all the projects, and how many scientists were assigned to each of them?\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name"} {"question": "Find the name of the person who has no student friends.\nAdditional table information: table: network_2", "answer": "SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'"} {"question": "What is the most common type of ships?\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List all countries and their number of airlines in the descending order of number of airlines.\nAdditional table information: table: flight_4", "answer": "SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC"} {"question": "How many accounts does each customer have? List the number and customer id.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*), customer_id FROM Accounts GROUP BY customer_id"} {"question": "Return the title and inventory id of the film that is rented most often.\nAdditional table information: table: sakila_1", "answer": "SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the date and venue of each workshop in ascending alphabetical order of the venue.\nAdditional table information: table: workshop_paper", "answer": "SELECT Date, Venue FROM workshop ORDER BY Venue NULLS FIRST"} {"question": "Find the name and college of students whose decisions are yes in the tryout.\nAdditional table information: table: soccer_2", "answer": "SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'"} {"question": "What are the different parties of representative? Show the party name and the number of representatives in each party.\nAdditional table information: table: election_representative", "answer": "SELECT Party, COUNT(*) FROM representative GROUP BY Party"} {"question": "What are the names of the technicians and how many machines are they assigned to repair?\nAdditional table information: table: machine_repair", "answer": "SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name"} {"question": "Give the first name and job id for all employees in the Finance department.\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'"} {"question": "How many universities have a campus fee higher than average?\nAdditional table information: table: csu_1", "answer": "SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)"} {"question": "Show the authors of submissions and the acceptance results of their submissions.\nAdditional table information: table: workshop_paper", "answer": "SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID"} {"question": "What is the most common mill type, and how many are there?\nAdditional table information: table: architecture", "answer": "SELECT TYPE, COUNT(*) FROM mill GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the ids of the candidates that have an outcome code of Pass?\nAdditional table information: table: student_assessment", "answer": "SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = 'Pass'"} {"question": "Sort the apartment numbers in ascending order of room count.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_number FROM Apartments ORDER BY room_count ASC NULLS FIRST"} {"question": "What are the team and starting year of technicians?\nAdditional table information: table: machine_repair", "answer": "SELECT Team, Starting_Year FROM technician"} {"question": "What are the name and ID of the product bought the most.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) NULLS FIRST LIMIT 1"} {"question": "List all information in the item table.\nAdditional table information: table: epinions_1", "answer": "SELECT * FROM item"} {"question": "Which customers have the substring 'Diana' in their names? Return the customer details.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT customer_details FROM customers WHERE customer_details LIKE '%Diana%'"} {"question": "Return the most common full name among all actors.\nAdditional table information: table: sakila_1", "answer": "SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the number of products in the category 'Seeds'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products WHERE product_category_code = 'Seeds'"} {"question": "What student id corresponds to the oldest student?\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Student WHERE age = (SELECT MAX(age) FROM Student)"} {"question": "Show the names of pilots from team 'Bradley' or 'Fordham'.\nAdditional table information: table: pilot_record", "answer": "SELECT Pilot_name FROM pilot WHERE Team = 'Bradley' OR Team = 'Fordham'"} {"question": "What is the last name of the musician that has been at the back position the most?\nAdditional table information: table: music_2", "answer": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = 'back' GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the members of the club 'Tennis Club'.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'"} {"question": "What are the titles of all movies that have rating star is between 3 and 5?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5"} {"question": "Which document type is described with the prefix 'Initial'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'"} {"question": "Find the total number of courses offered.\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(*) FROM COURSES"} {"question": "Find the states where have the colleges whose enrollments are less than the largest size.\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college)"} {"question": "display the ID for those employees who did two or more jobs in the past.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2"} {"question": "Where is the history department?\nAdditional table information: table: college_1", "answer": "SELECT dept_address FROM department WHERE dept_name = 'History'"} {"question": "How many accounts do we have?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Accounts"} {"question": "What are the unique types of player positions in the tryout?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(DISTINCT pPos) FROM tryout"} {"question": "How many tasks are there?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(*) FROM Tasks"} {"question": "List the names of all scientists sorted in alphabetical order.\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM scientists ORDER BY name NULLS FIRST"} {"question": "What is the maximum stars and year for the most recent movie?\nAdditional table information: table: movie_1", "answer": "SELECT MAX(T1.stars), T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MAX(YEAR) FROM Movie)"} {"question": "What are the sale details and dates of transactions with amount smaller than 3000?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T1.sales_details, T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000"} {"question": "Find the name of the instructors who taught C Programming course before.\nAdditional table information: table: college_2", "answer": "SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'"} {"question": "Show total hours per week and number of games played for students under 20.\nAdditional table information: table: game_1", "answer": "SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20"} {"question": "Which winery is the wine that has the highest score from?\nAdditional table information: table: wine_1", "answer": "SELECT Winery FROM WINE ORDER BY SCORE NULLS FIRST LIMIT 1"} {"question": "How many different kinds of lens brands are there?\nAdditional table information: table: mountain_photos", "answer": "SELECT COUNT(DISTINCT brand) FROM camera_lens"} {"question": "Find the number of employees we have.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM Employees"} {"question": "What is the name and category code of the product with the highest price?\nAdditional table information: table: customer_complaints", "answer": "SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1"} {"question": "Show the short names of the buildings managed by 'Emma'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = 'Emma'"} {"question": "What are the phone numbers of customers using the policy with the code 'Life Insurance'?\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_phone FROM available_policies WHERE policy_type_code = 'Life Insurance'"} {"question": "Find the name of the courses that do not have any prerequisite?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)"} {"question": "Show each gender code and the corresponding count of guests sorted by the count in descending order.\nAdditional table information: table: apartment_rentals", "answer": "SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC"} {"question": "How many students have personal names that contain the word 'son'?\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(*) FROM Students WHERE personal_name LIKE '%son%'"} {"question": "What is the name of the wrestler with the fewest days held?\nAdditional table information: table: wrestler", "answer": "SELECT Name FROM wrestler ORDER BY Days_held ASC NULLS FIRST LIMIT 1"} {"question": "Show the region name with at least two storms.\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Tell me the distinct block codes where some rooms are available.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT blockcode FROM room WHERE unavailable = 0"} {"question": "Find the average and minimum weight for each gender.\nAdditional table information: table: candidate_poll", "answer": "SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex"} {"question": "What is the average points of players from club with name 'AIB'.\nAdditional table information: table: sports_competition", "answer": "SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = 'AIB'"} {"question": "How many movie reviews does each director get?\nAdditional table information: table: movie_1", "answer": "SELECT COUNT(*), T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director"} {"question": "What are the names of all singers that are from the UK and released a song in English?\nAdditional table information: table: music_1", "answer": "SELECT artist_name FROM artist WHERE country = 'UK' INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'english'"} {"question": "Find the name of the department that has no students minored in?\nAdditional table information: table: college_3", "answer": "SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO"} {"question": "What is the description of the most popular role among users that have logged in?\nAdditional table information: table: document_management", "answer": "SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What is the placement date of the order whose invoice number is 10?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10"} {"question": "What are the mascots for schools with enrollments above the average?\nAdditional table information: table: school_finance", "answer": "SELECT mascot FROM school WHERE enrollment > (SELECT AVG(enrollment) FROM school)"} {"question": "List every individual's first name, middle name and last name in alphabetical order by last name.\nAdditional table information: table: e_government", "answer": "SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name NULLS FIRST"} {"question": "What are the titles, years, and directors of all movies, ordered by budget in millions?\nAdditional table information: table: culture_company", "answer": "SELECT title, YEAR, director FROM movie ORDER BY budget_million NULLS FIRST"} {"question": "Which engineer has visited the most times? Show the engineer id, first name and last name.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1, Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Give me a list of all the service names sorted alphabetically.\nAdditional table information: table: insurance_fnol", "answer": "SELECT service_name FROM services ORDER BY service_name NULLS FIRST"} {"question": "Find the names of nurses who are on call.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse"} {"question": "Count the number of stores.\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM store"} {"question": "Eduardo Martins is a customer at which company?\nAdditional table information: table: store_1", "answer": "SELECT company FROM customers WHERE first_name = 'Eduardo' AND last_name = 'Martins'"} {"question": "What is the maximum and mininum number of transit passengers for all airports?\nAdditional table information: table: aircraft", "answer": "SELECT MAX(Transit_Passengers), MIN(Transit_Passengers) FROM airport"} {"question": "What is the organisation type and id of the organisation which has the most number of research staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_type, T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names of all reviewers who have ratings with a NULL value for the date.\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = 'null'"} {"question": "How many sections does course ACCT-211 has?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211'"} {"question": "what is the name of the country that participated in the most tournament competitions?\nAdditional table information: table: sports_competition", "answer": "SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show all the distinct districts for elections.\nAdditional table information: table: election", "answer": "SELECT DISTINCT District FROM election"} {"question": "What are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM savings)"} {"question": "How many distinct payment methods are used by parties?\nAdditional table information: table: e_government", "answer": "SELECT COUNT(DISTINCT payment_method_code) FROM parties"} {"question": "Count the number of different complaint type codes.\nAdditional table information: table: customer_complaints", "answer": "SELECT COUNT(DISTINCT complaint_type_code) FROM complaints"} {"question": "What is the total rating of channel for each channel owner?\nAdditional table information: table: program_share", "answer": "SELECT SUM(Rating_in_percent), OWNER FROM channel GROUP BY OWNER"} {"question": "What are the first and last names of all drivers who participated in the Australian Grand Prix but not the Chinese Grand Prix?\nAdditional table information: table: formula_1", "answer": "SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Australian Grand Prix' EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Chinese Grand Prix'"} {"question": "List the name of all different customers who have some loan sorted by their total loan amount.\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) NULLS FIRST"} {"question": "For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade.\nAdditional table information: table: student_1", "answer": "SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade"} {"question": "What is the total number of faculty members?\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Faculty"} {"question": "How many distinct claim outcome codes are there?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT COUNT(DISTINCT claim_outcome_code) FROM claims_processing"} {"question": "What are the last names of female students, ordered by age descending?\nAdditional table information: table: college_3", "answer": "SELECT LName FROM STUDENT WHERE Sex = 'F' ORDER BY Age DESC"} {"question": "Find the male friend of Alice whose job is a doctor?\nAdditional table information: table: network_2", "answer": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'"} {"question": "List the carriers of devices that have no devices in stock.\nAdditional table information: table: device", "answer": "SELECT Carrier FROM device WHERE NOT Device_ID IN (SELECT Device_ID FROM stock)"} {"question": "Return the lot details and investor ids.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT lot_details, investor_id FROM LOTS"} {"question": "Count the number of different countries that climbers are from.\nAdditional table information: table: climbing", "answer": "SELECT COUNT(DISTINCT Country) FROM climber"} {"question": "how many different positions are there?\nAdditional table information: table: sports_competition", "answer": "SELECT COUNT(DISTINCT POSITION) FROM player"} {"question": "What are the distinct visit dates?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT DISTINCT Visit_Date FROM VISITS"} {"question": "What are the census rankings of cities that do not have the status 'Village'?\nAdditional table information: table: farm", "answer": "SELECT Census_Ranking FROM city WHERE Status <> 'Village'"} {"question": "List the dates of games by the home team name in descending order.\nAdditional table information: table: game_injury", "answer": "SELECT Date FROM game ORDER BY home_team DESC"} {"question": "How many distinct programs are broadcast at 'Night' time?\nAdditional table information: table: program_share", "answer": "SELECT COUNT(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night'"} {"question": "List each test result and its count in descending order of count.\nAdditional table information: table: e_learning", "answer": "SELECT test_result, COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC"} {"question": "Find the countries that have never participated in any competition with Friendly type.\nAdditional table information: table: sports_competition", "answer": "SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'"} {"question": "What are the ids of the problems reported after the date of any problems reported by Rylan Homenick?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > (SELECT MAX(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = 'Rylan' AND T4.staff_last_name = 'Homenick')"} {"question": "Find the organisation ids and details of the organisations which are involved in\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T2.organisation_id, T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING SUM(T1.grant_amount) > 6000"} {"question": "What is the code of the product type with an average price higher than the average price of all products?\nAdditional table information: table: department_store", "answer": "SELECT product_type_code FROM products GROUP BY product_type_code HAVING AVG(product_price) > (SELECT AVG(product_price) FROM products)"} {"question": "How many students does each advisor have?\nAdditional table information: table: voter_2", "answer": "SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor"} {"question": "Find the total revenue of companies of each founder.\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder"} {"question": "What are the distinct names of customers with an order status of Pending, sorted by customer id?\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Pending' ORDER BY T2.customer_id NULLS FIRST"} {"question": "Find the names of users who do not have a first notification of loss record.\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id"} {"question": "Return the the details of all products.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT DISTINCT product_details FROM products"} {"question": "Find the name of students who have taken the prerequisite course of the course with title International Finance.\nAdditional table information: table: college_2", "answer": "SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')"} {"question": "What are the names and trade names of the medcines that are FDA approved?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name, trade_name FROM medicine WHERE FDA_approved = 'Yes'"} {"question": "What are the ids and locations of all circuits in France or Belgium?\nAdditional table information: table: formula_1", "answer": "SELECT circuitid, LOCATION FROM circuits WHERE country = 'France' OR country = 'Belgium'"} {"question": "How many customers don't have an account?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Accounts)"} {"question": "Return the name of the organization which has the most contact individuals.\nAdditional table information: table: e_government", "answer": "SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show different occupations along with the number of players in each occupation.\nAdditional table information: table: riding_club", "answer": "SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation"} {"question": "Find the name and capacity of the dorm with least number of amenities.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What is the age of the doctor named Zach?\nAdditional table information: table: network_2", "answer": "SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'"} {"question": "Show the minister who took office after 1961 or before 1959.\nAdditional table information: table: party_people", "answer": "SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959"} {"question": "What are the name of courses that have at least five enrollments?\nAdditional table information: table: college_3", "answer": "SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5"} {"question": "What is the temperature of 'Shanghai' city in January?\nAdditional table information: table: city_record", "answer": "SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = 'Shanghai'"} {"question": "Find the stories of the building with the largest height.\nAdditional table information: table: company_office", "answer": "SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1"} {"question": "How many students are age 18?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student WHERE age = 18"} {"question": "How many reviewers listed?\nAdditional table information: table: movie_1", "answer": "SELECT COUNT(*) FROM Reviewer"} {"question": "Find the id of courses which are registered or attended by student whose id is 121?\nAdditional table information: table: student_assessment", "answer": "SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121"} {"question": "What are the ids, types, and details of the organization with the most research staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the most common competition type?\nAdditional table information: table: sports_competition", "answer": "SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average duration in milliseconds of tracks that belong to Latin or Pop genre?\nAdditional table information: table: chinook_1", "answer": "SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Latin' OR T1.Name = 'Pop'"} {"question": "What is the title of the prerequisite class of International Finance course?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')"} {"question": "What is the year and semester with the most courses?\nAdditional table information: table: college_2", "answer": "SELECT semester, YEAR FROM SECTION GROUP BY semester, YEAR ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the cities which have exactly two airports.\nAdditional table information: table: flight_4", "answer": "SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2"} {"question": "What are the distinct registration dates and the election cycles?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD"} {"question": "What are the titles of all the Aerosmith albums?\nAdditional table information: table: store_1", "answer": "SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = 'Aerosmith'"} {"question": "List the name of browsers in descending order by market share.\nAdditional table information: table: browser_web", "answer": "SELECT name FROM browser ORDER BY market_share DESC"} {"question": "What are the name and active date of the customers whose contact channel code is email?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'"} {"question": "What is the famous release date of the artist with the oldest age?\nAdditional table information: table: music_4", "answer": "SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1"} {"question": "Show the school name and driver name for all school buses.\nAdditional table information: table: school_bus", "answer": "SELECT T2.school, T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON T1.driver_id = T3.driver_id"} {"question": "List the distinct director of all films.\nAdditional table information: table: film_rank", "answer": "SELECT DISTINCT Director FROM film"} {"question": "What are the names of students who haven't taken any Biology courses?\nAdditional table information: table: college_2", "answer": "SELECT name FROM student WHERE NOT id IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')"} {"question": "Which problems are reported by the staff with first name 'Christop'? Show the descriptions of the problems.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Christop'"} {"question": "What are the names of instructors who didn't teach courses in the Spring?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches WHERE semester = 'Spring')"} {"question": "What are the name and location of the cinema with the largest capacity?\nAdditional table information: table: cinema", "answer": "SELECT name, LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1"} {"question": "Who is the founder of Sony?\nAdditional table information: table: manufactory_1", "answer": "SELECT founder FROM manufacturers WHERE name = 'Sony'"} {"question": "Find the number of amenities for each of the dorms that can accommodate more than 100 students.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid"} {"question": "Give the advisor with the most students.\nAdditional table information: table: allergy_1", "answer": "SELECT advisor FROM Student GROUP BY advisor ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the different nationalities and the number of journalists of each nationality.\nAdditional table information: table: news_report", "answer": "SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality"} {"question": "What is the name and checking balance of the account which has the lowest savings balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance NULLS FIRST LIMIT 1"} {"question": "What is the location of the club named 'Tennis Club'?\nAdditional table information: table: club_1", "answer": "SELECT clublocation FROM club WHERE clubname = 'Tennis Club'"} {"question": "Show the positions of the players from the team with name 'Ryley Goldner'.\nAdditional table information: table: match_season", "answer": "SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Ryley Goldner'"} {"question": "What are the names and trade names of the medicines which has 'Yes' value in the FDA record?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name, trade_name FROM medicine WHERE FDA_approved = 'Yes'"} {"question": "What are the movie titles with the highest average rating and what are those ratings?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) DESC LIMIT 1"} {"question": "What is the average age of the members of the club 'Bootup Baltimore'?\nAdditional table information: table: club_1", "answer": "SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore'"} {"question": "Show the most common nationality of pilots.\nAdditional table information: table: pilot_record", "answer": "SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the names of phones that are on market with number of shops greater than 50.\nAdditional table information: table: phone_market", "answer": "SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50"} {"question": "What is the average access count of documents?\nAdditional table information: table: document_management", "answer": "SELECT AVG(access_count) FROM documents"} {"question": "Show the names and ids of tourist attractions that are visited at most once.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) <= 1"} {"question": "Which institution does 'Katsuhiro Ueno' belong to?\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = 'Katsuhiro' AND t1.lname = 'Ueno'"} {"question": "Find the name of companies whose revenue is greater than the average revenue of all companies.\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM manufacturers WHERE revenue > (SELECT AVG(revenue) FROM manufacturers)"} {"question": "Find the names of scientists who are not working on the project with the highest hours.\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)"} {"question": "Find the products which have problems reported by both Lacey Bosco and Kenton Champlin?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T2.product_name FROM problems AS T1, product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = 'Lacey' AND T3.staff_last_name = 'Bosco' INTERSECT SELECT T2.product_name FROM problems AS T1, product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = 'Kenton' AND T3.staff_last_name = 'Champlin'"} {"question": "What are the names of wines, sorted in alphabetical order?\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Name FROM WINE ORDER BY Name NULLS FIRST"} {"question": "What is the name of the most common genre in all tracks?\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the first and last name of students who are not in the largest major.\nAdditional table information: table: dorm_1", "answer": "SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "Which of the airport names contains the word 'international'?\nAdditional table information: table: flight_company", "answer": "SELECT name FROM airport WHERE name LIKE '%international%'"} {"question": "What is the average weeks on top of volumes associated with the artist aged 25 or younger?\nAdditional table information: table: music_4", "answer": "SELECT AVG(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25"} {"question": "What is the order date of each booking?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Order_Date FROM BOOKINGS"} {"question": "Give me a list of all the distinct building descriptions.\nAdditional table information: table: apartment_rentals", "answer": "SELECT DISTINCT building_description FROM Apartment_Buildings"} {"question": "Which paper has the most authors? Give me the paper title.\nAdditional table information: table: icfp_1", "answer": "SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship)"} {"question": "What are the names of the physicians who have 'senior' in their titles.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM physician WHERE POSITION LIKE '%senior%'"} {"question": "Find the ids of the nurses who are on call in block floor 1 and block code 1.\nAdditional table information: table: hospital_1", "answer": "SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1"} {"question": "List the names of all songs that have 4 minute duration or are in English.\nAdditional table information: table: music_1", "answer": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE '4:%' UNION SELECT song_name FROM song WHERE languages = 'english'"} {"question": "Which papers did the author 'Olin Shivers' write? Give me the paper titles.\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Olin' AND t1.lname = 'Shivers'"} {"question": "How many different bike ids are there?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(DISTINCT bike_id) FROM trip"} {"question": "Give me the zip code where the average mean humidity is below 70 and at least 100 trips took place.\nAdditional table information: table: bike_1", "answer": "SELECT zip_code FROM weather GROUP BY zip_code HAVING AVG(mean_humidity) < 70 INTERSECT SELECT zip_code FROM trip GROUP BY zip_code HAVING COUNT(*) >= 100"} {"question": "Which apartments have bookings with status code 'Confirmed'? Return their apartment numbers.\nAdditional table information: table: apartment_rentals", "answer": "SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Confirmed'"} {"question": "How many courses are there in total?\nAdditional table information: table: college_3", "answer": "SELECT COUNT(*) FROM COURSE"} {"question": "What are the full names of faculties with sex M and who live in building NEB?\nAdditional table information: table: college_3", "answer": "SELECT Fname, Lname FROM FACULTY WHERE sex = 'M' AND Building = 'NEB'"} {"question": "What are the names of the countries and average invoice size of the top countries by size?\nAdditional table information: table: store_1", "answer": "SELECT billing_country, AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10"} {"question": "What are the ids of all students and number of hours played?\nAdditional table information: table: game_1", "answer": "SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid"} {"question": "What are the average height and weight across males (sex is M)?\nAdditional table information: table: candidate_poll", "answer": "SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M'"} {"question": "Show the names and locations of institutions that are founded after 1990 and have the type 'Private'.\nAdditional table information: table: protein_institute", "answer": "SELECT institution, LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'"} {"question": "Find the names of all English songs.\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song WHERE languages = 'english'"} {"question": "Find the name of the students who have more than one advisor?\nAdditional table information: table: college_2", "answer": "SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING COUNT(*) > 1"} {"question": "Find papers whose second author has last name 'Turon' and is affiliated with an institution in the country 'USA'.\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = 'USA' AND t2.authorder = 2 AND t1.lname = 'Turon'"} {"question": "What are the ids and names of the architects who built at least 3 bridges ?\nAdditional table information: table: architecture", "answer": "SELECT T1.id, T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) >= 3"} {"question": "Find the name of the room with the maximum occupancy.\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1"} {"question": "What is the average unit price of tracks that belong to Jazz genre?\nAdditional table information: table: chinook_1", "answer": "SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Jazz'"} {"question": "Find the ids and first names of the 3 teachers that have the most number of assessment notes?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.teacher_id, T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What is the team and starting year for each technician?\nAdditional table information: table: machine_repair", "answer": "SELECT Team, Starting_Year FROM technician"} {"question": "Show all official native languages that contain the word 'English'.\nAdditional table information: table: match_season", "answer": "SELECT Official_native_language FROM country WHERE Official_native_language LIKE '%English%'"} {"question": "Find the titles of items whose rating is higher than the average review rating of all items.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT AVG(rating) FROM review)"} {"question": "Give the ids of documents that have expenses and contain the letter s in their names.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%'"} {"question": "Give the id and product type of the product with the lowest price.\nAdditional table information: table: department_store", "answer": "SELECT product_id, product_type_code FROM products ORDER BY product_price NULLS FIRST LIMIT 1"} {"question": "For each position, what is the maximum number of hours for students who spent more than 1000 hours training?\nAdditional table information: table: soccer_2", "answer": "SELECT MAX(T1.HS), pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos"} {"question": "What are the student ids for students over 20 years old?\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Student WHERE age > 20"} {"question": "What is the name, city, country, and elevation for every airport in the city of New York?\nAdditional table information: table: flight_4", "answer": "SELECT name, city, country, elevation FROM airports WHERE city = 'New York'"} {"question": "How many documents correspond with each project id?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id"} {"question": "How many classes does the professor whose last name is Graztevski teach?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski'"} {"question": "Find the ids of the problems that are reported by the staff whose last name is Bosco.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = 'Bosco'"} {"question": "What are the names of all students who took a class and the corresponding course descriptions?\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code"} {"question": "Show times of elimination of wrestlers with days held more than 50.\nAdditional table information: table: wrestler", "answer": "SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50"} {"question": "Find the file format that is used by the most files.\nAdditional table information: table: music_1", "answer": "SELECT formats FROM files GROUP BY formats ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the average amount of transactions with type code 'SALE'.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT AVG(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = 'SALE'"} {"question": "How many people are under 40 for each gender?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender"} {"question": "Which claims had exactly one settlement? For each, tell me the the date the claim was made, the date it was settled and the amount settled.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.claim_id, T1.date_claim_made, T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING COUNT(*) = 1"} {"question": "What are the grade number and classroom number of each class in the list?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT classroom, grade FROM list"} {"question": "For each user, return the name and the average rating of reviews given by them.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id"} {"question": "How many video games have type Massively multiplayer online game?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(*) FROM Video_games WHERE gtype = 'Massively multiplayer online game'"} {"question": "What are the price ranges of hotels?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT price_range FROM HOTELS"} {"question": "What are the last names of faculty who are part of the computer science department?\nAdditional table information: table: college_3", "answer": "SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = 'Computer Science'"} {"question": "Count the number of candidates.\nAdditional table information: table: candidate_poll", "answer": "SELECT COUNT(*) FROM candidate"} {"question": "How many schools are there?\nAdditional table information: table: school_player", "answer": "SELECT COUNT(*) FROM school"} {"question": "List the council tax ids and their related cmi cross references of all the parking fines.\nAdditional table information: table: local_govt_mdm", "answer": "SELECT council_tax_id, cmi_cross_ref_id FROM parking_fines"} {"question": "In 2014, what are the id and rank of the team that has the largest average number of attendance?\nAdditional table information: table: baseball_1", "answer": "SELECT T2.team_id, T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY AVG(T1.attendance) DESC LIMIT 1"} {"question": "What are the titles of all movies that have not been rated?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating)"} {"question": "Give the names and scores of wines made from white grapes.\nAdditional table information: table: wine_1", "answer": "SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White'"} {"question": "Count the number of trips that did not end in San Francisco city.\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city <> 'San Francisco'"} {"question": "Return the last name, id and phone number of the customer who has made the greatest number of orders.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.customer_last_name, T1.customer_id, T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many races are there?\nAdditional table information: table: race_track", "answer": "SELECT COUNT(*) FROM race"} {"question": "Show all track names that have had no races.\nAdditional table information: table: race_track", "answer": "SELECT name FROM track WHERE NOT track_id IN (SELECT track_id FROM race)"} {"question": "List all schools and their nicknames in the order of founded year.\nAdditional table information: table: university_basketball", "answer": "SELECT school, nickname FROM university ORDER BY founded NULLS FIRST"} {"question": "How many bookings do we have?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT COUNT(*) FROM BOOKINGS"} {"question": "Find the average height of the players who belong to the college called 'Yale University'.\nAdditional table information: table: baseball_1", "answer": "SELECT AVG(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University'"} {"question": "List the distinct police forces of counties whose location is not on east side.\nAdditional table information: table: county_public_safety", "answer": "SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION <> 'East'"} {"question": "For which product was there a problem reported by Christop Berge, with closure authorised by Ashley Medhurst? Return the product ids.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Christop' AND T2.staff_last_name = 'Berge' INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = 'Ashley' AND T2.staff_last_name = 'Medhurst'"} {"question": "Find all the instruments ever used by the musician with last name 'Heilo'?\nAdditional table information: table: music_2", "answer": "SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = 'Heilo'"} {"question": "How many different allergy types exist?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(DISTINCT allergytype) FROM Allergy_type"} {"question": "Show the number of accounts.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Accounts"} {"question": "Which staff have contacted which engineers? List the staff name and the engineer first name and last name.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.staff_name, T3.first_name, T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id"} {"question": "What is the total number of clubs?\nAdditional table information: table: sports_competition", "answer": "SELECT COUNT(*) FROM club"} {"question": "display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct <> 'null' OR department_id <> 40"} {"question": "Count the number of distinct company industries.\nAdditional table information: table: company_office", "answer": "SELECT COUNT(DISTINCT Industry) FROM Companies"} {"question": "For each denomination, return the denomination and the count of schools with that denomination.\nAdditional table information: table: school_player", "answer": "SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination"} {"question": "How many regions are affected?\nAdditional table information: table: storm_record", "answer": "SELECT COUNT(DISTINCT region_id) FROM affected_region"} {"question": "Show all transaction types.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT DISTINCT transaction_type FROM Financial_Transactions"} {"question": "Show all allergies with number of students affected.\nAdditional table information: table: allergy_1", "answer": "SELECT Allergy, COUNT(*) FROM Has_allergy GROUP BY Allergy"} {"question": "What are the email addresses and date of births for all customers who have a first name of Carole?\nAdditional table information: table: driving_school", "answer": "SELECT email_address, date_of_birth FROM Customers WHERE first_name = 'Carole'"} {"question": "How many songs are there?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM Songs"} {"question": "Count the number of financial transactions that correspond to each account id.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*), account_id FROM Financial_transactions"} {"question": "Find the states or counties where the stores with marketing region code 'CA' are located.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = 'CA'"} {"question": "What are the ids of all trips that had a duration as long as the average trip duration in the zip code 94103?\nAdditional table information: table: bike_1", "answer": "SELECT id FROM trip WHERE duration >= (SELECT AVG(duration) FROM trip WHERE zip_code = 94103)"} {"question": "Find the number of phones for each accreditation type.\nAdditional table information: table: phone_1", "answer": "SELECT Accreditation_type, COUNT(*) FROM phone GROUP BY Accreditation_type"} {"question": "What are the names of actors who have been in the musical titled The Phantom of the Opera?\nAdditional table information: table: musical", "answer": "SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID WHERE T2.Name = 'The Phantom of the Opera'"} {"question": "What is the id of the trip that has the shortest duration?\nAdditional table information: table: bike_1", "answer": "SELECT id FROM trip ORDER BY duration NULLS FIRST LIMIT 1"} {"question": "List the name of tracks belongs to genre Rock and whose media type is MPEG audio file.\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = 'Rock' AND T3.name = 'MPEG audio file'"} {"question": "How many schools have students playing in goalie and mid-field positions?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')"} {"question": "Find the average hours of all projects.\nAdditional table information: table: scientist_1", "answer": "SELECT AVG(hours) FROM projects"} {"question": "What are the top 10 customers' first and last names with the highest gross sales, and also what are the sales?\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10"} {"question": "What are the countries that have both mountains that are higher than 5600 and lower than 5200?\nAdditional table information: table: climbing", "answer": "SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200"} {"question": "What are the enrollment dates of all the tests that have result 'Pass'?\nAdditional table information: table: e_learning", "answer": "SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = 'Pass'"} {"question": "Find the names of all person sorted in the descending order using age.\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person ORDER BY age DESC"} {"question": "How many proteins are associated with an institution in a building with at least 20 floors?\nAdditional table information: table: protein_institute", "answer": "SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20"} {"question": "How many albums does Billy Cobham has?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = 'Billy Cobham'"} {"question": "Count the number of chip model that do not have wifi.\nAdditional table information: table: phone_1", "answer": "SELECT COUNT(*) FROM chip_model WHERE wifi = 'No'"} {"question": "Find the name of the most expensive hardware product.\nAdditional table information: table: department_store", "answer": "SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1"} {"question": "In how many different states are banks located?\nAdditional table information: table: loan_1", "answer": "SELECT COUNT(DISTINCT state) FROM bank"} {"question": "What instruments did the musician with the last name 'Heilo' play in the song 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = 'Heilo' AND T3.title = 'Le Pop'"} {"question": "What are the average prices of products, grouped by manufacturer name?\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name"} {"question": "Find the total amount of products ordered before 2018-03-17 07:13:53.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < '2018-03-17 07:13:53'"} {"question": "How many undergraduates are there at San Jose State\nAdditional table information: table: csu_1", "answer": "SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = 'San Jose State University'"} {"question": "What are all the labels?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT label FROM Albums"} {"question": "Show the student id of the oldest student.\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Student WHERE age = (SELECT MAX(age) FROM Student)"} {"question": "Show the ages of gymnasts in descending order of total points.\nAdditional table information: table: gymnast", "answer": "SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC"} {"question": "what are the first name and last name of all candidates?\nAdditional table information: table: student_assessment", "answer": "SELECT T2.first_name, T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id"} {"question": "What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC"} {"question": "Show the names of countries that have more than one roller coaster.\nAdditional table information: table: roller_coaster", "answer": "SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1"} {"question": "What is the description of the marketing region China?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = 'China'"} {"question": "What are all the locations with a cinema?\nAdditional table information: table: cinema", "answer": "SELECT DISTINCT LOCATION FROM cinema"} {"question": "Show names of actors and names of musicals they are in.\nAdditional table information: table: musical", "answer": "SELECT T1.Name, T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID"} {"question": "What are the maximum and minimum week on top of all volumes?\nAdditional table information: table: music_4", "answer": "SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume"} {"question": "Show the names of employees with role name Editor.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Editor'"} {"question": "What are the names of actors, ordered alphabetically?\nAdditional table information: table: musical", "answer": "SELECT Name FROM actor ORDER BY Name ASC NULLS FIRST"} {"question": "Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) = 2 INTERSECT SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) < 2"} {"question": "What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?\nAdditional table information: table: local_govt_mdm", "answer": "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'"} {"question": "How many drivers are from Hartford city or younger than 40?\nAdditional table information: table: school_bus", "answer": "SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40"} {"question": "Show theme and year for all exhibitions with ticket prices lower than 15.\nAdditional table information: table: theme_gallery", "answer": "SELECT theme, YEAR FROM exhibition WHERE ticket_price < 15"} {"question": "What is the type and id of the organization that has the most research staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_type, T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many employees are living in Canada?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM employees WHERE country = 'Canada'"} {"question": "What are the days that had the smallest temperature range, and what was that range?\nAdditional table information: table: bike_1", "answer": "SELECT date, max_temperature_f - min_temperature_f FROM weather ORDER BY max_temperature_f - min_temperature_f NULLS FIRST LIMIT 1"} {"question": "Find the names of users who did not leave any review.\nAdditional table information: table: epinions_1", "answer": "SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review)"} {"question": "What is the average prices of wines for each each?\nAdditional table information: table: wine_1", "answer": "SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR"} {"question": "Find the name and attribute ID of the attribute definitions with attribute value 0.\nAdditional table information: table: product_catalog", "answer": "SELECT t1.attribute_name, t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0"} {"question": "What are the first and last name for those employees who works either in department 70 or 90?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90"} {"question": "Return the id of the department with the fewest staff assignments.\nAdditional table information: table: department_store", "answer": "SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Find the code of the location with the largest number of documents.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names, checking balances, and savings balances of customers, ordered by the total of checking and savings balances descending?\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance DESC"} {"question": "What is the description of the color used by least products?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Return the positions of players on the team Ryley Goldner.\nAdditional table information: table: match_season", "answer": "SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Ryley Goldner'"} {"question": "Count the number of distinct instructors who have taught a course.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT id) FROM teaches"} {"question": "Show the most common college of authors of submissions.\nAdditional table information: table: workshop_paper", "answer": "SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the phones and emails of workshop groups in which services are performed?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID"} {"question": "How many furniture components are there in total?\nAdditional table information: table: manufacturer", "answer": "SELECT SUM(num_of_component) FROM furniture"} {"question": "What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000?\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000"} {"question": "How many distinct artists have volumes?\nAdditional table information: table: music_4", "answer": "SELECT COUNT(DISTINCT Artist_ID) FROM volume"} {"question": "What is the name corresponding to the accoung with the lowest sum of checking and savings balances?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance NULLS FIRST LIMIT 1"} {"question": "Find the GDP of the city with the largest regional population.\nAdditional table information: table: city_record", "answer": "SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1"} {"question": "Count the number of members in club 'Bootup Baltimore' whose age is below 18.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.age < 18"} {"question": "Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme.\nAdditional table information: table: journal_committee", "answer": "SELECT T2.Name, T2.age, T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID ORDER BY T3.Theme ASC NULLS FIRST"} {"question": "Show all church names except for those that had a wedding in year 2015.\nAdditional table information: table: wedding", "answer": "SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015"} {"question": "What are the invoice dates for customers with the first name Astrid and the last name Gruber?\nAdditional table information: table: chinook_1", "answer": "SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = 'Astrid' AND LastName = 'Gruber'"} {"question": "How many documents do not have any expense?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses)"} {"question": "How many customers live in the city of Prague?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM customers WHERE city = 'Prague'"} {"question": "List the names of all distinct wines in alphabetical order.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Name FROM WINE ORDER BY Name NULLS FIRST"} {"question": "What are the different region names, ordered by labels?\nAdditional table information: table: party_people", "answer": "SELECT DISTINCT region_name FROM region ORDER BY Label NULLS FIRST"} {"question": "Show the transaction types and the total amount of transactions.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT transaction_type, SUM(transaction_amount) FROM Financial_transactions GROUP BY transaction_type"} {"question": "What is the number of graduates in 'San Francisco State University' in year 2004?\nAdditional table information: table: csu_1", "answer": "SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = 'San Francisco State University'"} {"question": "List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.\nAdditional table information: table: wine_1", "answer": "SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name NULLS FIRST"} {"question": "Find the order dates of the orders with price above 1000.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000"} {"question": "What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly?\nAdditional table information: table: flight_1", "answer": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY COUNT(*) >= 5 NULLS FIRST"} {"question": "Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.\nAdditional table information: table: flight_1", "answer": "SELECT flno, origin, destination FROM Flight ORDER BY origin NULLS FIRST"} {"question": "What is the zip code of the hosue of the employee named Janessa Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "For each grade 0 classroom, return the classroom number and the count of students.\nAdditional table information: table: student_1", "answer": "SELECT classroom, COUNT(*) FROM list WHERE grade = '0' GROUP BY classroom"} {"question": "find the program owners that have some programs in both morning and night time.\nAdditional table information: table: program_share", "answer": "SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = 'Morning' INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = 'Night'"} {"question": "How many users are there?\nAdditional table information: table: epinions_1", "answer": "SELECT COUNT(*) FROM useracct"} {"question": "What is the average rating stars and title for the oldest movie?\nAdditional table information: table: movie_1", "answer": "SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(YEAR) FROM Movie)"} {"question": "What are the apartment number, start date, and end date of each apartment booking?\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id"} {"question": "What are the ids of all the employees who authorize document destruction?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "Which restaurants have highest rating? List the restaurant name and its rating.\nAdditional table information: table: restaurant_1", "answer": "SELECT ResName, Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1"} {"question": "List all the possible ways to get to attractions, together with the number of attractions accessible by these methods.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There"} {"question": "Find the number of activities Mark Giuliano is involved in.\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = 'Mark' AND T1.lname = 'Giuliano'"} {"question": "Count the number of courses without prerequisites.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)"} {"question": "What are the instruments are used in the song 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'"} {"question": "What are the average price and score of wines grouped by appelation?\nAdditional table information: table: wine_1", "answer": "SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation"} {"question": "What is the average number of employees of the departments whose rank is between 10 and 15?\nAdditional table information: table: department_management", "answer": "SELECT AVG(num_employees) FROM department WHERE ranking BETWEEN 10 AND 15"} {"question": "Count the number of customers who are active.\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM customer WHERE active = '1'"} {"question": "How many clubs are there?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club"} {"question": "List the event venues and names that have the top 2 most number of people attended.\nAdditional table information: table: news_report", "answer": "SELECT venue, name FROM event ORDER BY Event_Attendance DESC LIMIT 2"} {"question": "Find the last names of the teachers that teach fifth grade.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5"} {"question": "What is the position that is most common among players in match seasons?\nAdditional table information: table: match_season", "answer": "SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Who are the different players, what season do they play in, and what is the name of the team they are on?\nAdditional table information: table: match_season", "answer": "SELECT T1.Season, T1.Player, T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id"} {"question": "List the nations that have more than two ships.\nAdditional table information: table: ship_mission", "answer": "SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2"} {"question": "What is the location code with the most documents?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which player has the most all star game experiences? Give me the first name, last name and id of the player, as well as the number of times the player participated in all star game.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_first, T1.name_last, T1.player_id, COUNT(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC NULLS FIRST"} {"question": "What is the most common participant type?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name, location and seating for the most recently opened track?\nAdditional table information: table: race_track", "answer": "SELECT name, LOCATION, seating FROM track ORDER BY year_opened DESC LIMIT 1"} {"question": "Return the founder of Sony.\nAdditional table information: table: manufactory_1", "answer": "SELECT founder FROM manufacturers WHERE name = 'Sony'"} {"question": "For each submission, show the author and their affiliated college.\nAdditional table information: table: workshop_paper", "answer": "SELECT Author, College FROM submission"} {"question": "Give the songs included in volumes that have more than 1 week on top.\nAdditional table information: table: music_4", "answer": "SELECT Song FROM volume WHERE Weeks_on_Top > 1"} {"question": "What is the name and job title of the staff who was assigned the latest?\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_name, T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1"} {"question": "What are the distinct names of products purchased by at least two different customers?\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT(DISTINCT T1.customer_id) >= 2"} {"question": "List all information about customer master index, and sort them by details in descending order.\nAdditional table information: table: local_govt_mdm", "answer": "SELECT * FROM customer_master_index ORDER BY cmi_details DESC"} {"question": "Find the name of the source user with the highest average trust score.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.source_u_id GROUP BY T2.source_u_id ORDER BY AVG(trust) DESC LIMIT 1"} {"question": "What are the numbers of the shortest flights?\nAdditional table information: table: flight_1", "answer": "SELECT flno FROM Flight ORDER BY distance ASC NULLS FIRST LIMIT 3"} {"question": "display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN')"} {"question": "Find the description of the most popular role among the users that have logged in.\nAdditional table information: table: document_management", "answer": "SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "How many CSU campuses are there?\nAdditional table information: table: csu_1", "answer": "SELECT COUNT(*) FROM campuses"} {"question": "What are the first names of all students taking accoutning and Computer Information Systems classes?\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'"} {"question": "Find all 200 meter and 300 meter results of swimmers with nationality 'Australia'.\nAdditional table information: table: swimming", "answer": "SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia'"} {"question": "Which channels are broadcast in the morning? Give me the channel names.\nAdditional table information: table: program_share", "answer": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning'"} {"question": "Show all cities without a branch having more than 100 memberships.\nAdditional table information: table: shop_membership", "answer": "SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100"} {"question": "What is the average age for all people in the table?\nAdditional table information: table: network_2", "answer": "SELECT AVG(age) FROM Person"} {"question": "Return the famous titles for artists that have volumes that lasted more than 2 weeks on top.\nAdditional table information: table: music_4", "answer": "SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2"} {"question": "What are the employee ids for each employee and final dates of employment at their last job?\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id"} {"question": "Find the number of clubs where 'Tracy Kim' is a member.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Tracy' AND t3.lname = 'Kim'"} {"question": "What are the names of all players that got more than the average number of points?\nAdditional table information: table: sports_competition", "answer": "SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player)"} {"question": "What are the themes of parties ordered by the number of hosts in ascending manner?\nAdditional table information: table: party_host", "answer": "SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC NULLS FIRST"} {"question": "What are the names and average salaries for departments with average salary higher than 42000?\nAdditional table information: table: college_2", "answer": "SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000"} {"question": "How many users are logged in?\nAdditional table information: table: document_management", "answer": "SELECT COUNT(*) FROM users WHERE user_login = 1"} {"question": "For each end station id, what is its name, latitude, and minimum duration for trips ended there?\nAdditional table information: table: bike_1", "answer": "SELECT T1.name, T1.lat, MIN(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id"} {"question": "Which department has the highest average student GPA, and what is the average gpa?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1"} {"question": "Select the average price of each manufacturer's products, showing the manufacturer's name.\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name"} {"question": "What is the most popular full name of the actors?\nAdditional table information: table: sakila_1", "answer": "SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is total number of show times per dat for each cinema?\nAdditional table information: table: cinema", "answer": "SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id"} {"question": "Find the first name of students not enrolled in any course.\nAdditional table information: table: college_3", "answer": "SELECT Fname FROM STUDENT WHERE NOT StuID IN (SELECT StuID FROM ENROLLED_IN)"} {"question": "What are the unique names of races that held after 2000 and the circuits were in Spain?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = 'Spain' AND T1.year > 2000"} {"question": "What are the title and issues of the books?\nAdditional table information: table: book_2", "answer": "SELECT Title, Issues FROM book"} {"question": "What is the average number of people injured by all perpetrators?\nAdditional table information: table: perpetrator", "answer": "SELECT AVG(Injured) FROM perpetrator"} {"question": "Find the last name of the individuals that have been contact individuals of an organization.\nAdditional table information: table: e_government", "answer": "SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id"} {"question": "Find the papers which have 'Olin Shivers' as an author.\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Olin' AND t1.lname = 'Shivers'"} {"question": "What is the label with the most albums?\nAdditional table information: table: music_2", "answer": "SELECT label FROM albums GROUP BY label ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the age of the friend of Zach with longest year relationship?\nAdditional table information: table: network_2", "answer": "SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach')"} {"question": "Find the id and last name of the student that has the most behavior incidents?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.student_id, T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which programs' origins are not 'Beijing'? Give me the program names.\nAdditional table information: table: program_share", "answer": "SELECT name FROM program WHERE origin <> 'Beijing'"} {"question": "How many papers have 'Atsushi Ohori' published?\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Atsushi' AND t1.lname = 'Ohori'"} {"question": "What is the total money requested by entrepreneurs with height more than 1.85?\nAdditional table information: table: entrepreneur", "answer": "SELECT SUM(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85"} {"question": "Give the distinct headquarters of manufacturers.\nAdditional table information: table: manufactory_1", "answer": "SELECT DISTINCT headquarter FROM manufacturers"} {"question": "List the year in which there are more than one festivals.\nAdditional table information: table: entertainment_awards", "answer": "SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1"} {"question": "List the time of elimination of the wrestlers with largest days held.\nAdditional table information: table: wrestler", "answer": "SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1"} {"question": "Return the name and number of reservations made for each of the rooms.\nAdditional table information: table: inn_1", "answer": "SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room"} {"question": "What is the description of the role named 'Proof Reader'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_description FROM ROLES WHERE role_name = 'Proof Reader'"} {"question": "What is all the information about employees hired before June 21, 2002?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE hire_date < '2002-06-21'"} {"question": "Count the number of customer cards of the type Debit.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers_cards WHERE card_type_code = 'Debit'"} {"question": "Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London.\nAdditional table information: table: shop_membership", "answer": "SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'"} {"question": "Show the crime rates of counties in ascending order of number of police officers.\nAdditional table information: table: county_public_safety", "answer": "SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers ASC NULLS FIRST"} {"question": "Show the apartment type codes and apartment numbers in the buildings managed by 'Kyle'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.apt_type_code, T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = 'Kyle'"} {"question": "Find the last names of students studying in room 111.\nAdditional table information: table: student_1", "answer": "SELECT lastname FROM list WHERE classroom = 111"} {"question": "How many bookings did each customer make? List the customer id, first name, and the count.\nAdditional table information: table: products_for_hire", "answer": "SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id"} {"question": "How many faculty, in total, are there in the year 2002?\nAdditional table information: table: csu_1", "answer": "SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002"} {"question": "What are the details of the markets that can be accessed by walk or bus?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk' OR T2.How_to_Get_There = 'bus'"} {"question": "Compute the average score of submissions.\nAdditional table information: table: workshop_paper", "answer": "SELECT AVG(Scores) FROM submission"} {"question": "Show the residences that have at least two players.\nAdditional table information: table: riding_club", "answer": "SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2"} {"question": "Give me the theme and location of each party.\nAdditional table information: table: party_host", "answer": "SELECT Party_Theme, LOCATION FROM party"} {"question": "What is the number of students playing as a goalie?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM tryout WHERE pPos = 'goalie'"} {"question": "Show the names of players coached by the rank 1 coach.\nAdditional table information: table: riding_club", "answer": "SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 1"} {"question": "Find the number of rooms located on each block floor.\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*), T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor"} {"question": "What are the carriers of devices that are not in stock anywhere?\nAdditional table information: table: device", "answer": "SELECT Carrier FROM device WHERE NOT Device_ID IN (SELECT Device_ID FROM stock)"} {"question": "What are the denomination more than one school have?\nAdditional table information: table: school_player", "answer": "SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1"} {"question": "Find the names of all the clubs that have at least a member from the city with city code 'BAL'.\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = 'BAL'"} {"question": "Which paper is published in an institution in 'USA' and have 'Turon' as its second author?\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = 'USA' AND t2.authorder = 2 AND t1.lname = 'Turon'"} {"question": "How many ships are there?\nAdditional table information: table: ship_mission", "answer": "SELECT COUNT(*) FROM ship"} {"question": "What types of vocals are used in the song 'Badlands'?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Badlands'"} {"question": "Show the names of journalists and the dates of the events they reported.\nAdditional table information: table: news_report", "answer": "SELECT T3.Name, T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID"} {"question": "List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif'\nAdditional table information: table: mountain_photos", "answer": "SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Lasta Massif'"} {"question": "What are the emails and phone numbers of custoemrs who have never filed a complaint?\nAdditional table information: table: customer_complaints", "answer": "SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)"} {"question": "Show the distinct position of players from college UCLA or Duke.\nAdditional table information: table: match_season", "answer": "SELECT DISTINCT POSITION FROM match_season WHERE College = 'UCLA' OR College = 'Duke'"} {"question": "What are the different product names? What is the average product price for each of them?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name"} {"question": "Find the day in which the difference between the max temperature and min temperature was the smallest. Also report the difference.\nAdditional table information: table: bike_1", "answer": "SELECT date, max_temperature_f - min_temperature_f FROM weather ORDER BY max_temperature_f - min_temperature_f NULLS FIRST LIMIT 1"} {"question": "What are the names and budgets of departments with budgets greater than the average?\nAdditional table information: table: college_2", "answer": "SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)"} {"question": "Give the ids of documents with expenses that have the budget code 'SF'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF'"} {"question": "What are the names and cities of bank branches that offer loans for business?\nAdditional table information: table: loan_1", "answer": "SELECT T1.bname, T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'"} {"question": "How many customers in state of CA?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM customers WHERE state = 'CA'"} {"question": "On which days more than one revisions were made on catalogs.\nAdditional table information: table: product_catalog", "answer": "SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING COUNT(*) > 1"} {"question": "How many different software platforms are there for devices?\nAdditional table information: table: device", "answer": "SELECT COUNT(DISTINCT Software_Platform) FROM device"} {"question": "What are the elimination moves of wrestlers whose team is 'Team Orton'?\nAdditional table information: table: wrestler", "answer": "SELECT Elimination_Move FROM Elimination WHERE Team = 'Team Orton'"} {"question": "Which allergy type is most common?\nAdditional table information: table: allergy_1", "answer": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of rooms for each bed type.\nAdditional table information: table: inn_1", "answer": "SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType"} {"question": "How many different product types are there?\nAdditional table information: table: products_for_hire", "answer": "SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire"} {"question": "Return the maximum support rate, minimum consider rate, and minimum oppose rate across all candidates?\nAdditional table information: table: candidate_poll", "answer": "SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate"} {"question": "What is the response received date for the document described as Regular that was granted more than 100 dollars?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100"} {"question": "List the locations of schools that do not have any player.\nAdditional table information: table: school_player", "answer": "SELECT LOCATION FROM school WHERE NOT School_ID IN (SELECT School_ID FROM Player)"} {"question": "How many king beds are there?\nAdditional table information: table: inn_1", "answer": "SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King'"} {"question": "What are the prices of wines produced before the year of 2010?\nAdditional table information: table: wine_1", "answer": "SELECT Price FROM WINE WHERE YEAR < 2010"} {"question": "What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010?\nAdditional table information: table: college_2", "answer": "SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "How many players are there?\nAdditional table information: table: riding_club", "answer": "SELECT COUNT(*) FROM player"} {"question": "What is the count and code of the job with the most employee?\nAdditional table information: table: college_1", "answer": "SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the file sizes and formats for all songs with a resolution lower than 800?\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800"} {"question": "What are the grapes, wineries and years for wines with price higher than 100, sorted by year?\nAdditional table information: table: wine_1", "answer": "SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR NULLS FIRST"} {"question": "Which accelerator name contains substring 'Opera'?\nAdditional table information: table: browser_web", "answer": "SELECT name FROM web_client_accelerator WHERE name LIKE '%Opera%'"} {"question": "How many transaction does account with name 337 have?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = '337'"} {"question": "What are the names and salaries of instructors who advise students in the Math department?\nAdditional table information: table: college_2", "answer": "SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'"} {"question": "Find the name of account that has the lowest total checking and saving balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance NULLS FIRST LIMIT 1"} {"question": "Which team had the least number of attendances in home games in 1980?\nAdditional table information: table: baseball_1", "answer": "SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance ASC NULLS FIRST LIMIT 1"} {"question": "What is the average total score of body builders with height bigger than 200?\nAdditional table information: table: body_builder", "answer": "SELECT AVG(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200"} {"question": "What are the names of all the different reviewers who rates Gone with the Wind?\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind'"} {"question": "What is the first and last name of all the German drivers?\nAdditional table information: table: formula_1", "answer": "SELECT forename, surname FROM drivers WHERE nationality = 'German'"} {"question": "Return the weight of the shortest person.\nAdditional table information: table: entrepreneur", "answer": "SELECT Weight FROM people ORDER BY Height ASC NULLS FIRST LIMIT 1"} {"question": "Find courses that ran in Fall 2009 but not in Spring 2010.\nAdditional table information: table: college_2", "answer": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "Find the description of the club 'Pen and Paper Gaming'.\nAdditional table information: table: club_1", "answer": "SELECT clubdesc FROM club WHERE clubname = 'Pen and Paper Gaming'"} {"question": "Please show the names of the buildings whose status is 'on-hold', in ascending order of stories.\nAdditional table information: table: company_office", "answer": "SELECT name FROM buildings WHERE Status = 'on-hold' ORDER BY Stories ASC NULLS FIRST"} {"question": "What are the full names of the 3 instructors who teach the most courses?\nAdditional table information: table: college_3", "answer": "SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "For the problem with id 10, return the ids and dates of its problem logs.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10"} {"question": "Return the average price of products that have each category code.\nAdditional table information: table: customer_complaints", "answer": "SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code"} {"question": "Show different type codes of products and the number of products with each type code.\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code"} {"question": "Which classroom has the most students?\nAdditional table information: table: student_1", "answer": "SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of times ROY SWEAZY has reserved a room.\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM Reservations WHERE FirstName = 'ROY' AND LastName = 'SWEAZY'"} {"question": "Count the number of different parties.\nAdditional table information: table: party_people", "answer": "SELECT COUNT(DISTINCT party_name) FROM party"} {"question": "Find the number of routes whose destination airports are in Canada.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'"} {"question": "What is the name of the airline with the most routes?\nAdditional table information: table: flight_4", "answer": "SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are all the catalog entry names?\nAdditional table information: table: product_catalog", "answer": "SELECT DISTINCT (catalog_entry_name) FROM catalog_contents"} {"question": "How many unique labels are there for albums?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT label) FROM albums"} {"question": "Show budget type codes and the number of documents in each budget type.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code"} {"question": "Find the maximum and average capacity among rooms in each building.\nAdditional table information: table: college_2", "answer": "SELECT MAX(capacity), AVG(capacity), building FROM classroom GROUP BY building"} {"question": "Show different nominees and the number of musicals they have been nominated.\nAdditional table information: table: musical", "answer": "SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee"} {"question": "How many bank branches are there?\nAdditional table information: table: loan_1", "answer": "SELECT COUNT(*) FROM bank"} {"question": "What is maximum group equity shareholding of the companies?\nAdditional table information: table: flight_company", "answer": "SELECT MAX(group_equity_shareholding) FROM operate_company"} {"question": "How many students have a food allergy?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = 'food'"} {"question": "What are the names of any scientists who worked on projects named 'Matter of Time' and 'A Puzzling Pattern'?\nAdditional table information: table: scientist_1", "answer": "SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Puzzling Parallax'"} {"question": "Show the station name with at least two trains.\nAdditional table information: table: train_station", "answer": "SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING COUNT(*) >= 2"} {"question": "Sort the names of products in ascending order of their price.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_Name FROM Products ORDER BY Product_Price ASC NULLS FIRST"} {"question": "Show the range that has the most number of mountains.\nAdditional table information: table: climbing", "answer": "SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the name of the marketing region the store Rob Dinning is located in.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = 'Rob Dinning'"} {"question": "For every medicine id, what are the names of the medicines that can interact with more than one enzyme?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.id, T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2"} {"question": "What are the positions with both players having more than 20 points and less than 10 points.\nAdditional table information: table: sports_competition", "answer": "SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10"} {"question": "What is the product category description and unit of measurement of category 'Herbs'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'"} {"question": "How many employees live in Canada?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM employees WHERE country = 'Canada'"} {"question": "Give the color description that is least common across products.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "How many players were in the team Boston Red Stockings in 2000?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000"} {"question": "How many order items correspond to each order id?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT order_id, COUNT(*) FROM Order_items GROUP BY order_id"} {"question": "What are the names and ids of customers whose address contains TN?\nAdditional table information: table: department_store", "answer": "SELECT customer_name, customer_id FROM customers WHERE customer_address LIKE '%TN%'"} {"question": "Show the most frequently used carrier of the phones.\nAdditional table information: table: phone_market", "answer": "SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the locations of parties and the names of the party hosts in ascending order of the age of the host.\nAdditional table information: table: party_host", "answer": "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"} {"question": "What parties have at least three representatives?\nAdditional table information: table: election_representative", "answer": "SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3"} {"question": "List all pilot names in ascending alphabetical order.\nAdditional table information: table: aircraft", "answer": "SELECT Name FROM pilot ORDER BY Name ASC NULLS FIRST"} {"question": "List all headquarters and the number of companies in each headquarter.\nAdditional table information: table: gas_company", "answer": "SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters"} {"question": "Find the emails of customers who has filed a complaints of the product with the most complaints.\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What are the descriptions of all the project outcomes?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code"} {"question": "What are ids of the all distinct orders, sorted by placement date?\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed NULLS FIRST"} {"question": "What is the title, phone number and hire date for the employee named Nancy Edwards?\nAdditional table information: table: store_1", "answer": "SELECT title, phone, hire_date FROM employees WHERE first_name = 'Nancy' AND last_name = 'Edwards'"} {"question": "What are the phone, room, and building of the faculty member called Jerry Prince?\nAdditional table information: table: activity_1", "answer": "SELECT phone, room, building FROM Faculty WHERE Fname = 'Jerry' AND Lname = 'Prince'"} {"question": "What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?\nAdditional table information: table: flight_company", "answer": "SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport'"} {"question": "What are the titles of albums by the artist 'AC/DC'?\nAdditional table information: table: chinook_1", "answer": "SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = 'AC/DC'"} {"question": "What is the name of organization that has the greatest number of contact individuals?\nAdditional table information: table: e_government", "answer": "SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the industries shared by companies whose headquarters are 'USA' and companies whose headquarters are 'China'.\nAdditional table information: table: company_office", "answer": "SELECT Industry FROM Companies WHERE Headquarters = 'USA' INTERSECT SELECT Industry FROM Companies WHERE Headquarters = 'China'"} {"question": "What are the names of patients who are staying in room 111 and have an undergoing treatment?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111"} {"question": "How many staff in total?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Staff"} {"question": "What are the dates of publications in descending order of price?\nAdditional table information: table: book_2", "answer": "SELECT Publication_Date FROM publication ORDER BY Price DESC"} {"question": "Which directors had a movie in either 1999 or 2000?\nAdditional table information: table: culture_company", "answer": "SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000"} {"question": "Find the level name of the catalog with the lowest price (in USD).\nAdditional table information: table: product_catalog", "answer": "SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars NULLS FIRST LIMIT 1"} {"question": "Find the name of projects that require between 100 and 300 hours of work.\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM projects WHERE hours BETWEEN 100 AND 300"} {"question": "Show all director names who have a movie in both year 1999 and 2000.\nAdditional table information: table: culture_company", "answer": "SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999"} {"question": "What are the names of products produced by both Creative Labs and Sony?\nAdditional table information: table: manufactory_1", "answer": "SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T2.name = 'Sony'"} {"question": "Find the number of users who did not write any review.\nAdditional table information: table: epinions_1", "answer": "SELECT COUNT(*) FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review)"} {"question": "What are the medicine and trade names that cannot interact with the enzyme with the product 'Heme'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'"} {"question": "Return the unit of measure for 'Herb' products.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'"} {"question": "What is the average and oldest age for each gender of student?\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(age), MAX(age), sex FROM student GROUP BY sex"} {"question": "What is the number of distinct publication dates?\nAdditional table information: table: book_2", "answer": "SELECT COUNT(DISTINCT Publication_Date) FROM publication"} {"question": "List the name of actors in ascending alphabetical order.\nAdditional table information: table: musical", "answer": "SELECT Name FROM actor ORDER BY Name ASC NULLS FIRST"} {"question": "What are the last names and ids of all drivers who had 11 pit stops and participated in more than 5 races?\nAdditional table information: table: formula_1", "answer": "SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5"} {"question": "Count the number of appelations in Napa County.\nAdditional table information: table: wine_1", "answer": "SELECT COUNT(*) FROM APPELLATIONS WHERE County = 'Napa'"} {"question": "How many orders does Luca Mancini have in his invoices?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = 'Lucas' AND T1.last_name = 'Mancini'"} {"question": "What are the names of the enzymes used in the medicine Amisulpride that acts as inhibitors?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor'"} {"question": "What are the full names of students minoring in department 140?\nAdditional table information: table: college_3", "answer": "SELECT T2.Fname, T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140"} {"question": "What is the lowest and highest rating star?\nAdditional table information: table: movie_1", "answer": "SELECT MAX(stars), MIN(stars) FROM Rating"} {"question": "What is the last name of the contact individual from the Labour party organization who was contacted most recently?\nAdditional table information: table: e_government", "answer": "SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = 'Labour Party' ORDER BY t2.date_contact_to DESC LIMIT 1"} {"question": "Find all the order items whose product id is 11. What are the order item ids?\nAdditional table information: table: tracking_orders", "answer": "SELECT order_item_id FROM order_items WHERE product_id = 11"} {"question": "Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT cName FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL')"} {"question": "Which tourist attractions do the tourists Vincent and Marcelle visit? Tell me the names of the attractions.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Vincent' INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Marcelle'"} {"question": "What are the famous title of the artists associated with volumes with more than 2 weeks on top?\nAdditional table information: table: music_4", "answer": "SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2"} {"question": "What are the first names and department numbers for employees with last name McEwen?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'"} {"question": "What are the codes of card types that have 5 or more cards?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING COUNT(*) >= 5"} {"question": "Find the average number of followers for the users who had some tweets.\nAdditional table information: table: twitter_1", "answer": "SELECT AVG(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)"} {"question": "Who is the oldest person whose job is student?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student')"} {"question": "What are the names of the technicians by ascending order of age?\nAdditional table information: table: machine_repair", "answer": "SELECT Name FROM technician ORDER BY Age ASC NULLS FIRST"} {"question": "show the lowest low temperature and highest wind speed in miles per hour.\nAdditional table information: table: station_weather", "answer": "SELECT MIN(low_temperature), MAX(wind_speed_mph) FROM weekly_weather"} {"question": "What are the ids of all songs that are available on mp4 or have a higher resolution than 720?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM files WHERE formats = 'mp4' UNION SELECT f_id FROM song WHERE resolution > 720"} {"question": "How many classes exist for each school?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code"} {"question": "List the names and birthdays of the top five players in terms of potential.\nAdditional table information: table: soccer_1", "answer": "SELECT DISTINCT T1.player_name, T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5"} {"question": "What is the status code, phone number, and email address of the customer whose last name is Kohler or whose first name is Marina?\nAdditional table information: table: driving_school", "answer": "SELECT customer_status_code, cell_mobile_phone_number, email_address FROM Customers WHERE first_name = 'Marina' OR last_name = 'Kohler'"} {"question": "What is the average song rating for each language?\nAdditional table information: table: music_1", "answer": "SELECT AVG(rating), languages FROM song GROUP BY languages"} {"question": "What are dates of birth of all the guests whose gender is 'Male'?\nAdditional table information: table: apartment_rentals", "answer": "SELECT date_of_birth FROM Guests WHERE gender_code = 'Male'"} {"question": "What are the products with the maximum page size eqal to A4 or a pages per minute color less than 5?\nAdditional table information: table: store_product", "answer": "SELECT product FROM product WHERE max_page_size = 'A4' OR pages_per_minute_color < 5"} {"question": "List all the distinct cities\nAdditional table information: table: customers_and_addresses", "answer": "SELECT DISTINCT city FROM addresses"} {"question": "What are the title, id, and description of the movie with the greatest number of actors?\nAdditional table information: table: sakila_1", "answer": "SELECT T2.title, T2.film_id, T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many schools have some students playing in goalie and mid positions.\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')"} {"question": "Show station names without any trains.\nAdditional table information: table: train_station", "answer": "SELECT name FROM station WHERE NOT station_id IN (SELECT station_id FROM train_station)"} {"question": "Which city has the most customers living in?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the party form that is most common?\nAdditional table information: table: e_government", "answer": "SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the addresses of the course authors who teach either 'operating system' or 'data structure' course.\nAdditional table information: table: e_learning", "answer": "SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = 'operating system' OR T2.course_name = 'data structure'"} {"question": "What are the distinct payment method codes in all the invoices?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT DISTINCT payment_method_code FROM INVOICES"} {"question": "What are the names and years of the movies that has the top 3 highest rating star?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3"} {"question": "What are the other account details for the account with the name 338?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT other_account_details FROM Accounts WHERE account_name = '338'"} {"question": "Show all main industry for all companies.\nAdditional table information: table: gas_company", "answer": "SELECT DISTINCT main_industry FROM company"} {"question": "List the names of aircrafts and that won matches at least twice.\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2"} {"question": "Which rooms cost between 120 and 150? Give me the room names.\nAdditional table information: table: inn_1", "answer": "SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150"} {"question": "Return the average horizontal bar points across all gymnasts.\nAdditional table information: table: gymnast", "answer": "SELECT AVG(Horizontal_Bar_Points) FROM gymnast"} {"question": "How many authors are there?\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(*) FROM authors"} {"question": "Show the name and age for all male people who don't have a wedding.\nAdditional table information: table: wedding", "answer": "SELECT name, age FROM people WHERE is_male = 'T' AND NOT people_id IN (SELECT male_id FROM wedding)"} {"question": "For each director who directed more than one movie, what are the titles and dates of release for all those movies?\nAdditional table information: table: movie_1", "answer": "SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title"} {"question": "What are the names of wines, sorted by price ascending?\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Name FROM WINE ORDER BY price NULLS FIRST"} {"question": "How many people in total can stay in the modern rooms of this inn?\nAdditional table information: table: inn_1", "answer": "SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern'"} {"question": "Show the top 3 apartment type codes sorted by the average number of rooms in descending order.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY AVG(room_count) DESC LIMIT 3"} {"question": "What are the names of the artists who sang the shortest song?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration NULLS FIRST LIMIT 1"} {"question": "What is the customer id with most number of cards, and how many does he have?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, COUNT(*) FROM Customers_cards GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the name of artworks whose type is not 'Program Talent Show'.\nAdditional table information: table: entertainment_awards", "answer": "SELECT Name FROM artwork WHERE TYPE <> 'Program Talent Show'"} {"question": "Show the number of customers for each gender.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT gender, COUNT(*) FROM Customers GROUP BY gender"} {"question": "Find the names of the candidates whose support percentage is lower than their oppose rate.\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate"} {"question": "Find the name of scientists who are not assigned to any project.\nAdditional table information: table: scientist_1", "answer": "SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)"} {"question": "Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.\nAdditional table information: table: race_track", "answer": "SELECT LOCATION FROM track WHERE seating > 90000 INTERSECT SELECT LOCATION FROM track WHERE seating < 70000"} {"question": "What are the id and name of the stadium where the most injury accidents happened?\nAdditional table information: table: game_injury", "answer": "SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many vehicle in total?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Vehicles"} {"question": "What are the areas and counties for all appelations?\nAdditional table information: table: wine_1", "answer": "SELECT Area, County FROM APPELLATIONS"} {"question": "How many distinct president votes are recorded?\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD"} {"question": "Give me the description of the service type that offers not only the photo product but also the film product.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'"} {"question": "When did the staff member with first name as Janessa and last name as Sawayn join the company?\nAdditional table information: table: driving_school", "answer": "SELECT date_joined_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'"} {"question": "What are the names and phone numbers for all suppliers, sorted in alphabetical order of their addressed?\nAdditional table information: table: department_store", "answer": "SELECT T1.supplier_name, T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details NULLS FIRST"} {"question": "How many institutions are there?\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(*) FROM inst"} {"question": "What are the names of all video games that are collectible cards?\nAdditional table information: table: game_1", "answer": "SELECT gname FROM Video_games WHERE gtype = 'Collectible card game'"} {"question": "What are the details for the projects which were launched by the organization with the most projects?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "Count the number of different affected regions.\nAdditional table information: table: storm_record", "answer": "SELECT COUNT(DISTINCT region_id) FROM affected_region"} {"question": "List the school color of the school that has the largest enrollment.\nAdditional table information: table: school_player", "answer": "SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1"} {"question": "Find the id of the product ordered the most often on invoices.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "For each zip code, return the average mean temperature of August there.\nAdditional table information: table: bike_1", "answer": "SELECT zip_code, AVG(mean_temperature_f) FROM weather WHERE date LIKE '8/%' GROUP BY zip_code"} {"question": "Find the states where have some college students in tryout.\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName"} {"question": "What are the price ranges of five star hotels?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT price_range FROM HOTELS WHERE star_rating_code = '5'"} {"question": "How many departments are led by heads who are not mentioned?\nAdditional table information: table: department_management", "answer": "SELECT COUNT(*) FROM department WHERE NOT department_id IN (SELECT department_id FROM management)"} {"question": "What are the names of ships that were involved in a mission launched after 1928?\nAdditional table information: table: ship_mission", "answer": "SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928"} {"question": "What are the code and description of the most frequent behavior incident type?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.incident_type_code, T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code = T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the details of the shops that can be reached by walk.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk'"} {"question": "Find the name of dorms that can accommodate more than 300 students.\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm WHERE student_capacity > 300"} {"question": "List the service id and details for the events.\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT service_id, event_details FROM EVENTS"} {"question": "In which country does Roberto Almeida?\nAdditional table information: table: store_1", "answer": "SELECT country FROM customers WHERE first_name = 'Roberto' AND last_name = 'Almeida'"} {"question": "Show names for all aircrafts with distances more than the average.\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Aircraft WHERE distance > (SELECT AVG(distance) FROM Aircraft)"} {"question": "What are the names of wines produced before any wine from the Brander winery?\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = 'Brander')"} {"question": "Please show the categories of the music festivals and the count.\nAdditional table information: table: music_4", "answer": "SELECT Category, COUNT(*) FROM music_festival GROUP BY Category"} {"question": "Show the builder of railways associated with the trains named 'Andaman Exp'.\nAdditional table information: table: railway", "answer": "SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = 'Andaman Exp'"} {"question": "Which ministers are not a part of the Progress Party?\nAdditional table information: table: party_people", "answer": "SELECT minister FROM party WHERE party_name <> 'Progress Party'"} {"question": "Return the full name of the customer who made the first rental.\nAdditional table information: table: sakila_1", "answer": "SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date ASC NULLS FIRST LIMIT 1"} {"question": "Find the names of the swimmers who have no record.\nAdditional table information: table: swimming", "answer": "SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record)"} {"question": "Show the attendances of the performances at location 'TD Garden' or 'Bell Centre'\nAdditional table information: table: performance_attendance", "answer": "SELECT Attendance FROM performance WHERE LOCATION = 'TD Garden' OR LOCATION = 'Bell Centre'"} {"question": "What are the names of instructors who earn more than at least one instructor from the Biology department?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE salary > (SELECT MIN(salary) FROM instructor WHERE dept_name = 'Biology')"} {"question": "Which students live in the city with code 'NYC' and have class senator votes in the spring election cycle? Count the numbers.\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = 'NYC' AND T2.Election_Cycle = 'Spring'"} {"question": "For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name"} {"question": "Return the names and ids of customers who have TN in their address.\nAdditional table information: table: department_store", "answer": "SELECT customer_name, customer_id FROM customers WHERE customer_address LIKE '%TN%'"} {"question": "Find the id for the trips that lasted at least as long as the average duration of trips in zip code 94103.\nAdditional table information: table: bike_1", "answer": "SELECT id FROM trip WHERE duration >= (SELECT AVG(duration) FROM trip WHERE zip_code = 94103)"} {"question": "Find the total saving balance for each account name.\nAdditional table information: table: small_bank_1", "answer": "SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name"} {"question": "For each classroom, show the classroom number and count the number of distinct grades that use the room.\nAdditional table information: table: student_1", "answer": "SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom"} {"question": "How many credit cards does customer Blanche Huels have?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Blanche' AND T2.customer_last_name = 'Huels' AND T1.card_type_code = 'Credit'"} {"question": "Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.\nAdditional table information: table: department_store", "answer": "SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT AVG(product_price) FROM products)"} {"question": "On average how large is the population of the counties?\nAdditional table information: table: election", "answer": "SELECT AVG(Population) FROM county"} {"question": "Return the addresses of the course authors or tutors whose personal name is 'Cathrine'.\nAdditional table information: table: e_learning", "answer": "SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name = 'Cathrine'"} {"question": "What are the phone numbers of all customers and all staff members?\nAdditional table information: table: customer_complaints", "answer": "SELECT phone_number FROM customers UNION SELECT phone_number FROM staff"} {"question": "Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.\nAdditional table information: table: scientist_1", "answer": "SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith'"} {"question": "Which schools have more than 1 player? Give me the school locations.\nAdditional table information: table: school_player", "answer": "SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1"} {"question": "What are the products with the maximum page size A4 that also have a pages per minute color smaller than 5?\nAdditional table information: table: store_product", "answer": "SELECT product FROM product WHERE max_page_size = 'A4' AND pages_per_minute_color < 5"} {"question": "Which allergy type has most number of allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the first and last name of the faculty who is involved in the largest number of activities.\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the departure and arrival dates of all flights from LA to Honolulu?\nAdditional table information: table: flight_1", "answer": "SELECT departure_date, arrival_date FROM Flight WHERE origin = 'Los Angeles' AND destination = 'Honolulu'"} {"question": "How many aircrafts exist in the database?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Aircraft"} {"question": "Show the average transaction amount for different transaction types.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT transaction_type_code, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY transaction_type_code"} {"question": "What states have at least two representatives?\nAdditional table information: table: election_representative", "answer": "SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2"} {"question": "How many distinct locations of perpetrators are there?\nAdditional table information: table: perpetrator", "answer": "SELECT COUNT(DISTINCT LOCATION) FROM perpetrator"} {"question": "What is the highest salary among each team? List the team name, id and maximum salary.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name, T1.team_id, MAX(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id"} {"question": "How many employees are there all together?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM employee"} {"question": "What are the dates with a maximum temperature higher than 85?\nAdditional table information: table: bike_1", "answer": "SELECT date FROM weather WHERE max_temperature_f > 85"} {"question": "List the grapes and appelations of all wines.\nAdditional table information: table: wine_1", "answer": "SELECT Grape, Appelation FROM WINE"} {"question": "How many rooms cost more than 120, for each different decor?\nAdditional table information: table: inn_1", "answer": "SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor"} {"question": "Show ids for all aircrafts with more than 1000 distance.\nAdditional table information: table: flight_1", "answer": "SELECT aid FROM Aircraft WHERE distance > 1000"} {"question": "Find the name and category of the most expensive product.\nAdditional table information: table: customer_complaints", "answer": "SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1"} {"question": "Count the number of video games with Massively multiplayer online game type .\nAdditional table information: table: game_1", "answer": "SELECT COUNT(*) FROM Video_games WHERE gtype = 'Massively multiplayer online game'"} {"question": "Show all distinct location names.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT DISTINCT Location_Name FROM LOCATIONS"} {"question": "Give the districts which have two or more addresses.\nAdditional table information: table: sakila_1", "answer": "SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2"} {"question": "Find the last names of teachers teaching in classroom 109.\nAdditional table information: table: student_1", "answer": "SELECT lastname FROM teachers WHERE classroom = 109"} {"question": "Find the names of customers who have bought by at least three distinct products.\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT(DISTINCT T3.product_id) >= 3"} {"question": "What are the distinct Famous release dates?\nAdditional table information: table: music_4", "answer": "SELECT DISTINCT (Famous_Release_date) FROM artist"} {"question": "Show names of technicians and series of machines they are assigned to repair.\nAdditional table information: table: machine_repair", "answer": "SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID"} {"question": "Find the total balance across checking accounts.\nAdditional table information: table: small_bank_1", "answer": "SELECT SUM(balance) FROM checking"} {"question": "What is draft detail of the document with id 7?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT draft_details FROM Document_Drafts WHERE document_id = 7"} {"question": "Give me a list of id and status of orders which belong to the customer named 'Jeramie'.\nAdditional table information: table: tracking_orders", "answer": "SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'"} {"question": "What is the name of the document which has been accessed the most times, as well as the number of times it has been accessed?\nAdditional table information: table: document_management", "answer": "SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1"} {"question": "What is the average number of customers across banks in the state of Utah?\nAdditional table information: table: loan_1", "answer": "SELECT AVG(no_of_customers) FROM bank WHERE state = 'Utah'"} {"question": "Which year has the most degrees conferred?\nAdditional table information: table: csu_1", "answer": "SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1"} {"question": "Show the member names which are in both the party with id 3 and the party with id 1.\nAdditional table information: table: party_people", "answer": "SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1"} {"question": "What are the average, maximum, and minimum number of floors for all buildings?\nAdditional table information: table: protein_institute", "answer": "SELECT AVG(floors), MAX(floors), MIN(floors) FROM building"} {"question": "What are the send dates for all documents that have a grant amount of more than 5000 and are involved in research?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'"} {"question": "How many books are there?\nAdditional table information: table: book_2", "answer": "SELECT COUNT(*) FROM book"} {"question": "What are the names of customers with checking balances lower than the average checking balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking)"} {"question": "Find the first name of students living in city PHL whose age is between 20 and 25.\nAdditional table information: table: dorm_1", "answer": "SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25"} {"question": "What are the names of the wrestlers, ordered descending by days held?\nAdditional table information: table: wrestler", "answer": "SELECT Name FROM wrestler ORDER BY Days_held DESC"} {"question": "Show ids, customer ids, card type codes, card numbers for all cards.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_id, customer_id, card_type_code, card_number FROM Customers_cards"} {"question": "What is the name, address, and number of students in the departments that have the 3 most students?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name, T2.dept_address, COUNT(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What are the names of all the dorms that can accomdate more than 300 students?\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm WHERE student_capacity > 300"} {"question": "What is the average minimum and price of the rooms for each different decor.\nAdditional table information: table: inn_1", "answer": "SELECT decor, AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor"} {"question": "Find the name of the customers who use the most frequently used payment method.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What is the description of the claim status 'Open'?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name = 'Open'"} {"question": "How many scientists do not have any projects assigned to them?\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)"} {"question": "Find the number of people whose age is greater than all engineers.\nAdditional table information: table: network_2", "answer": "SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer')"} {"question": "What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre?\nAdditional table information: table: music_1", "answer": "SELECT MIN(T1.duration), MIN(T2.rating), T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is NULLS FIRST"} {"question": "In what year was the most degrees conferred?\nAdditional table information: table: csu_1", "answer": "SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1"} {"question": "What is the first and last name of the youngest student with a GPA above 3, and what is their GPA?\nAdditional table information: table: college_1", "answer": "SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1"} {"question": "What is the total revenue of all companies whose main office is at Tokyo or Taiwan?\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan'"} {"question": "What are the names and buying prices of all the products?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_name, typical_buying_price FROM products"} {"question": "How long does track Fast As a Shark has?\nAdditional table information: table: store_1", "answer": "SELECT milliseconds FROM tracks WHERE name = 'Fast As a Shark'"} {"question": "What are the birth date and birth place of the body builder with the highest total points?\nAdditional table information: table: body_builder", "answer": "SELECT T2.Birth_Date, T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC LIMIT 1"} {"question": "What are the purchase details of transactions with amount bigger than 10000?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000"} {"question": "What is allergy type of a cat allergy?\nAdditional table information: table: allergy_1", "answer": "SELECT allergytype FROM Allergy_type WHERE allergy = 'Cat'"} {"question": "How many members of club 'Bootup Baltimore' are younger than 18?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.age < 18"} {"question": "What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%'"} {"question": "What is the total number of students enrolled in schools without any goalies?\nAdditional table information: table: soccer_2", "answer": "SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = 'goalie')"} {"question": "Show name, address road, and city for all branches sorted by open year.\nAdditional table information: table: shop_membership", "answer": "SELECT name, address_road, city FROM branch ORDER BY open_year NULLS FIRST"} {"question": "What is the nickname of the employee named Janessa Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT nickname FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'"} {"question": "List the employees who have not showed up in any circulation history of documents. List the employee's name.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id"} {"question": "Show the detail of vehicle with id 1.\nAdditional table information: table: driving_school", "answer": "SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1"} {"question": "Find the name of accounts whose checking balance is below the average checking balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking)"} {"question": "What are the birth dates of employees living in Edmonton?\nAdditional table information: table: chinook_1", "answer": "SELECT BirthDate FROM EMPLOYEE WHERE City = 'Edmonton'"} {"question": "List all different genre types.\nAdditional table information: table: store_1", "answer": "SELECT DISTINCT name FROM genres"} {"question": "How many appointments are there?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*) FROM appointment"} {"question": "What are the first names of all employees that are professors ordered by date of birth?\nAdditional table information: table: college_1", "answer": "SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob NULLS FIRST"} {"question": "What are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type?\nAdditional table information: table: university_basketball", "answer": "SELECT SUM(Enrollment), affiliation FROM university WHERE founded > 1850 GROUP BY affiliation"} {"question": "Which physicians are trained in procedures that are more expensive than 5000?\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T3.cost > 5000"} {"question": "Show the ids for projects with at least 2 documents.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2"} {"question": "What are the names of entrepreneurs?\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID"} {"question": "Which last names are both used by customers and by staff?\nAdditional table information: table: driving_school", "answer": "SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff"} {"question": "Who performed the song named 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Le Pop'"} {"question": "What is the name and city of the airport that the most routes end at?\nAdditional table information: table: flight_4", "answer": "SELECT T1.name, T1.city, T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the names of customers who have once canceled the purchase of the product 'food' (the item status is 'Cancel').\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1, orders AS T2, order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = 'Cancel' AND T4.product_name = 'food' GROUP BY T1.customer_id HAVING COUNT(*) >= 1"} {"question": "What are the names of the courses that have exactly 1 student enrollment?\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1"} {"question": "how many programs are broadcast in each time section of the day?\nAdditional table information: table: program_share", "answer": "SELECT COUNT(*), time_of_day FROM broadcast GROUP BY time_of_day"} {"question": "Count the number of schools that have had basketball matches.\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(DISTINCT school_id) FROM basketball_match"} {"question": "Show first name and last name for all students.\nAdditional table information: table: allergy_1", "answer": "SELECT Fname, Lname FROM Student"} {"question": "How many faculty lines are there in 'San Francisco State University' in year 2004?\nAdditional table information: table: csu_1", "answer": "SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = 'San Francisco State University'"} {"question": "How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?\nAdditional table information: table: driving_school", "answer": "SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Rylan' AND T2.last_name = 'Goodwin'"} {"question": "Which products has been complained by the customer who has filed least amount of complaints?\nAdditional table information: table: customer_complaints", "answer": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id, customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Find the names of departments that are located in Houston.\nAdditional table information: table: company_1", "answer": "SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston'"} {"question": "Who are the ministers and what parties do they belong to, listed descending by the times they took office?\nAdditional table information: table: party_people", "answer": "SELECT minister, party_name FROM party ORDER BY took_office DESC"} {"question": "What are the names of all people who do not have friends?\nAdditional table information: table: network_2", "answer": "SELECT name FROM person EXCEPT SELECT name FROM PersonFriend"} {"question": "What are the names and capitals of each country?\nAdditional table information: table: match_season", "answer": "SELECT Country_name, Capital FROM country"} {"question": "What are the top 10 customers' first and last names by total number of orders and how many orders did they make?\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name, COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10"} {"question": "What is the total number of deaths and damage for all storms with a max speed greater than the average?\nAdditional table information: table: storm_record", "answer": "SELECT SUM(number_deaths), SUM(damage_millions_USD) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)"} {"question": "What are the total number of students who are living in a male dorm?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M'"} {"question": "How many credits does the department offer?\nAdditional table information: table: college_1", "answer": "SELECT SUM(crs_credit), dept_code FROM course GROUP BY dept_code"} {"question": "What are the names of all playlists that have more than 100 tracks?\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING COUNT(T1.track_id) > 100"} {"question": "How many rooms are located for each block code?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*), T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode"} {"question": "What are the names of projects that require more than 300 hours, and how many scientists are assigned to each?\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name"} {"question": "What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM song WHERE resolution > (SELECT MAX(resolution) FROM song WHERE rating < 8)"} {"question": "What is the name of the product with the color description 'yellow'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow'"} {"question": "What is the largest payment amount?\nAdditional table information: table: sakila_1", "answer": "SELECT amount FROM payment ORDER BY amount DESC LIMIT 1"} {"question": "What is the id and name of the employee with the highest salary?\nAdditional table information: table: flight_1", "answer": "SELECT eid, name FROM Employee ORDER BY salary DESC LIMIT 1"} {"question": "What is the id of the shortest trip?\nAdditional table information: table: bike_1", "answer": "SELECT id FROM trip ORDER BY duration NULLS FIRST LIMIT 1"} {"question": "Return the id and full name of the customer with the most accounts.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are all the role codes, role names, and role descriptions?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code, role_name, role_description FROM ROLES"} {"question": "Which employees do not destroy any document? Find their employee ids.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "How many dorms are there and what is the total capacity for each gender?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), SUM(student_capacity), gender FROM dorm GROUP BY gender"} {"question": "How many persons are not body builders?\nAdditional table information: table: body_builder", "answer": "SELECT COUNT(*) FROM people WHERE NOT people_id IN (SELECT People_ID FROM body_builder)"} {"question": "Show all artist names who didn't have an exhibition in 2004.\nAdditional table information: table: theme_gallery", "answer": "SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004"} {"question": "List the distinct carriers of phones with memories bigger than 32.\nAdditional table information: table: phone_market", "answer": "SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32"} {"question": "Find the employee id for all employees who earn more than the average salary.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)"} {"question": "Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate.\nAdditional table information: table: candidate_poll", "answer": "SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate NULLS FIRST"} {"question": "What is the minimum, maximum, and average market value for every company?\nAdditional table information: table: gas_company", "answer": "SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company"} {"question": "What is the incident type description for the incident type with code 'VIOLENCE'?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code = 'VIOLENCE'"} {"question": "How many scientists are there?\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*) FROM scientists"} {"question": "What instrument did the musician with last name 'Heilo' use in the song 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = 'Heilo' AND T3.title = 'Le Pop'"} {"question": "Find the names of stadiums that some Australian swimmers have been to.\nAdditional table information: table: swimming", "answer": "SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia'"} {"question": "Find the maximum and minimum settlement amount.\nAdditional table information: table: insurance_fnol", "answer": "SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements"} {"question": "display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a \u2019T\u2019.\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')"} {"question": "What are the carriers of devices that are in stock in more than a single shop?\nAdditional table information: table: device", "answer": "SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1"} {"question": "what is the phone number of employees whose salary is in the range of 8000 and 12000?\nAdditional table information: table: hr_1", "answer": "SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000"} {"question": "Find the distinct names of all races held between 2014 and 2017?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017"} {"question": "What is the name and salary of all employees in order of salary?\nAdditional table information: table: flight_1", "answer": "SELECT name, salary FROM Employee ORDER BY salary NULLS FIRST"} {"question": "Count the number of members in club 'Bootup Baltimore' whose age is above 18.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t3.age > 18"} {"question": "What are the names of counties that do not contain any cities?\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM county_public_safety WHERE NOT County_ID IN (SELECT County_ID FROM city)"} {"question": "What ranks do we have for faculty?\nAdditional table information: table: activity_1", "answer": "SELECT DISTINCT rank FROM Faculty"} {"question": "Show the delegate and committee information of elections.\nAdditional table information: table: election", "answer": "SELECT Delegate, Committee FROM election"} {"question": "What are the titles of courses that are offered in more than one department?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course GROUP BY title HAVING COUNT(*) > 1"} {"question": "What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.employee_name, T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id"} {"question": "Please show different types of artworks with the corresponding number of artworks of each type.\nAdditional table information: table: entertainment_awards", "answer": "SELECT TYPE, COUNT(*) FROM artwork GROUP BY TYPE"} {"question": "Count the number of cards the customer with the first name Art and last name Turcotte has.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Art' AND T2.customer_last_name = 'Turcotte'"} {"question": "What are the different first names and highest degree attained for professors teaching in the Computer Information Systems department?\nAdditional table information: table: college_1", "answer": "SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'"} {"question": "Show the number of male and female assistant professors.\nAdditional table information: table: activity_1", "answer": "SELECT sex, COUNT(*) FROM Faculty WHERE rank = 'AsstProf' GROUP BY sex"} {"question": "what are the employee ids and job titles for employees in department 80?\nAdditional table information: table: hr_1", "answer": "SELECT T1.employee_id, T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80"} {"question": "Give me a list of names and years of races that had any driver whose forename is Lewis?\nAdditional table information: table: formula_1", "answer": "SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = 'Lewis'"} {"question": "display the department name and number of employees in each of the department.\nAdditional table information: table: hr_1", "answer": "SELECT department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name"} {"question": "Give me the average prices of wines that are produced by appelations in Sonoma County.\nAdditional table information: table: wine_1", "answer": "SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma'"} {"question": "Find each student's first name.\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT fname FROM student"} {"question": "What are the names of all movies made before 1980 or had James Cameron as the director?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE director = 'James Cameron' OR YEAR < 1980"} {"question": "Find the number of classes in each department.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code"} {"question": "What are the different fates of the mission that involved ships from the United States?\nAdditional table information: table: ship_mission", "answer": "SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = 'United States'"} {"question": "What are each physician's employee id and department id primarily affiliated.\nAdditional table information: table: hospital_1", "answer": "SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1"} {"question": "Show the case burden of counties in descending order of population.\nAdditional table information: table: county_public_safety", "answer": "SELECT Case_burden FROM county_public_safety ORDER BY Population DESC"} {"question": "What is the average number of points for players from the 'AIB' club?\nAdditional table information: table: sports_competition", "answer": "SELECT AVG(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = 'AIB'"} {"question": "Count the number of products with the 'hot' charactersitic.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'hot'"} {"question": "What is the attribute data type of the attribute with name 'Green'?\nAdditional table information: table: product_catalog", "answer": "SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = 'Green'"} {"question": "Show names of technicians who are assigned to repair machines with value point more than 70.\nAdditional table information: table: machine_repair", "answer": "SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70"} {"question": "Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?\nAdditional table information: table: department_management", "answer": "SELECT T1.name, T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = 'Yes'"} {"question": "Count the number of different film ratings.\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(DISTINCT rating) FROM film"} {"question": "How many songs have vocals of type lead?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = 'lead'"} {"question": "How many products have a price higher than the average?\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT COUNT(*) FROM products WHERE product_price > (SELECT AVG(product_price) FROM products)"} {"question": "List the method, date and amount of all the payments, in ascending order of date.\nAdditional table information: table: insurance_policies", "answer": "SELECT Payment_Method_Code, Date_Payment_Made, Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC NULLS FIRST"} {"question": "What is the name of department where has the largest number of professors with a Ph.D. degree?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show aircraft names and number of flights for each aircraft.\nAdditional table information: table: flight_1", "answer": "SELECT T2.name, COUNT(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid"} {"question": "List all the distinct president votes and the vice president votes.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD"} {"question": "What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names.\nAdditional table information: table: allergy_1", "answer": "SELECT T1.Allergy, T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = 'Lisa' ORDER BY T1.Allergy NULLS FIRST"} {"question": "Find the number of routes for each source airport and the airport name.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name"} {"question": "what are the last names of the teachers who teach grade 5?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5"} {"question": "Find all the policy types that are used by more than 2 customers.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING COUNT(*) > 2"} {"question": "What is the number of airports per country, ordered from most to least?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC"} {"question": "Which part fault requires the most number of skills to fix? List part id and name.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.part_id, T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id = T3.part_fault_id GROUP BY T1.part_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the number of documents that do not have expenses.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses)"} {"question": "What is the transaction type that has processed the greatest total amount in transactions?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC LIMIT 1"} {"question": "What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students?\nAdditional table information: table: college_2", "answer": "SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100"} {"question": "How many journalists are there?\nAdditional table information: table: news_report", "answer": "SELECT COUNT(*) FROM journalist"} {"question": "What is the name and distance for aircraft with id 12?\nAdditional table information: table: flight_1", "answer": "SELECT name, distance FROM Aircraft WHERE aid = 12"} {"question": "Find the number of distinct projects.\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(DISTINCT name) FROM projects"} {"question": "What are the names of the different banks that have provided loans?\nAdditional table information: table: loan_1", "answer": "SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id"} {"question": "What are the ids of the courses that are registered or attended by the student whose id is 121?\nAdditional table information: table: student_assessment", "answer": "SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121"} {"question": "What are the distinct move in dates of the residents?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT DISTINCT date_moved_in FROM residents"} {"question": "Report the first name and last name of all the teachers.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT firstname, lastname FROM teachers"} {"question": "What is the average age of all artists?\nAdditional table information: table: music_4", "answer": "SELECT AVG(Age) FROM artist"} {"question": "What are the lifespans of representatives in descending order of vote percent?\nAdditional table information: table: election_representative", "answer": "SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC"} {"question": "Show card number, name, and hometown for all members in a descending order of level.\nAdditional table information: table: shop_membership", "answer": "SELECT card_number, name, hometown FROM member ORDER BY LEVEL DESC"} {"question": "What is the status of the city that has hosted the most competitions?\nAdditional table information: table: farm", "answer": "SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of students taught by TARRING LEIA.\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'TARRING' AND T2.lastname = 'LEIA'"} {"question": "Show project ids and the number of documents in each project.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id"} {"question": "What is the last name of the musician that have produced the most songs?\nAdditional table information: table: music_2", "answer": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many stadiums are there?\nAdditional table information: table: swimming", "answer": "SELECT COUNT(*) FROM stadium"} {"question": "Which apartments have unit status availability of both 0 and 1? Return their apartment numbers.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1"} {"question": "List all the log ids and their descriptions from the problem logs.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_log_id, log_entry_description FROM problem_log"} {"question": "Count the number of party events.\nAdditional table information: table: party_people", "answer": "SELECT COUNT(*) FROM party_events"} {"question": "Find the author who achieved the highest score in a submission.\nAdditional table information: table: workshop_paper", "answer": "SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1"} {"question": "What are the name and code of the location with the smallest number of documents?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.location_name, T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "How many schools are there?\nAdditional table information: table: school_finance", "answer": "SELECT COUNT(*) FROM school"} {"question": "Sort the each workshop in alphabetical order of the venue. Return the date and venue of each workshop.\nAdditional table information: table: workshop_paper", "answer": "SELECT Date, Venue FROM workshop ORDER BY Venue NULLS FIRST"} {"question": "What are the nations that have more than two ships?\nAdditional table information: table: ship_mission", "answer": "SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2"} {"question": "What are the usernames and passwords of users that have the most common role?\nAdditional table information: table: document_management", "answer": "SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the locations of schools in ascending order of enrollment.\nAdditional table information: table: school_player", "answer": "SELECT LOCATION FROM school ORDER BY Enrollment ASC NULLS FIRST"} {"question": "Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.\nAdditional table information: table: phone_market", "answer": "SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64"} {"question": "Find all the stores in the district with the most population.\nAdditional table information: table: store_product", "answer": "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)"} {"question": "Show the name, average attendance, total attendance for stadiums where no accidents happened.\nAdditional table information: table: game_injury", "answer": "SELECT name, average_attendance, total_attendance FROM stadium EXCEPT SELECT T2.name, T2.average_attendance, T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id"} {"question": "What are the names of all races that occurred after 12:00:00 or before 09:00:00?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM races WHERE TIME > '12:00:00' OR TIME < '09:00:00'"} {"question": "How many albums are there?\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM ALBUM"} {"question": "What are the distinct nominees of the musicals with the award that is not 'Tony Award'?\nAdditional table information: table: musical", "answer": "SELECT DISTINCT Nominee FROM musical WHERE Award <> 'Tony Award'"} {"question": "Find the id and first name of the student that has the most number of assessment notes?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.student_id, T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the ids of all students who don't play sports?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo"} {"question": "Find the list of page size which have more than 3 product listed\nAdditional table information: table: store_product", "answer": "SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3"} {"question": "Return the names of people, ordered alphabetically.\nAdditional table information: table: gymnast", "answer": "SELECT Name FROM People ORDER BY Name ASC NULLS FIRST"} {"question": "What are the countries for each market ordered by decreasing number of cities?\nAdditional table information: table: film_rank", "answer": "SELECT Country FROM market ORDER BY Number_cities DESC"} {"question": "Find the entry names of the catalog with the attribute that have the most entries.\nAdditional table information: table: product_catalog", "answer": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "Which reign is the most common among wrestlers?\nAdditional table information: table: wrestler", "answer": "SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the product name and total order quantity for each product.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT T1.product_name, SUM(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id"} {"question": "How many distinct students have been in detention?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT COUNT(DISTINCT student_id) FROM Students_in_Detention"} {"question": "What are the full names and ages for all female students whose sex is F?\nAdditional table information: table: allergy_1", "answer": "SELECT Fname, Lname, Age FROM Student WHERE Sex = 'F'"} {"question": "Which building does the instructor who teaches the most number of courses live in?\nAdditional table information: table: college_3", "answer": "SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the information of all instructors ordered by their salary in ascending order.\nAdditional table information: table: college_2", "answer": "SELECT * FROM instructor ORDER BY salary NULLS FIRST"} {"question": "Find the names of schools that have some players in the mid position but not in the goalie position.\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'"} {"question": "Show the transaction type descriptions and dates if the share count is smaller than 10.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T1.transaction_type_description, T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10"} {"question": "Find the number of different product types.\nAdditional table information: table: department_store", "answer": "SELECT COUNT(DISTINCT product_type_code) FROM products"} {"question": "What are the total amount of money in the invoices billed from Chicago, Illinois?\nAdditional table information: table: store_1", "answer": "SELECT SUM(total) FROM invoices WHERE billing_city = 'Chicago' AND billing_state = 'IL'"} {"question": "What are the ids of documents with the type code CV that do not have expenses.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_id FROM Documents WHERE document_type_code = 'CV' EXCEPT SELECT document_id FROM Documents_with_expenses"} {"question": "What are the names of candidates who have a lower support rate than oppose rate?\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate"} {"question": "Find the names of patients who are not using the medication of Procrastin-X.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient = T1.SSN JOIN Medication AS T3 ON T2.Medication = T3.Code WHERE T3.name = 'Procrastin-X'"} {"question": "List the names of aircrafts and that did not win any match.\nAdditional table information: table: aircraft", "answer": "SELECT Aircraft FROM aircraft WHERE NOT Aircraft_ID IN (SELECT Winning_Aircraft FROM MATCH)"} {"question": "What is the names of movies whose created year is after all movies directed by Steven Spielberg?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE YEAR > (SELECT MAX(YEAR) FROM Movie WHERE director = 'Steven Spielberg')"} {"question": "How many trains have 'Express' in their names?\nAdditional table information: table: station_weather", "answer": "SELECT COUNT(*) FROM train WHERE name LIKE '%Express%'"} {"question": "Find the name, checking balance and savings balance of all accounts in the bank sorted by their total checking and savings balance in descending order.\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance DESC"} {"question": "How many wines are there for each grape?\nAdditional table information: table: wine_1", "answer": "SELECT COUNT(*), Grape FROM WINE GROUP BY Grape"} {"question": "Find the schools that were either founded after 1850 or public.\nAdditional table information: table: university_basketball", "answer": "SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'"} {"question": "What are the names of colleges that have two or more players, listed in descending alphabetical order?\nAdditional table information: table: match_season", "answer": "SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC"} {"question": "How many states that have some college students playing in the mid position but not in the goalie position.\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')"} {"question": "Find the student first and last names and grade points of all enrollments.\nAdditional table information: table: college_3", "answer": "SELECT T3.Fname, T3.LName, T2.gradepoint FROM ENROLLED_IN AS T1, GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID"} {"question": "How many products are not made by Sony?\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T2.name = 'Sony')"} {"question": "Who are the nominees who were nominated for either of the Bob Fosse or Cleavant Derricks awards?\nAdditional table information: table: musical", "answer": "SELECT Nominee FROM musical WHERE Award = 'Tony Award' OR Award = 'Cleavant Derricks'"} {"question": "What is the first name of the author with last name 'Ueno'?\nAdditional table information: table: icfp_1", "answer": "SELECT fname FROM authors WHERE lname = 'Ueno'"} {"question": "What are the ages of the gymnasts, ordered descending by their total points?\nAdditional table information: table: gymnast", "answer": "SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC"} {"question": "Which city has the least number of customers whose type code is 'Good Credit Rating'?\nAdditional table information: table: customer_complaints", "answer": "SELECT town_city FROM customers WHERE customer_type_code = 'Good Credit Rating' GROUP BY town_city ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Find out the first name and last name of staff lived in city Damianfort.\nAdditional table information: table: driving_school", "answer": "SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = 'Damianfort'"} {"question": "Show the name of storms which don't have affected region in record.\nAdditional table information: table: storm_record", "answer": "SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region)"} {"question": "List the name and count of each product in all orders.\nAdditional table information: table: tracking_orders", "answer": "SELECT T3.product_name, COUNT(*) FROM orders AS T1, order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id"} {"question": "List all the distinct product names ordered by product id?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT DISTINCT product_name FROM product ORDER BY product_id NULLS FIRST"} {"question": "Which party had the most hosts? Give me the party location.\nAdditional table information: table: party_host", "answer": "SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1"} {"question": "Show the customer name, customer address city, date from, and date to for each customer address history.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id"} {"question": "Compute the average age of the members in the club 'Tennis Club'.\nAdditional table information: table: club_1", "answer": "SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'"} {"question": "Show the location name for document 'Robin CV'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = 'Robin CV'"} {"question": "List the most common type of competition.\nAdditional table information: table: sports_competition", "answer": "SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all teams?\nAdditional table information: table: match_season", "answer": "SELECT Name FROM Team"} {"question": "which countries did participated in both Friendly and Tournament type competitions.\nAdditional table information: table: sports_competition", "answer": "SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'"} {"question": "What are the names of body builders in descending order of total scores?\nAdditional table information: table: body_builder", "answer": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC"} {"question": "Show all date and share count of transactions.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT date_of_transaction, share_count FROM TRANSACTIONS"} {"question": "Return the average, maximum, and minimum budgets in millions for movies made before the year 2000.\nAdditional table information: table: culture_company", "answer": "SELECT AVG(budget_million), MAX(budget_million), MIN(budget_million) FROM movie WHERE YEAR < 2000"} {"question": "How many rooms have a king bed?\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM Rooms WHERE bedType = 'King'"} {"question": "Find all invoice dates corresponding to customers with first name Astrid and last name Gruber.\nAdditional table information: table: chinook_1", "answer": "SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = 'Astrid' AND LastName = 'Gruber'"} {"question": "Return all detention summaries.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT detention_summary FROM Detention"} {"question": "Who has friends that are younger than the average age?\nAdditional table information: table: network_2", "answer": "SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person)"} {"question": "What is the address of the location 'UK Gallery'?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Address FROM LOCATIONS WHERE Location_Name = 'UK Gallery'"} {"question": "How many gold medals has the club with the most coaches won?\nAdditional table information: table: riding_club", "answer": "SELECT T1.club_id, T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the name of players whose card is yes in the descending order of training hours.\nAdditional table information: table: soccer_2", "answer": "SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC"} {"question": "How many artists are from Bangladesh?\nAdditional table information: table: music_1", "answer": "SELECT COUNT(*) FROM artist WHERE country = 'Bangladesh'"} {"question": "How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n\nAdditional table information: table: local_govt_mdm", "answer": "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"} {"question": "What are the names of races held between 2009 and 2011?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011"} {"question": "Find the name of the swimmer who has at least 2 records.\nAdditional table information: table: swimming", "answer": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING COUNT(*) >= 2"} {"question": "How many lessons were in cancelled state?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = 'Cancelled'"} {"question": "How many accounts are there in total?\nAdditional table information: table: small_bank_1", "answer": "SELECT COUNT(*) FROM accounts"} {"question": "How many colors are never used by any product?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)"} {"question": "Show different nationalities along with the number of hosts of each nationality.\nAdditional table information: table: party_host", "answer": "SELECT Nationality, COUNT(*) FROM HOST GROUP BY Nationality"} {"question": "Find the number of students who are older than 18 and do not have allergy to either food or animal.\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student WHERE age > 18 AND NOT StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'food' OR T2.allergytype = 'animal')"} {"question": "Find distinct cities of address of students?\nAdditional table information: table: student_assessment", "answer": "SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id"} {"question": "When was the first asset acquired?\nAdditional table information: table: assets_maintenance", "answer": "SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date ASC NULLS FIRST LIMIT 1"} {"question": "List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.\nAdditional table information: table: browser_web", "answer": "SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox'"} {"question": "Display all the information about the department Marketing.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM departments WHERE department_name = 'Marketing'"} {"question": "What are all the different start station names for a trip that lasted less than 100?\nAdditional table information: table: bike_1", "answer": "SELECT DISTINCT start_station_name FROM trip WHERE duration < 100"} {"question": "Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000\nAdditional table information: table: school_finance", "answer": "SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001"} {"question": "Return the titles and directors of films that were never in the market of China.\nAdditional table information: table: film_rank", "answer": "SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')"} {"question": "the names of models that launched between 2002 and 2004.\nAdditional table information: table: phone_1", "answer": "SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004"} {"question": "How many games are held after season 2007?\nAdditional table information: table: game_injury", "answer": "SELECT COUNT(*) FROM game WHERE season > 2007"} {"question": "Which students not enrolled in any course? Find their personal names.\nAdditional table information: table: e_learning", "answer": "SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id"} {"question": "How many products are in the 'Spices' category and have a typical price of over 1000?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products WHERE product_category_code = 'Spices' AND typical_buying_price > 1000"} {"question": "What are the ids of the students who registered for some courses but had the least number of courses for all students?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Show headquarters with at least two companies in the banking industry.\nAdditional table information: table: gas_company", "answer": "SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2"} {"question": "What is the average and total capacity for all dorms who are of gender X?\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'"} {"question": "How many customers are there?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Customers"} {"question": "Show all flight number from Los Angeles.\nAdditional table information: table: flight_1", "answer": "SELECT flno FROM Flight WHERE origin = 'Los Angeles'"} {"question": "Which events have the number of notes between one and three? List the event id and the property id.\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT T1.Customer_Event_ID, T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING COUNT(*) BETWEEN 1 AND 3"} {"question": "Give the ids and names of products with price lower than 600 or higher than 900.\nAdditional table information: table: department_store", "answer": "SELECT product_id, product_name FROM products WHERE product_price < 600 OR product_price > 900"} {"question": "Who is the director of movie Avatar?\nAdditional table information: table: movie_1", "answer": "SELECT director FROM Movie WHERE title = 'Avatar'"} {"question": "How many courses does the department of Computer Information Systmes offer?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = 'Computer Info. Systems'"} {"question": "List all names of courses with 1 credit?\nAdditional table information: table: college_3", "answer": "SELECT CName FROM COURSE WHERE Credits = 1"} {"question": "Which company was started by the entrepreneur with the greatest height?\nAdditional table information: table: entrepreneur", "answer": "SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1"} {"question": "Return the description for the courses named 'database'.\nAdditional table information: table: e_learning", "answer": "SELECT course_description FROM COURSES WHERE course_name = 'database'"} {"question": "Show the distinct names of mountains climbed by climbers from country 'West Germany'.\nAdditional table information: table: climbing", "answer": "SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = 'West Germany'"} {"question": "Show the names of journalists from 'England' or 'Wales'.\nAdditional table information: table: news_report", "answer": "SELECT Name FROM journalist WHERE Nationality = 'England' OR Nationality = 'Wales'"} {"question": "Show all allergy types and the number of allergies in each type.\nAdditional table information: table: allergy_1", "answer": "SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype"} {"question": "Find the entry name of the catalog with the highest price (in USD).\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1"} {"question": "Show the flight number and distance of the flight with maximum price.\nAdditional table information: table: flight_1", "answer": "SELECT flno, distance FROM Flight ORDER BY price DESC LIMIT 1"} {"question": "What are all locations of train stations?\nAdditional table information: table: train_station", "answer": "SELECT DISTINCT LOCATION FROM station"} {"question": "What are the date of ceremony of music festivals with category 'Best Song' and result 'Awarded'?\nAdditional table information: table: music_4", "answer": "SELECT Date_of_ceremony FROM music_festival WHERE Category = 'Best Song' AND RESULT = 'Awarded'"} {"question": "What is the average ROM size of phones produced by the company named 'Nokia Corporation'?\nAdditional table information: table: phone_1", "answer": "SELECT AVG(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = 'Nokia Corporation'"} {"question": "What are the invoice numbers created before 1989-09-03 or after 2007-12-25?\nAdditional table information: table: tracking_orders", "answer": "SELECT invoice_number FROM invoices WHERE invoice_date < '1989-09-03' OR invoice_date > '2007-12-25'"} {"question": "Show the draft pick numbers and draft classes of players whose positions are defenders.\nAdditional table information: table: match_season", "answer": "SELECT Draft_Pick_Number, Draft_Class FROM match_season WHERE POSITION = 'Defender'"} {"question": "How many editors are there?\nAdditional table information: table: journal_committee", "answer": "SELECT COUNT(*) FROM editor"} {"question": "In how many cities are there airports in the country of Greenland?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland'"} {"question": "What are the names of races held after 12:00:00 or before 09:00:00?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM races WHERE TIME > '12:00:00' OR TIME < '09:00:00'"} {"question": "List the date of perpetrators in descending order of the number of people killed.\nAdditional table information: table: perpetrator", "answer": "SELECT Date FROM perpetrator ORDER BY Killed DESC"} {"question": "Count the number of distinct artists who have volumes.\nAdditional table information: table: music_4", "answer": "SELECT COUNT(DISTINCT Artist_ID) FROM volume"} {"question": "What is the list of program origins ordered alphabetically?\nAdditional table information: table: program_share", "answer": "SELECT origin FROM program ORDER BY origin NULLS FIRST"} {"question": "Find the name and nationality of the swimmer who has won (i.e., has a result of 'win') more than 1 time.\nAdditional table information: table: swimming", "answer": "SELECT t1.name, t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' GROUP BY t2.swimmer_id HAVING COUNT(*) > 1"} {"question": "Which room has the largest number of reservations?\nAdditional table information: table: inn_1", "answer": "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"} {"question": "What is the name of the department and office location for the professor with the last name of Heffington?\nAdditional table information: table: college_1", "answer": "SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'"} {"question": "Find the number of users who posted some tweets.\nAdditional table information: table: twitter_1", "answer": "SELECT COUNT(DISTINCT UID) FROM tweets"} {"question": "Find the name of the students and their department names sorted by their total credits in ascending order.\nAdditional table information: table: college_2", "answer": "SELECT name, dept_name FROM student ORDER BY tot_cred NULLS FIRST"} {"question": "Which police forces operate in both counties that are located in the East and in the West?\nAdditional table information: table: county_public_safety", "answer": "SELECT Police_force FROM county_public_safety WHERE LOCATION = 'East' INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = 'West'"} {"question": "Find the full names of employees living in the city of Calgary.\nAdditional table information: table: chinook_1", "answer": "SELECT FirstName, LastName FROM EMPLOYEE WHERE City = 'Calgary'"} {"question": "Which 3 wineries produce the most wines made from white grapes?\nAdditional table information: table: wine_1", "answer": "SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = 'White' GROUP BY T2.Winery ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Return all the distinct payment methods used by customers.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT DISTINCT payment_method FROM customers"} {"question": "Find the state, account type, and credit score of the customer whose number of loan is 0.\nAdditional table information: table: loan_1", "answer": "SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0"} {"question": "What is the gender and name of the artist who sang the song with the smallest resolution?\nAdditional table information: table: music_1", "answer": "SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution NULLS FIRST LIMIT 1"} {"question": "Show the id of the employee named Ebba.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_ID FROM Employees WHERE employee_name = 'Ebba'"} {"question": "Count the total number of clubs.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club"} {"question": "What is the name and date of the race that occurred most recently?\nAdditional table information: table: formula_1", "answer": "SELECT name, date FROM races ORDER BY date DESC LIMIT 1"} {"question": "When was the school with the largest enrollment founded?\nAdditional table information: table: university_basketball", "answer": "SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1"} {"question": "Find names of the document without any images.\nAdditional table information: table: document_management", "answer": "SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id"} {"question": "What are the names of enzymes in descending order?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name FROM enzyme ORDER BY name DESC"} {"question": "What are the distinct names and nationalities of the architects who have ever built a mill?\nAdditional table information: table: architecture", "answer": "SELECT DISTINCT T1.name, T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id = T2.architect_id"} {"question": "Give the distinct department ids of departments in which a manager is in charge of 4 or more employees?\nAdditional table information: table: hr_1", "answer": "SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4"} {"question": "Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)"} {"question": "What are the ids of all stations that have a latitude above 37.4 and have never had less than 7 bikes available?\nAdditional table information: table: bike_1", "answer": "SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING MIN(bikes_available) < 7"} {"question": "List the names of the schools without any endowment.\nAdditional table information: table: school_finance", "answer": "SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment)"} {"question": "Show all book categories and the number of books in each category.\nAdditional table information: table: culture_company", "answer": "SELECT category, COUNT(*) FROM book_club GROUP BY category"} {"question": "What are the names of all the dorms that don't have any amenities?\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity)"} {"question": "find the number of players whose points are lower than 30 in each position.\nAdditional table information: table: sports_competition", "answer": "SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION"} {"question": "What is the name of the perpetrator with the biggest weight.\nAdditional table information: table: perpetrator", "answer": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1"} {"question": "Which flag is most widely used among all ships?\nAdditional table information: table: ship_1", "answer": "SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which organisation type hires most research staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many calendar items do we have?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM Ref_calendar"} {"question": "How many captains are in each rank?\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(*), rank FROM captain GROUP BY rank"} {"question": "list in alphabetic order all course names and their instructors' names in year 2008.\nAdditional table information: table: college_2", "answer": "SELECT T1.title, T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title NULLS FIRST"} {"question": "List all the activities we have.\nAdditional table information: table: activity_1", "answer": "SELECT activity_name FROM Activity"} {"question": "What is the id and name of the enzyme that can interact with the most medicines as an activator?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the different names and ages of every friend of either Dan or alice?\nAdditional table information: table: network_2", "answer": "SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'"} {"question": "Sort all the rooms according to the price. Just report the room names.\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms ORDER BY basePrice NULLS FIRST"} {"question": "Find the the customer details and id for the customers who had more than one policy.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 1"} {"question": "What is the number of artists for each gender?\nAdditional table information: table: music_1", "answer": "SELECT COUNT(*), gender FROM artist GROUP BY gender"} {"question": "Return the hispanic percentage for cities in which the black percentage is greater than 10.\nAdditional table information: table: county_public_safety", "answer": "SELECT Hispanic FROM city WHERE Black > 10"} {"question": "Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Sales Person' EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Clerical Staff'"} {"question": "What are the codes and names of the cheapest products in each category?\nAdditional table information: table: manufactory_1", "answer": "SELECT code, name, MIN(price) FROM products GROUP BY name"} {"question": "List the number of invoices and the invoice total from California.\nAdditional table information: table: store_1", "answer": "SELECT billing_state, COUNT(*), SUM(total) FROM invoices WHERE billing_state = 'CA'"} {"question": "Find the tourist attractions that have parking or shopping as their feature details. What are the names of the attractions?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping'"} {"question": "What are the countries for each market, ordered alphabetically?\nAdditional table information: table: film_rank", "answer": "SELECT Country FROM market ORDER BY Country ASC NULLS FIRST"} {"question": "Return the average and minimum ages across artists from the United States.\nAdditional table information: table: theme_gallery", "answer": "SELECT AVG(age), MIN(age) FROM artist WHERE country = 'United States'"} {"question": "What are the distinct last names of the students who have president votes and have 8741 as the advisor?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = '8741'"} {"question": "List the first and last name for players who participated in all star game in 1998.\nAdditional table information: table: baseball_1", "answer": "SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998"} {"question": "Show the account name and other account detail for all accounts by the customer with first name Meaghan and last name Keeling.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.account_name, T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' AND T2.customer_last_name = 'Keeling'"} {"question": "How many stadiums are not in country 'Russia'?\nAdditional table information: table: swimming", "answer": "SELECT COUNT(*) FROM stadium WHERE country <> 'Russia'"} {"question": "How many players are from each country?\nAdditional table information: table: match_season", "answer": "SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name"} {"question": "Find the number of followers for each user.\nAdditional table information: table: twitter_1", "answer": "SELECT COUNT(*) FROM follows GROUP BY f1"} {"question": "Show the country where people older than 30 and younger than 25 are from.\nAdditional table information: table: wedding", "answer": "SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30"} {"question": "Select the code of the product that is cheapest in each product category.\nAdditional table information: table: manufactory_1", "answer": "SELECT code, name, MIN(price) FROM products GROUP BY name"} {"question": "List the names of representatives that have not participated in elections listed here.\nAdditional table information: table: election_representative", "answer": "SELECT Name FROM representative WHERE NOT Representative_ID IN (SELECT Representative_ID FROM election)"} {"question": "List every album's title.\nAdditional table information: table: store_1", "answer": "SELECT title FROM albums"} {"question": "Find the name of the stadium that has the maximum capacity.\nAdditional table information: table: swimming", "answer": "SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1"} {"question": "What is the zip code that has the lowest average mean sea level pressure?\nAdditional table information: table: bike_1", "answer": "SELECT zip_code FROM weather GROUP BY zip_code ORDER BY AVG(mean_sea_level_pressure_inches) NULLS FIRST LIMIT 1"} {"question": "What are all the employees without a department number?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE department_id = 'null'"} {"question": "Find the last name of the latest contact individual of the organization 'Labour Party'.\nAdditional table information: table: e_government", "answer": "SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = 'Labour Party' ORDER BY t2.date_contact_to DESC LIMIT 1"} {"question": "Count the number of characteristics the product 'sesame' has.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = 'sesame'"} {"question": "How many distinct parties are there for representatives?\nAdditional table information: table: election_representative", "answer": "SELECT COUNT(DISTINCT Party) FROM representative"} {"question": "How many diffrent dorm amenities are there?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM dorm_amenity"} {"question": "Find the name and hours of project that has the most number of scientists.\nAdditional table information: table: scientist_1", "answer": "SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names and cities of the branches that do not have any registered members?\nAdditional table information: table: shop_membership", "answer": "SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch)"} {"question": "What are the names, address roads, and cities of the branches ordered by opening year?\nAdditional table information: table: shop_membership", "answer": "SELECT name, address_road, city FROM branch ORDER BY open_year NULLS FIRST"} {"question": "Show me the owner of the channel with the highest rating.\nAdditional table information: table: program_share", "answer": "SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1"} {"question": "what is the GDP of the city with the largest population.\nAdditional table information: table: city_record", "answer": "SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1"} {"question": "List the organisation id with the maximum outcome count, and the count.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the album titles for albums containing both 'Reggae' and 'Rock' genre tracks?\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Reggae' INTERSECT SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Rock'"} {"question": "Give the names of wrestlers and their elimination moves.\nAdditional table information: table: wrestler", "answer": "SELECT T2.Name, T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID"} {"question": "Show the people that have been comptroller the most times and the corresponding number of times.\nAdditional table information: table: election", "answer": "SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many students are older than average for each gender?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex"} {"question": "What are the headquarters and industries of all companies?\nAdditional table information: table: company_employee", "answer": "SELECT Headquarters, Industry FROM company"} {"question": "Show all artist name, age, and country ordered by the yeared they joined.\nAdditional table information: table: theme_gallery", "answer": "SELECT name, age, country FROM artist ORDER BY Year_Join NULLS FIRST"} {"question": "What are the names of the different customers who have taken out a loan, ordered by the total amount that they have taken?\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) NULLS FIRST"} {"question": "What are the names, details and data types of the characteristics which are never used by any product?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id"} {"question": "What are the names of the three artists who have produced the most songs, and how many works did they produce?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What are the different grant amounts for documents sent before '1986-08-26 20:49:27' and after the grant ended on '1989-03-16 18:27:16'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16'"} {"question": "Find the total amount of loans offered by each bank branch.\nAdditional table information: table: loan_1", "answer": "SELECT SUM(amount), T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname"} {"question": "What are the names of the five oldest people?\nAdditional table information: table: gymnast", "answer": "SELECT Name FROM People ORDER BY Age DESC LIMIT 5"} {"question": "List the object number of railways that do not have any trains.\nAdditional table information: table: railway", "answer": "SELECT ObjectNumber FROM railway WHERE NOT Railway_ID IN (SELECT Railway_ID FROM train)"} {"question": "What is the total amount of grant money for research?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT SUM(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research'"} {"question": "Find the name and id of the team that won the most times in 2008 postseason.\nAdditional table information: table: baseball_1", "answer": "SELECT T2.name, T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many different types of rooms are there?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(DISTINCT roomtype) FROM room"} {"question": "What is the id, first name, and last name of the driver who was in the first position for laptime at least twice?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2"} {"question": "How many songs, on average, are sung by a female artist?\nAdditional table information: table: music_1", "answer": "SELECT AVG(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = 'Female'"} {"question": "Which college have both players with position midfielder and players with position defender?\nAdditional table information: table: match_season", "answer": "SELECT College FROM match_season WHERE POSITION = 'Midfielder' INTERSECT SELECT College FROM match_season WHERE POSITION = 'Defender'"} {"question": "Give me the names and prices of furnitures which some companies are manufacturing.\nAdditional table information: table: manufacturer", "answer": "SELECT t1.name, t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID"} {"question": "Please list the age and famous title of artists in descending order of age.\nAdditional table information: table: music_4", "answer": "SELECT Famous_Title, Age FROM artist ORDER BY Age DESC"} {"question": "Show the distinct countries of managers.\nAdditional table information: table: railway", "answer": "SELECT DISTINCT Country FROM manager"} {"question": "What is the party of the representative that has the smallest number of votes.\nAdditional table information: table: election_representative", "answer": "SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC NULLS FIRST LIMIT 1"} {"question": "Find the number of stores in each city.\nAdditional table information: table: store_product", "answer": "SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city"} {"question": "How many people are older than every engineer?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer')"} {"question": "How many exhibitions has each artist had?\nAdditional table information: table: theme_gallery", "answer": "SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id"} {"question": "Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.\nAdditional table information: table: inn_1", "answer": "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"} {"question": "Return the average number of weeks on top for volumes by artists that are at most 25 years old.\nAdditional table information: table: music_4", "answer": "SELECT AVG(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25"} {"question": "What are the names of the products that have a color description of 'red' and the 'fast' characteristic?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'fast'"} {"question": "List the number of people injured by perpetrators in ascending order.\nAdditional table information: table: perpetrator", "answer": "SELECT Injured FROM perpetrator ORDER BY Injured ASC NULLS FIRST"} {"question": "Give the phone and postal code corresponding to the address '1031 Daugavpils Parkway'.\nAdditional table information: table: sakila_1", "answer": "SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'"} {"question": "What are the names of perpetrators?\nAdditional table information: table: perpetrator", "answer": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID"} {"question": "Which submission received the highest score in acceptance result. Show me the result.\nAdditional table information: table: workshop_paper", "answer": "SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1"} {"question": "Find the titles of items that received both a rating higher than 8 and a rating below 5.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5"} {"question": "What is the full name of each student who is not allergic to any type of food.\nAdditional table information: table: allergy_1", "answer": "SELECT fname, lname FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'food')"} {"question": "List the project details of the projects with the research outcome described with the substring 'Published'.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'"} {"question": "How many rooms does the Lamberton building have?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'"} {"question": "Find the year and semester when offers the largest number of courses.\nAdditional table information: table: college_2", "answer": "SELECT semester, YEAR FROM SECTION GROUP BY semester, YEAR ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.\nAdditional table information: table: climbing", "answer": "SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200"} {"question": "What are all the different book publishers?\nAdditional table information: table: culture_company", "answer": "SELECT DISTINCT publisher FROM book_club"} {"question": "What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters?\nAdditional table information: table: architecture", "answer": "SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id JOIN bridge AS T3 ON T3.architect_id = T2.id WHERE T3.length_meters > 80"} {"question": "What are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009?\nAdditional table information: table: theme_gallery", "answer": "SELECT AVG(ticket_price), MIN(ticket_price), MAX(ticket_price) FROM exhibition WHERE YEAR < 2009"} {"question": "What degrees were conferred in San Francisco State University in the year 2001?\nAdditional table information: table: csu_1", "answer": "SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Francisco State University' AND t2.year = 2001"} {"question": "List the names of all distinct wines ordered by price.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Name FROM WINE ORDER BY price NULLS FIRST"} {"question": "How many gymnasts are there?\nAdditional table information: table: gymnast", "answer": "SELECT COUNT(*) FROM gymnast"} {"question": "Hom many musicians performed in the song 'Flash'?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = 'Flash'"} {"question": "Which cmi cross reference id is not related to any parking taxes?\nAdditional table information: table: local_govt_mdm", "answer": "SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines"} {"question": "Find the team that attended the least number of home games in 1980.\nAdditional table information: table: baseball_1", "answer": "SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance ASC NULLS FIRST LIMIT 1"} {"question": "How many assets does each third party company supply? List the count and the company id.\nAdditional table information: table: assets_maintenance", "answer": "SELECT COUNT(*), T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id"} {"question": "What is minimum hours of the students playing in different position?\nAdditional table information: table: soccer_2", "answer": "SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos"} {"question": "how many times is the model ge40lfr? \nAdditional table information: table: \"vehicles\".\"cars\"\ncolumns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion", "answer": "SELECT COUNT manufacturer FROM \"vehicles\".\"cars\" WHERE model = 'GE40LFR'"} {"question": "List all cities of addresses in alphabetical order.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT city FROM Addresses ORDER BY city NULLS FIRST"} {"question": "What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?\nAdditional table information: table: formula_1", "answer": "SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'"} {"question": "What are the balances of checking accounts belonging to people with savings balances greater than the average savings balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM savings))"} {"question": "Give the details of the project with the document name 'King Book'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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'"} {"question": "How many different departments are there in each school that has less than 5 apartments?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code HAVING COUNT(DISTINCT dept_name) < 5"} {"question": "Show the names of counties that have at least two delegates.\nAdditional table information: table: election", "answer": "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"} {"question": "What is the name of the customer who has greatest total loan amount?\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1"} {"question": "What is the count of different game types?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(DISTINCT gtype) FROM Video_games"} {"question": "Find the country that the most papers are affiliated with.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Give the state corresponding to the line number building '6862 Kaitlyn Knolls'.\nAdditional table information: table: e_government", "answer": "SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE '%6862 Kaitlyn Knolls%'"} {"question": "Which city is the headquarter of the store named 'Blackville' in?\nAdditional table information: table: store_product", "answer": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = 'Blackville'"} {"question": "How many different instructors have taught some course?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT id) FROM teaches"} {"question": "What are the id of students who registered course 301?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_attendance WHERE course_id = 301"} {"question": "Give the names of wines with prices above any wine produced in 2006.\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006)"} {"question": "Sort all the distinct products in alphabetical order.\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT product_name FROM products ORDER BY product_name NULLS FIRST"} {"question": "List the major of each male student.\nAdditional table information: table: voter_2", "answer": "SELECT Major FROM STUDENT WHERE Sex = 'M'"} {"question": "Show member names that are not in the Progress Party.\nAdditional table information: table: party_people", "answer": "SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> 'Progress Party'"} {"question": "Find the names of all the employees whose the role name is 'Editor'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Editor'"} {"question": "Show the names of customers who have at least 2 mailshots with outcome code 'Order'.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING COUNT(*) >= 2"} {"question": "How many students are affected by cat allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Has_allergy WHERE Allergy = 'Cat'"} {"question": "Find the three most expensive procedures.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM procedures ORDER BY cost NULLS FIRST LIMIT 3"} {"question": "Give me the product type, name and price for all the products supplied by supplier id 3.\nAdditional table information: table: department_store", "answer": "SELECT T2.product_type_code, T2.product_name, T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3"} {"question": "Show the names and main services for train stations that have the top three total number of passengers.\nAdditional table information: table: train_station", "answer": "SELECT name, main_services FROM station ORDER BY total_passengers DESC LIMIT 3"} {"question": "Sort the customer names in alphabetical order.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT customer_details FROM customers ORDER BY customer_details NULLS FIRST"} {"question": "Find the branch names of banks in the New York state.\nAdditional table information: table: loan_1", "answer": "SELECT bname FROM bank WHERE state = 'New York'"} {"question": "What are the country names, area and population which has both roller coasters with speed higher\nAdditional table information: table: roller_coaster", "answer": "SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed > 60 INTERSECT SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed < 55"} {"question": "Which employees have the role with code 'HR'? Find their names.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_name FROM Employees WHERE role_code = 'HR'"} {"question": "For which countries are there more than four distinct addresses listed?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4"} {"question": "What are the first names of all students that are not enrolled in courses?\nAdditional table information: table: college_3", "answer": "SELECT Fname FROM STUDENT WHERE NOT StuID IN (SELECT StuID FROM ENROLLED_IN)"} {"question": "What are the ids, names and genders of the architects who built two bridges or one mill?\nAdditional table information: table: architecture", "answer": "SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 2 UNION SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 1"} {"question": "Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30"} {"question": "What are the names of customers who use payment method 'Cash'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers WHERE payment_method = 'Cash'"} {"question": "List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.claim_id, T1.date_claim_made, T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING COUNT(*) = 1"} {"question": "What are the title and maximum price of each film?\nAdditional table information: table: cinema", "answer": "SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id"} {"question": "Find the name and capacity of the stadium where the event named 'World Junior' happened.\nAdditional table information: table: swimming", "answer": "SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'"} {"question": "What is the name of the document with the most number of sections?\nAdditional table information: table: document_management", "answer": "SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many apartment bookings are there in total?\nAdditional table information: table: apartment_rentals", "answer": "SELECT COUNT(*) FROM Apartment_Bookings"} {"question": "What are the line 1 and average monthly rentals of all student addresses?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.line_1, AVG(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id"} {"question": "What are the names of departments that have primarily affiliated physicians.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1"} {"question": "How many times did Boston Red Stockings lose in 2009 postseason?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009"} {"question": "What is the project id and detail for the project with at least two documents?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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"} {"question": "How many video games do you have?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(*) FROM Video_games"} {"question": "Which customers do not have any policies? Find the details of these customers.\nAdditional table information: table: insurance_policies", "answer": "SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id"} {"question": "Which directors had a movie both in the year 1999 and 2000?\nAdditional table information: table: culture_company", "answer": "SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999"} {"question": "Show all the planned delivery dates and actual delivery dates of bookings.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Planned_Delivery_Date, Actual_Delivery_Date FROM BOOKINGS"} {"question": "Find the total amount claimed in the most recently created document.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT SUM(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date NULLS FIRST LIMIT 1)"} {"question": "Show the manager name for gas stations belonging to the ExxonMobil company.\nAdditional table information: table: gas_company", "answer": "SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'"} {"question": "What is the product with the highest height? Give me the catalog entry name.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1"} {"question": "What is the nationality of the journalist with the largest number of years working?\nAdditional table information: table: news_report", "answer": "SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1"} {"question": "What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?\nAdditional table information: table: soccer_2", "answer": "SELECT MAX(T1.HS), pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos"} {"question": "Find the count of universities whose campus fee is greater than the average campus fee.\nAdditional table information: table: csu_1", "answer": "SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)"} {"question": "What is the name of the customer that has purchased the most items?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1"} {"question": "For each zip code, how many times has the maximum wind speed reached 25 mph?\nAdditional table information: table: bike_1", "answer": "SELECT zip_code, COUNT(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code"} {"question": "What are the names of the people who are older 40 but no friends under age 30?\nAdditional table information: table: network_2", "answer": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)"} {"question": "List the name and cost of all procedures sorted by the cost from the highest to the lowest.\nAdditional table information: table: hospital_1", "answer": "SELECT name, cost FROM procedures ORDER BY cost DESC"} {"question": "Return the name, location, and seating of the track that was opened in the most recent year.\nAdditional table information: table: race_track", "answer": "SELECT name, LOCATION, seating FROM track ORDER BY year_opened DESC LIMIT 1"} {"question": "For each reviewer id, what is the title and rating for the movie with the smallest rating?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID"} {"question": "Which city has the most addresses? List the city name, number of addresses, and city id.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the last name of the musicians who has played back position the most?\nAdditional table information: table: music_2", "answer": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = 'back' GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names and publication dates of all catalogs that have catalog level number greater than 5.\nAdditional table information: table: product_catalog", "answer": "SELECT t1.catalog_name, t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5"} {"question": "How many female students have milk or egg allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = 'F' AND T1.allergy = 'Milk' OR T1.allergy = 'Eggs'"} {"question": "What are the first and last names of all the female students who have president votes?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = 'F'"} {"question": "What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000?\nAdditional table information: table: driving_school", "answer": "SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000"} {"question": "What countries are the female artists who sung in the language Bangla from?\nAdditional table information: table: music_1", "answer": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = 'Female' AND T2.languages = 'bangla'"} {"question": "For each room, find its name and the number of times reservations were made for it.\nAdditional table information: table: inn_1", "answer": "SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room"} {"question": "What are the first and last names of all the candidates?\nAdditional table information: table: student_assessment", "answer": "SELECT T2.first_name, T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id"} {"question": "How many students did not have any course enrollment?\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(*) FROM Students WHERE NOT student_id IN (SELECT student_id FROM Student_Course_Enrolment)"} {"question": "What is the full name and id of the customer who has the lowest total amount of payment?\nAdditional table information: table: sakila_1", "answer": "SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(amount) ASC NULLS FIRST LIMIT 1"} {"question": "what is id of students who registered some courses but the least number of courses in these students?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Show all statement id and the number of accounts for each statement.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID"} {"question": "Find the description and code of the service type that is performed the most times.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the name and capacity of products with price greater than 700 (in USD).\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700"} {"question": "How many airlines does Russia has?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airlines WHERE country = 'Russia'"} {"question": "Find the max, average, and minimum gpa of all students in each department.\nAdditional table information: table: college_1", "answer": "SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code"} {"question": "What are the dates that have an average sea level pressure between 30.3 and 31?\nAdditional table information: table: bike_1", "answer": "SELECT date FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31"} {"question": "What are the total order quantities of photo products?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = 'photo'"} {"question": "What is 'the date in location from' and 'the date in location to' for the document with name 'Robin CV'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T1.date_in_location_from, T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = 'Robin CV'"} {"question": "What are the first names and office of the professors who are in the history department and have a Ph.D?\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'"} {"question": "For each sex, what is the name and sex of the candidate with the oppose rate for their sex?\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex"} {"question": "What is the average price range of five star hotels that allow pets?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = '5' AND pets_allowed_yn = 1"} {"question": "List the name of a building along with the name of a company whose office is in the building.\nAdditional table information: table: company_office", "answer": "SELECT T3.name, T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id"} {"question": "Count the number of countries.\nAdditional table information: table: county_public_safety", "answer": "SELECT COUNT(*) FROM county_public_safety"} {"question": "Return the day Number and stored date for all the documents.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date"} {"question": "Find the name of the products that have the color description 'red' and have the characteristic name 'fast'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'fast'"} {"question": "Please list the location and the winning aircraft name.\nAdditional table information: table: aircraft", "answer": "SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft"} {"question": "What are the guest first name, start date, and end date of each apartment booking?\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.guest_first_name, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id"} {"question": "What are the different names for each station that has ever had 7 bikes available?\nAdditional table information: table: bike_1", "answer": "SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7"} {"question": "List the names of all the distinct product names in alphabetical order?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT DISTINCT product_name FROM product ORDER BY product_name NULLS FIRST"} {"question": "What are the start date and end date of the booking that has booked the product named 'Book collection A'?\nAdditional table information: table: products_for_hire", "answer": "SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'"} {"question": "What are the names of all stations that have more than 10 bikes available and are not located in San Jose?\nAdditional table information: table: bike_1", "answer": "SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING AVG(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = 'San Jose'"} {"question": "What are project ids of projects that have 2 or more corresponding documents?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2"} {"question": "What is the description of document status code 'working'?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = 'working'"} {"question": "Which department has the most professors with a Ph.D.?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name, T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name, city, and country of the airport with the highest elevation?\nAdditional table information: table: flight_4", "answer": "SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1"} {"question": "Show year where a track with a seating at least 5000 opened and a track with seating no more than 4000 opened.\nAdditional table information: table: race_track", "answer": "SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000"} {"question": "Find the average age of all students living in the each city.\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(age), city_code FROM student GROUP BY city_code"} {"question": "In which state is the college that Charles attends?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'"} {"question": "What are the details of all organizations that are described as Sponsors and sort the results in ascending order?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details NULLS FIRST"} {"question": "What are the details and ways to get to tourist attractions related to royal family?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Royal_Family_Details, T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID"} {"question": "Find the name of persons who are friends with Bob.\nAdditional table information: table: network_2", "answer": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'"} {"question": "Count the number of farms.\nAdditional table information: table: farm", "answer": "SELECT COUNT(*) FROM farm"} {"question": "What is the highest elevation of an airport in the country of Iceland?\nAdditional table information: table: flight_4", "answer": "SELECT MAX(elevation) FROM airports WHERE country = 'Iceland'"} {"question": "Find the names of all directors whose movies are rated by Sarah Martinez.\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez'"} {"question": "What are the different dorm amenity names in alphabetical order?\nAdditional table information: table: dorm_1", "answer": "SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name NULLS FIRST"} {"question": "How many different position for players are listed?\nAdditional table information: table: sports_competition", "answer": "SELECT COUNT(DISTINCT POSITION) FROM player"} {"question": "List all customer status codes and the number of customers having each status code.\nAdditional table information: table: driving_school", "answer": "SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code"} {"question": "Find the names and descriptions of courses that belong to the subject named 'Computer Science'.\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_name, T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = 'Computer Science'"} {"question": "For each course id, how many students are registered and what are the course names?\nAdditional table information: table: student_assessment", "answer": "SELECT T3.course_name, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id"} {"question": "What is the average number of gold medals for a club?\nAdditional table information: table: sports_competition", "answer": "SELECT AVG(Gold) FROM club_rank"} {"question": "Find the payment method code used by more than 3 parties.\nAdditional table information: table: e_government", "answer": "SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3"} {"question": "Show the denomination shared by more than one school.\nAdditional table information: table: school_player", "answer": "SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1"} {"question": "What are the codes, names, and descriptions of the different document types?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types"} {"question": "How many lessons did the customer with the first name Ray take?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Ray'"} {"question": "Find the team of the player of the highest age.\nAdditional table information: table: school_player", "answer": "SELECT Team FROM player ORDER BY Age DESC LIMIT 1"} {"question": "Find the full name of employee who supported the most number of customers.\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show first name and last name for all the students advised by Michael Goodrich.\nAdditional table information: table: activity_1", "answer": "SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = 'Michael' AND T1.lname = 'Goodrich'"} {"question": "List the hardware model name for the phones that were produced by 'Nokia Corporation' or whose screen mode type is 'Graphics.'\nAdditional table information: table: phone_1", "answer": "SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = 'Graphics' OR t2.Company_name = 'Nokia Corporation'"} {"question": "How many models do not have the wifi function?\nAdditional table information: table: phone_1", "answer": "SELECT COUNT(*) FROM chip_model WHERE wifi = 'No'"} {"question": "Show all company names and headquarters in the descending order of market value.\nAdditional table information: table: gas_company", "answer": "SELECT company, headquarters FROM company ORDER BY market_value DESC"} {"question": "Find the number of vocal types used in song 'Le Pop'\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'"} {"question": "How many papers are published in total?\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(*) FROM papers"} {"question": "What are the first names of the people in alphabetical order?\nAdditional table information: table: student_assessment", "answer": "SELECT first_name FROM people ORDER BY first_name NULLS FIRST"} {"question": "Show names of shops that have more than one kind of device in stock.\nAdditional table information: table: device", "answer": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1"} {"question": "What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach?\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code"} {"question": "What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is 'PUR'?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = 'PUR'"} {"question": "Tell me the types of the policy used by the customer named 'Dayana Robel'.\nAdditional table information: table: insurance_fnol", "answer": "SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = 'Dayana Robel'"} {"question": "What are the title and rental rate of the film with the highest rental rate?\nAdditional table information: table: sakila_1", "answer": "SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1"} {"question": "Find the name of route that has the highest number of deliveries.\nAdditional table information: table: customer_deliveries", "answer": "SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "find the number of different programs that are broadcast during night time.\nAdditional table information: table: program_share", "answer": "SELECT COUNT(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night'"} {"question": "For the airline ids with the top 10 most routes operated, what are their names?\nAdditional table information: table: flight_4", "answer": "SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10"} {"question": "Count the number of programs.\nAdditional table information: table: program_share", "answer": "SELECT COUNT(*) FROM program"} {"question": "What are the date and venue of each debate?\nAdditional table information: table: debate", "answer": "SELECT Date, Venue FROM debate"} {"question": "Which three cities have the largest regional population?\nAdditional table information: table: city_record", "answer": "SELECT city FROM city ORDER BY regional_population DESC LIMIT 3"} {"question": "What are the names of the songs without a lead vocal?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = 'lead'"} {"question": "What are the rank, first name, and last name of the faculty members?\nAdditional table information: table: activity_1", "answer": "SELECT rank, Fname, Lname FROM Faculty"} {"question": "What is the id and name of the browser that is compatible with the most web accelerators?\nAdditional table information: table: browser_web", "answer": "SELECT T1.id, T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the title and id of the film which has a rental rate of 0.99 and an inventory of below 3?\nAdditional table information: table: sakila_1", "answer": "SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING COUNT(*) < 3"} {"question": "What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers?\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.staff_name, T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id = T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name, T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id = T4.contact_staff_id"} {"question": "Find the name of the user who tweeted more than once, and number of tweets tweeted by them.\nAdditional table information: table: twitter_1", "answer": "SELECT T1.name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING COUNT(*) > 1"} {"question": "Find the first names and offices of all instructors who have taught some course and also find the course description.\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num"} {"question": "Return the categories of music festivals that have the result 'Awarded'.\nAdditional table information: table: music_4", "answer": "SELECT Category FROM music_festival WHERE RESULT = 'Awarded'"} {"question": "Show minimum, maximum, and average market value for all companies.\nAdditional table information: table: gas_company", "answer": "SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company"} {"question": "List every album whose title starts with A in alphabetical order.\nAdditional table information: table: store_1", "answer": "SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title NULLS FIRST"} {"question": "Give the neames of wines with prices below 50 and with appelations in Monterey county.\nAdditional table information: table: wine_1", "answer": "SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Monterey' AND T2.price < 50"} {"question": "Find the total number of rooms in the apartments that have facility code 'Gym'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT SUM(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = 'Gym'"} {"question": "Find the campus fee of 'San Jose State University' in year 2000.\nAdditional table information: table: csu_1", "answer": "SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = 'San Jose State University' AND t1.year = 2000"} {"question": "Return the average price for each product type.\nAdditional table information: table: department_store", "answer": "SELECT product_type_code, AVG(product_price) FROM products GROUP BY product_type_code"} {"question": "Find the number of students for each department.\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), dept_code FROM student GROUP BY dept_code"} {"question": "Find the parties associated with the delegates from district 1. Who served as governors of the parties?\nAdditional table information: table: election", "answer": "SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1"} {"question": "Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.\nAdditional table information: table: dorm_1", "answer": "SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20"} {"question": "What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?\nAdditional table information: table: browser_web", "answer": "SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998"} {"question": "How many distinct companies are there?\nAdditional table information: table: entrepreneur", "answer": "SELECT COUNT(DISTINCT Company) FROM entrepreneur"} {"question": "On which day has it neither been foggy nor rained in the zip code of 94107?\nAdditional table information: table: bike_1", "answer": "SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS <> 'Fog' AND EVENTS <> 'Rain'"} {"question": "Show the carriers of devices in stock at more than one shop.\nAdditional table information: table: device", "answer": "SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1"} {"question": "Count the number of films.\nAdditional table information: table: film_rank", "answer": "SELECT COUNT(*) FROM film"} {"question": "What are the ids of products from the supplier with id 2, which are more expensive than the average price across all products?\nAdditional table information: table: department_store", "answer": "SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT AVG(product_price) FROM products)"} {"question": "Show the locations that have at least two performances.\nAdditional table information: table: performance_attendance", "answer": "SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2"} {"question": "Find the id and number of shops for the company that produces the most expensive furniture.\nAdditional table information: table: manufacturer", "answer": "SELECT t1.manufacturer_id, t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1"} {"question": "What are the names of all tracks that are on playlists titled Movies?\nAdditional table information: table: store_1", "answer": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = 'Movies'"} {"question": "What are the distinct names of wines with prices higher than any wine from John Anthony winery.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = 'John Anthony')"} {"question": "Show names for artists without any exhibition.\nAdditional table information: table: theme_gallery", "answer": "SELECT name FROM artist WHERE NOT artist_id IN (SELECT artist_id FROM exhibition)"} {"question": "What is the id, genre, and name of the artist for every English song ordered by ascending rating?\nAdditional table information: table: music_1", "answer": "SELECT f_id, genre_is, artist_name FROM song WHERE languages = 'english' ORDER BY rating NULLS FIRST"} {"question": "Who are the nominees who have been nominated more than two times?\nAdditional table information: table: musical", "answer": "SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*) > 2"} {"question": "Show names of climbers and the names of mountains they climb.\nAdditional table information: table: climbing", "answer": "SELECT T1.Name, T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID"} {"question": "Show the type of school and the number of buses for each type.\nAdditional table information: table: school_bus", "answer": "SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type"} {"question": "What are the log id and entry description of each problem?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_log_id, log_entry_description FROM problem_log"} {"question": "Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order.\nAdditional table information: table: e_learning", "answer": "SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC NULLS FIRST"} {"question": "Give me the number of faculty members who participate in an activity\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in"} {"question": "display all the information about the department Marketing.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM departments WHERE department_name = 'Marketing'"} {"question": "Give the title of the course offered in Chandler during the Fall of 2010.\nAdditional table information: table: college_2", "answer": "SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010"} {"question": "Show the distinct apartment numbers of the apartments that have bookings with status code 'Confirmed'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Confirmed'"} {"question": "Show the protein name and the institution name.\nAdditional table information: table: protein_institute", "answer": "SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id"} {"question": "Find the names of customers who ordered both products Latte and Americano.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Americano'"} {"question": "Show the enrollment and primary_conference of the oldest college.\nAdditional table information: table: university_basketball", "answer": "SELECT enrollment, primary_conference FROM university ORDER BY founded NULLS FIRST LIMIT 1"} {"question": "What are the task details, task ids, and project ids for the progrects that are detailed as 'omnis' or have at least 3 outcomes?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2"} {"question": "What is the name of the customer who has the most policies listed?\nAdditional table information: table: insurance_fnol", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What amenities does Smith Hall have in alphabetical order?\nAdditional table information: table: dorm_1", "answer": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name NULLS FIRST"} {"question": "What is the customer id of the customer with the most accounts, and how many accounts does this person have?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Give the average number of cities within markets that had a low market estimation larger than 10000?\nAdditional table information: table: film_rank", "answer": "SELECT AVG(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000"} {"question": "Which country does customer with first name as Carole and last name as Bernhard lived in?\nAdditional table information: table: driving_school", "answer": "SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = 'Carole' AND T1.last_name = 'Bernhard'"} {"question": "What are the last names of the teachers who teach the student called GELL TAMI?\nAdditional table information: table: student_1", "answer": "SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'GELL' AND T1.lastname = 'TAMI'"} {"question": "Return the type name, type description, and date of creation for each document.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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"} {"question": "Count the number of distinct channel owners.\nAdditional table information: table: program_share", "answer": "SELECT COUNT(DISTINCT OWNER) FROM channel"} {"question": "Show all opening years and the number of churches that opened in that year.\nAdditional table information: table: wedding", "answer": "SELECT open_date, COUNT(*) FROM church GROUP BY open_date"} {"question": "Please give me a list of cities whose regional population is over 8000000 or under 5000000.\nAdditional table information: table: city_record", "answer": "SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000"} {"question": "Find the name of bank branches that provided some loans.\nAdditional table information: table: loan_1", "answer": "SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id"} {"question": "Show the album names and ids for albums that contain tracks with unit price bigger than 1.\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Title, T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID"} {"question": "What are the names and average prices of products for manufacturers whose products cost on average 150 or more?\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150"} {"question": "Count the number of artists.\nAdditional table information: table: theme_gallery", "answer": "SELECT COUNT(*) FROM artist"} {"question": "Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.\nAdditional table information: table: city_record", "answer": "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"} {"question": "Find the first names of teachers whose email address contains the word 'man'.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT first_name FROM Teachers WHERE email_address LIKE '%man%'"} {"question": "What are the names of all people who are friends with Alice for the shortest amount of time?\nAdditional table information: table: network_2", "answer": "SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT MIN(YEAR) FROM PersonFriend WHERE friend = 'Alice')"} {"question": "Find all the building full names containing the word 'court'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE '%court%'"} {"question": "Find the names of customers who are not living in the state of California.\nAdditional table information: table: customer_deliveries", "answer": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'"} {"question": "Show all countries and the number of people from each country.\nAdditional table information: table: wedding", "answer": "SELECT country, COUNT(*) FROM people GROUP BY country"} {"question": "Please list the name and id of all artists that have at least 3 albums in alphabetical order.\nAdditional table information: table: chinook_1", "answer": "SELECT T2.Name, T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name NULLS FIRST"} {"question": "What is the name of the artist with the greatest number of albums?\nAdditional table information: table: chinook_1", "answer": "SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "display the employee ID and job name for all those jobs in department 80.\nAdditional table information: table: hr_1", "answer": "SELECT T1.employee_id, T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80"} {"question": "Return the names of gymnasts who did not grow up in Santo Domingo.\nAdditional table information: table: gymnast", "answer": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown <> 'Santo Domingo'"} {"question": "What is the first and last name of the artist who performed back stage for the song 'Der Kapitan'?\nAdditional table information: table: music_2", "answer": "SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Der Kapitan' AND T1.StagePosition = 'back'"} {"question": "Find the first name of the band mate that has performed in most songs.\nAdditional table information: table: music_2", "answer": "SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the hardware model name for the phones that have screen mode type 'Text' or RAM size greater than 32.\nAdditional table information: table: phone_1", "answer": "SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = 'Text' OR T1.RAM_MiB > 32"} {"question": "Find all the songs that do not have a back vocal.\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = 'back'"} {"question": "Show the tourist attractions visited by the tourist whose detail is 'Vincent'.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = 'Vincent'"} {"question": "Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name.\nAdditional table information: table: debate", "answer": "SELECT T3.Name, T2.Date, T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID ORDER BY T3.Name ASC NULLS FIRST"} {"question": "Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM manufacturers WHERE revenue < (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin')"} {"question": "Give me the times and numbers of all trains that go to Chennai, ordered by time.\nAdditional table information: table: station_weather", "answer": "SELECT TIME, train_number FROM train WHERE destination = 'Chennai' ORDER BY TIME NULLS FIRST"} {"question": "What are the names of all tracks that belong to the Rock genre and whose media type is MPEG?\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = 'Rock' OR T3.name = 'MPEG audio file'"} {"question": "Which month has the most happy hours?\nAdditional table information: table: coffee_shop", "answer": "SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the mission codes, fates, and names of the ships involved?\nAdditional table information: table: ship_mission", "answer": "SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID"} {"question": "How many Patent outcomes are generated from all the projects?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'"} {"question": "List the document ids for any documents with the status code done and the type code paper.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_id FROM Documents WHERE document_status_code = 'done' AND document_type_code = 'Paper'"} {"question": "What is the detail of each visitor?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Tourist_Details FROM VISITORS"} {"question": "Return the minimum and maximum crime rates across all counties.\nAdditional table information: table: county_public_safety", "answer": "SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety"} {"question": "What is first names of the top 5 staff who have handled the greatest number of complaints?\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY COUNT(*) NULLS FIRST LIMIT 5"} {"question": "What are the names of all the customers in alphabetical order?\nAdditional table information: table: small_bank_1", "answer": "SELECT name FROM accounts ORDER BY name NULLS FIRST"} {"question": "List the id of students who attended statistics courses in the order of attendance date.\nAdditional table information: table: student_assessment", "answer": "SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'statistics' ORDER BY T2.date_of_attendance NULLS FIRST"} {"question": "Tell me the total quantity of products bought by the customer called 'Rodrick Heaney'.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT SUM(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = 'Rodrick Heaney'"} {"question": "What are the full names and salaries for any employees earning less than 6000?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary FROM employees WHERE salary < 6000"} {"question": "What is the first name of the students who are in age 20 to 25 and living in PHL city?\nAdditional table information: table: dorm_1", "answer": "SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25"} {"question": "What are the names of all instructors with names that include 'dar'?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE name LIKE '%dar%'"} {"question": "Return the investors who have invested in two or more entrepreneurs.\nAdditional table information: table: entrepreneur", "answer": "SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2"} {"question": "Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.\nAdditional table information: table: news_report", "answer": "SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3"} {"question": "What is the total amount of grant money given to each organization and what is its id?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id"} {"question": "What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check'\nAdditional table information: table: products_for_hire", "answer": "SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'"} {"question": "What are the names of all the stores located in Khanewal District?\nAdditional table information: table: store_product", "answer": "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = 'Khanewal District'"} {"question": "What is the ship with the largest amount of tonnage called?\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1"} {"question": "What are the names of the courses taught by the tutor whose personal name is 'Julio'?\nAdditional table information: table: e_learning", "answer": "SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = 'Julio'"} {"question": "Give the names of the courses with at least five enrollments.\nAdditional table information: table: college_3", "answer": "SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5"} {"question": "What are the full names and department ids for the lowest paid employees across all departments.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)"} {"question": "List the clubs having 'Davis Steven' as a member.\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Davis' AND t3.lname = 'Steven'"} {"question": "What is the maximum length in meters for the bridges and what are the architects' names?\nAdditional table information: table: architecture", "answer": "SELECT MAX(T1.length_meters), T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id"} {"question": "Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Show the top 3 most common colleges of players in match seasons.\nAdditional table information: table: match_season", "answer": "SELECT College FROM match_season GROUP BY College ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.\nAdditional table information: table: flight_1", "answer": "SELECT departure_date, arrival_date FROM Flight WHERE origin = 'Los Angeles' AND destination = 'Honolulu'"} {"question": "Show the customer id and number of accounts with most accounts.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of artists who have not released any albums?\nAdditional table information: table: chinook_1", "answer": "SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId"} {"question": "How many courses do the student whose id is 171 attend?\nAdditional table information: table: student_assessment", "answer": "SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171"} {"question": "For each file format, return the number of artists who released songs in that format.\nAdditional table information: table: music_1", "answer": "SELECT COUNT(*), formats FROM files GROUP BY formats"} {"question": "Show the name, phone, and payment method code for all customers in descending order of customer number.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT customer_name, customer_phone, payment_method_code FROM customers ORDER BY customer_number DESC"} {"question": "Which model has the least amount of RAM? List the model name and the amount of RAM.\nAdditional table information: table: phone_1", "answer": "SELECT Model_name, RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC NULLS FIRST LIMIT 1"} {"question": "What are the dates in which the mean sea level pressure was between 30.3 and 31?\nAdditional table information: table: bike_1", "answer": "SELECT date FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31"} {"question": "What are the dates and locations of performances?\nAdditional table information: table: performance_attendance", "answer": "SELECT Date, LOCATION FROM performance"} {"question": "Show the working years of managers in descending order of their level.\nAdditional table information: table: railway", "answer": "SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC"} {"question": "For each account type, find the average account balance of customers with credit score lower than 50.\nAdditional table information: table: loan_1", "answer": "SELECT AVG(acc_bal), acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type"} {"question": "which poll source does the highest oppose rate come from?\nAdditional table information: table: candidate_poll", "answer": "SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1"} {"question": "Find the distinct Advisor of students who have treasurer votes in the spring election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = 'Spring'"} {"question": "Which song has the most vocals?\nAdditional table information: table: music_2", "answer": "SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "When did the staff member with first name as Janessa and last name as Sawayn leave the company?\nAdditional table information: table: driving_school", "answer": "SELECT date_left_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'"} {"question": "What is the name of the most expensive product?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1"} {"question": "Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year NULLS FIRST"} {"question": "Show the names of pilots and models of aircrafts they have flied with.\nAdditional table information: table: pilot_record", "answer": "SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID"} {"question": "Return the founded year for the school with the largest enrollment.\nAdditional table information: table: university_basketball", "answer": "SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1"} {"question": "In which year were most of ships built?\nAdditional table information: table: ship_1", "answer": "SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the account name, id and the number of transactions for each account.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.account_name, T1.account_id, COUNT(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id"} {"question": "What are the codes of types of documents of which there are for or more?\nAdditional table information: table: document_management", "answer": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4"} {"question": "List all characteristics of product named 'sesame' with type code 'Grade'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'sesame' AND t3.characteristic_type_code = 'Grade'"} {"question": "Which institution has the most papers? Find the name of the institution.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many cities are there that have more than 3 airports?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3)"} {"question": "What is the name of the marketing region that the store Rob Dinning belongs to?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = 'Rob Dinning'"} {"question": "What are the titles of all the albums alphabetically ascending?\nAdditional table information: table: store_1", "answer": "SELECT title FROM albums ORDER BY title NULLS FIRST"} {"question": "Show all student IDs with more than total 10 hours per week on all sports played.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10"} {"question": "Find the name of the airports located in Cuba or Argentina.\nAdditional table information: table: flight_4", "answer": "SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'"} {"question": "Where is the headquarter of the company founded by James?\nAdditional table information: table: manufactory_1", "answer": "SELECT headquarter FROM manufacturers WHERE founder = 'James'"} {"question": "Find the names and opening hours of the tourist attractions that we get to by bus or walk.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Name, Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = 'bus' OR How_to_Get_There = 'walk'"} {"question": "What is the name and opening year for the branch that registered the most members in 2016?\nAdditional table information: table: shop_membership", "answer": "SELECT T2.name, T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names, dates active, and number of deaths for storms that had 1 or more death?\nAdditional table information: table: storm_record", "answer": "SELECT name, dates_active, number_deaths FROM storm WHERE number_deaths >= 1"} {"question": "What are the start date and end date of each apartment booking?\nAdditional table information: table: apartment_rentals", "answer": "SELECT booking_start_date, booking_end_date FROM Apartment_Bookings"} {"question": "Show the guest first names, start dates, and end dates of all the apartment bookings.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.guest_first_name, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id"} {"question": "Find the number of investors in total.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT COUNT(*) FROM INVESTORS"} {"question": "How many department stores does the store chain South have?\nAdditional table information: table: department_store", "answer": "SELECT COUNT(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = 'South'"} {"question": "What are the ids of the top three products that were purchased in the largest amount?\nAdditional table information: table: department_store", "answer": "SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3"} {"question": "How long is the total lesson time took by the customer named Rylan Goodwin?\nAdditional table information: table: driving_school", "answer": "SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Rylan' AND T2.last_name = 'Goodwin'"} {"question": "How many events are there?\nAdditional table information: table: swimming", "answer": "SELECT COUNT(*) FROM event"} {"question": "Show the shop addresses ordered by their opening year.\nAdditional table information: table: coffee_shop", "answer": "SELECT address FROM shop ORDER BY open_year NULLS FIRST"} {"question": "List the names of climbers in descending order of points.\nAdditional table information: table: climbing", "answer": "SELECT Name FROM climber ORDER BY Points DESC"} {"question": "What is the total number of all football games played by scholarship students?\nAdditional table information: table: game_1", "answer": "SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = 'Football' AND onscholarship = 'Y'"} {"question": "What are the names of buildings sorted in descending order of building height?\nAdditional table information: table: company_office", "answer": "SELECT name FROM buildings ORDER BY Height DESC"} {"question": "What are the names of projects that have not been assigned?\nAdditional table information: table: scientist_1", "answer": "SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo)"} {"question": "What are the distinct names of customers who have purchased at least three different products?\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT(DISTINCT T3.product_id) >= 3"} {"question": "What are the addresses of customers living in Germany who have had an invoice?\nAdditional table information: table: chinook_1", "answer": "SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = 'Germany'"} {"question": "Find the names of the products with length smaller than 3 or height greater than 5.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5"} {"question": "How many routes does American Airlines operate?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'"} {"question": "Find the number of students whose age is older than the average age for each gender.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex"} {"question": "What are the names and headquarters of all manufacturers, ordered by revenue descending?\nAdditional table information: table: manufactory_1", "answer": "SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC"} {"question": "Show the names of journalists that have reported more than one event.\nAdditional table information: table: news_report", "answer": "SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1"} {"question": "What are the employee ids, full names, and job ids for employees who make more than the highest earning employee with title PU_MAN?\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN')"} {"question": "What are the forenames and surnames of all unique drivers who had a lap time of less than 93000 milliseconds?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000"} {"question": "What are the first names and last names of the students who are 18 years old and have vice president votes.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18"} {"question": "What are the first names and ages of all students who are playing both Football and Lacrosse?\nAdditional table information: table: game_1", "answer": "SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = 'Football' INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = 'Lacrosse')"} {"question": "What is the most common maximum page size?\nAdditional table information: table: store_product", "answer": "SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many customers are from California?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM customers WHERE state = 'CA'"} {"question": "Find the last name of the staff whose email address contains 'wrau'.\nAdditional table information: table: customer_complaints", "answer": "SELECT last_name FROM staff WHERE email_address LIKE '%wrau%'"} {"question": "How many different students are involved in sports?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(DISTINCT StuID) FROM Sportsinfo"} {"question": "What are the names of all songs that are in mp3 format and have a resolution lower than 1000?\nAdditional table information: table: music_1", "answer": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = 'mp3' INTERSECT SELECT song_name FROM song WHERE resolution < 1000"} {"question": "What is the average price for a lesson taught by Janessa Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "What are the names of all aircrafts that John Williams have certificates to be able to fly?\nAdditional table information: table: flight_1", "answer": "SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = 'John Williams'"} {"question": "Find the busiest source airport that runs most number of routes in China.\nAdditional table information: table: flight_4", "answer": "SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "When did Linda Smith visit Subway?\nAdditional table information: table: restaurant_1", "answer": "SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = 'Linda' AND Student.Lname = 'Smith' AND Restaurant.ResName = 'Subway'"} {"question": "How many schools are there in the department?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT school_code) FROM department"} {"question": "What are the names and headquarters of all companies ordered by descending market value?\nAdditional table information: table: gas_company", "answer": "SELECT company, headquarters FROM company ORDER BY market_value DESC"} {"question": "How many musicals has each nominee been nominated for?\nAdditional table information: table: musical", "answer": "SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee"} {"question": "How many employees do we have?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT COUNT(*) FROM Employees"} {"question": "Show names of shops and the carriers of devices they have in stock.\nAdditional table information: table: device", "answer": "SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID"} {"question": "Which product has the most problems? Give me the number of problems and the product name.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the count of the songs that last approximately 4 minutes?\nAdditional table information: table: music_1", "answer": "SELECT COUNT(*) FROM files WHERE duration LIKE '4:%'"} {"question": "List the distinct hometowns that are not associated with any gymnast.\nAdditional table information: table: gymnast", "answer": "SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID"} {"question": "What is the average number of international passengers for an airport?\nAdditional table information: table: aircraft", "answer": "SELECT AVG(International_Passengers) FROM airport"} {"question": "Which country and state does staff with first name as Janessa and last name as Sawayn lived?\nAdditional table information: table: driving_school", "answer": "SELECT T1.country, T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "What is the number of different class sections offered in the course ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211'"} {"question": "Show the ids and names of festivals that have at least two nominations for artworks.\nAdditional table information: table: entertainment_awards", "answer": "SELECT T1.Festival_ID, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2"} {"question": "Count the number of accounts corresponding to each customer id.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*), customer_id FROM Accounts GROUP BY customer_id"} {"question": "Find the names of the artists who are from UK and have produced English songs.\nAdditional table information: table: music_1", "answer": "SELECT artist_name FROM artist WHERE country = 'UK' INTERSECT SELECT artist_name FROM song WHERE languages = 'english'"} {"question": "Show the average share count of transactions each each investor, ordered by average share count.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY AVG(share_count) NULLS FIRST"} {"question": "Show all video game types and the number of video games in each type.\nAdditional table information: table: game_1", "answer": "SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype"} {"question": "Find the number of accounts with a savings balance that is higher than the average savings balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings)"} {"question": "What is all the information about all people?\nAdditional table information: table: candidate_poll", "answer": "SELECT * FROM people"} {"question": "Sort the information about course authors and tutors in alphabetical order of the personal name.\nAdditional table information: table: e_learning", "answer": "SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name NULLS FIRST"} {"question": "Find the city the store named 'FJA Filming' is in.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = 'FJA Filming'"} {"question": "What is the unit price of the tune 'Fast As a Shark'?\nAdditional table information: table: store_1", "answer": "SELECT unit_price FROM tracks WHERE name = 'Fast As a Shark'"} {"question": "Find the total number of hours have done for all students in each department.\nAdditional table information: table: college_1", "answer": "SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code"} {"question": "What are the titles and directors of the movies whose star is greater than the average stars of the movies directed by James Cameron?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = 'James Cameron')"} {"question": "What are the maximum price and score of wines in each year?\nAdditional table information: table: wine_1", "answer": "SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR"} {"question": "What document types do have more than 10000 total access number.\nAdditional table information: table: document_management", "answer": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000"} {"question": "What are the names of festivals held in year 2007?\nAdditional table information: table: entertainment_awards", "answer": "SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007"} {"question": "Find the name of each user and number of tweets tweeted by each of them.\nAdditional table information: table: twitter_1", "answer": "SELECT T1.name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid"} {"question": "What are the start date and end date of the apartment bookings made by female guests (gender code 'Female')?\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = 'Female'"} {"question": "What is the total kills of the perpetrators with height more than 1.84.\nAdditional table information: table: perpetrator", "answer": "SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84"} {"question": "Find the balance of the checking account belonging to an owner whose name contains 'ee'.\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'"} {"question": "What are the first name and last name of Linda Smith's advisor?\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = 'Linda' AND T2.lname = 'Smith'"} {"question": "Which school has the fewest professors?\nAdditional table information: table: college_1", "answer": "SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Return the description of the budget type that has the code ORG.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = 'ORG'"} {"question": "Who is the author of the paper titled 'Binders Unbound'? Give me the last name.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = 'Binders Unbound'"} {"question": "List the names of editors who are older than 25.\nAdditional table information: table: journal_committee", "answer": "SELECT Name FROM editor WHERE Age > 25"} {"question": "Count the number of customers who hold an account.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(DISTINCT customer_id) FROM Accounts"} {"question": "Show the name, time, and service for all trains.\nAdditional table information: table: train_station", "answer": "SELECT name, TIME, service FROM train"} {"question": "Show the statement detail and the corresponding document name for the statement with detail 'Private Project'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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'"} {"question": "What are the lot details of lots associated with transactions with share count smaller than 50?\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50"} {"question": "Find the total account balance of each customer from Utah or Texas.\nAdditional table information: table: loan_1", "answer": "SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'"} {"question": "What are the ids of the students who attended courses in the statistics department in order of attendance date.\nAdditional table information: table: student_assessment", "answer": "SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'statistics' ORDER BY T2.date_of_attendance NULLS FIRST"} {"question": "Count the number of courses.\nAdditional table information: table: college_3", "answer": "SELECT COUNT(*) FROM COURSE"} {"question": "What is the name of the shop that has the most different kinds of devices in stock?\nAdditional table information: table: device", "answer": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the name of the most popular party form.\nAdditional table information: table: e_government", "answer": "SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many cinema do we have?\nAdditional table information: table: cinema", "answer": "SELECT COUNT(*) FROM cinema"} {"question": "What are the average, minimum, and max ages for each of the different majors?\nAdditional table information: table: game_1", "answer": "SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major"} {"question": "How many documents have document type code CV or BK?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM All_documents WHERE document_type_code = 'CV' OR document_type_code = 'BK'"} {"question": "Find the student ID and personal name of the student with at least two enrollments.\nAdditional table information: table: e_learning", "answer": "SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2"} {"question": "Find the cities corresponding to employees who help customers with the postal code 70174.\nAdditional table information: table: chinook_1", "answer": "SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = '70174'"} {"question": "Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa.\nAdditional table information: table: sakila_1", "answer": "SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa'"} {"question": "What is the color of the grape whose wine products has the highest average price?\nAdditional table information: table: wine_1", "answer": "SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1"} {"question": "Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.\nAdditional table information: table: pilot_record", "answer": "SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank NULLS FIRST"} {"question": "Find the name of the youngest organization.\nAdditional table information: table: e_government", "answer": "SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1"} {"question": "Return the maximum enrollment across all schools.\nAdditional table information: table: university_basketball", "answer": "SELECT MAX(Enrollment) FROM university"} {"question": "What are the names of people in ascending order of weight?\nAdditional table information: table: entrepreneur", "answer": "SELECT Name FROM People ORDER BY Weight ASC NULLS FIRST"} {"question": "How many students are from each city, and which cities have more than one cities?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1"} {"question": "What is the id of the candidate with the lowest oppose rate?\nAdditional table information: table: candidate_poll", "answer": "SELECT Candidate_ID FROM candidate ORDER BY oppose_rate NULLS FIRST LIMIT 1"} {"question": "What is the average fastest lap speed for the Monaco Grand Prix in 2008?\nAdditional table information: table: formula_1", "answer": "SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'"} {"question": "Find the names of the campus which has more faculties in 2002 than every campus in Orange county.\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = 'Orange')"} {"question": "Show the distinct venues of debates\nAdditional table information: table: debate", "answer": "SELECT DISTINCT Venue FROM debate"} {"question": "How many orders does Lucas Mancini has?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = 'Lucas' AND T1.last_name = 'Mancini'"} {"question": "What are the names of all the games that have been played for at least 1000 hours?\nAdditional table information: table: game_1", "answer": "SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000"} {"question": "Find the name of students who took any class in the years of 2009 and 2010.\nAdditional table information: table: college_2", "answer": "SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010"} {"question": "What are the names of instructors who advise more than one student?\nAdditional table information: table: college_2", "answer": "SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING COUNT(*) > 1"} {"question": "Count the number of customers.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers"} {"question": "Show origin and destination for flights with price higher than 300.\nAdditional table information: table: flight_1", "answer": "SELECT origin, destination FROM Flight WHERE price > 300"} {"question": "Show all account ids and account details.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT account_id, account_details FROM Accounts"} {"question": "What is the effective date of the claim that has the largest amount of total settlement?\nAdditional table information: table: insurance_fnol", "answer": "SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1"} {"question": "Find the name and gender of the candidate who got the highest support rate.\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1"} {"question": "Return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC NULLS FIRST"} {"question": "Find the id and location of circuits that belong to France or Belgium?\nAdditional table information: table: formula_1", "answer": "SELECT circuitid, LOCATION FROM circuits WHERE country = 'France' OR country = 'Belgium'"} {"question": "How many times has the student Linda Smith visited Subway?\nAdditional table information: table: restaurant_1", "answer": "SELECT COUNT(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = 'Linda' AND Student.Lname = 'Smith' AND Restaurant.ResName = 'Subway'"} {"question": "Which student visited restaurant most often? List student's first name and last name.\nAdditional table information: table: restaurant_1", "answer": "SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the titles and directors of the films were never presented in China?\nAdditional table information: table: film_rank", "answer": "SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')"} {"question": "Return the types of film market estimations in 1995.\nAdditional table information: table: film_rank", "answer": "SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995"} {"question": "Find the states of the colleges that have students in the tryout who played in striker position.\nAdditional table information: table: soccer_2", "answer": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'"} {"question": "How many farms are there?\nAdditional table information: table: farm", "answer": "SELECT COUNT(*) FROM farm"} {"question": "How many wines are produced at Robert Biale winery?\nAdditional table information: table: wine_1", "answer": "SELECT COUNT(*) FROM WINE WHERE Winery = 'Robert Biale'"} {"question": "In which locations are there more than one movie theater with capacity above 300?\nAdditional table information: table: cinema", "answer": "SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1"} {"question": "Give the name of the lowest earning instructor in the Statistics department.\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary NULLS FIRST LIMIT 1"} {"question": "Which apartments have bookings with both status codes 'Provisional' and 'Confirmed'? Give me the apartment numbers.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Confirmed' INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = 'Provisional'"} {"question": "Find the average age of the students who have allergies with food and animal types.\nAdditional table information: table: allergy_1", "answer": "SELECT AVG(age) FROM Student WHERE StuID IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'food' INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'animal')"} {"question": "What are the names and descriptions of the all courses under the 'Computer Science' subject?\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_name, T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = 'Computer Science'"} {"question": "What are the names of the branches that have some members with a hometown in Louisville, Kentucky and also those from Hiram, Goergia?\nAdditional table information: table: shop_membership", "answer": "SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram , Georgia'"} {"question": "Find the name of all the clubs at 'AKW'.\nAdditional table information: table: club_1", "answer": "SELECT clubname FROM club WHERE clublocation = 'AKW'"} {"question": "Find the first names and offices of all professors sorted by alphabetical order of their first name.\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname NULLS FIRST"} {"question": "Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20.\nAdditional table information: table: perpetrator", "answer": "SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20"} {"question": "Find the name of the department which has the highest average salary of professors.\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC LIMIT 1"} {"question": "What are the famous titles and ages of each artist, listed in descending order by age?\nAdditional table information: table: music_4", "answer": "SELECT Famous_Title, Age FROM artist ORDER BY Age DESC"} {"question": "List the area and county of all appelations.\nAdditional table information: table: wine_1", "answer": "SELECT Area, County FROM APPELLATIONS"} {"question": "List the names of all the physicians who prescribe Thesisin as medication.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = 'Thesisin'"} {"question": "Show the ids of the faculty who don't participate in any activity.\nAdditional table information: table: activity_1", "answer": "SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in"} {"question": "Count the number of Annual Meeting events that took place in the region of the United Kingdom.\nAdditional table information: table: party_people", "answer": "SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = 'United Kingdom' AND t3.Event_Name = 'Annaual Meeting'"} {"question": "What are the names of customers who do not have any policies?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id"} {"question": "What are the first names and office locations for all professors sorted alphabetically by first name?\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname NULLS FIRST"} {"question": "How many types of products have Rodrick Heaney bought in total?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = 'Rodrick Heaney'"} {"question": "What is the id and trade name of the medicines can interact with at least 3 enzymes?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3"} {"question": "What college has a student who successfully made the team in the role of a goalie?\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'"} {"question": "Find the year which offers the largest number of courses.\nAdditional table information: table: college_2", "answer": "SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the id of the customers who have order status both 'On Road' and 'Shipped'.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road' INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Shipped'"} {"question": "What is the total number of rooms available in this inn?\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM Rooms"} {"question": "What is the most common birth place of people?\nAdditional table information: table: body_builder", "answer": "SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all aicrafts that have never won any match?\nAdditional table information: table: aircraft", "answer": "SELECT Aircraft FROM aircraft WHERE NOT Aircraft_ID IN (SELECT Winning_Aircraft FROM MATCH)"} {"question": "What are the heights of perpetrators in descending order of the number of people they injured?\nAdditional table information: table: perpetrator", "answer": "SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC"} {"question": "Who are the nominees who have been nominated for both a Tony Award and a Drama Desk Award?\nAdditional table information: table: musical", "answer": "SELECT Nominee FROM musical WHERE Award = 'Tony Award' INTERSECT SELECT Nominee FROM musical WHERE Award = 'Drama Desk Award'"} {"question": "What is the average quantity of stocks?\nAdditional table information: table: device", "answer": "SELECT AVG(Quantity) FROM stock"} {"question": "Which movies have 'Deleted Scenes' as a substring in the special feature?\nAdditional table information: table: sakila_1", "answer": "SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'"} {"question": "Find the list of documents that are both in the most three popular type and have the most three popular structure.\nAdditional table information: table: document_management", "answer": "SELECT document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What are the issue dates of volumes associated with the artist 'Gorgoroth'?\nAdditional table information: table: music_4", "answer": "SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = 'Gorgoroth'"} {"question": "In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?\nAdditional table information: table: game_injury", "answer": "SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'"} {"question": "Find the number of different products that are produced by companies at different headquarter cities.\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(DISTINCT T1.name), T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.Headquarter"} {"question": "What is the name of the shipping agent of the document with id 2?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2"} {"question": "What is the name of the bank branch that has lent the greatest amount?\nAdditional table information: table: loan_1", "answer": "SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY SUM(T2.amount) DESC LIMIT 1"} {"question": "Find the average and oldest age for students with different sex.\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(age), MAX(age), sex FROM student GROUP BY sex"} {"question": "What is the name and building of the departments whose budget is more than the average budget?\nAdditional table information: table: college_2", "answer": "SELECT dept_name, building FROM department WHERE budget > (SELECT AVG(budget) FROM department)"} {"question": "For each party, return its theme and the name of its host.\nAdditional table information: table: party_host", "answer": "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"} {"question": "What are the three products that have the most problems?s\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Give the product id for the product that was ordered most frequently.\nAdditional table information: table: department_store", "answer": "SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which store has most the customers?\nAdditional table information: table: sakila_1", "answer": "SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "For each building, show the name of the building and the number of institutions in it.\nAdditional table information: table: protein_institute", "answer": "SELECT T1.name, COUNT(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id"} {"question": "What is the average number of rooms of apartments with type code 'Studio'?\nAdditional table information: table: apartment_rentals", "answer": "SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = 'Studio'"} {"question": "Which players are from Indonesia?\nAdditional table information: table: match_season", "answer": "SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = 'Indonesia'"} {"question": "Show the most common apartment type code among apartments with more than 1 bathroom.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the first name, last name, and phone number for all female faculty members.\nAdditional table information: table: activity_1", "answer": "SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F'"} {"question": "What are the ids of all vehicles?\nAdditional table information: table: driving_school", "answer": "SELECT vehicle_id FROM Vehicles"} {"question": "Find the name of companies whose revenue is between 100 and 150.\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150"} {"question": "Show the details of the top 3 most expensive hotels.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3"} {"question": "What are the first names of all students who are older than 20?\nAdditional table information: table: dorm_1", "answer": "SELECT fname FROM student WHERE age > 20"} {"question": "What are the name and id of the team offering the lowest average salary?\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name, T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY AVG(T2.salary) ASC NULLS FIRST LIMIT 1"} {"question": "Which product's detail contains the word 'Latte' or 'Americano'? Return the full detail.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT product_details FROM products WHERE product_details LIKE '%Latte%' OR product_details LIKE '%Americano%'"} {"question": "How many total pounds were purchased in the year 2018 at all London branches?\nAdditional table information: table: shop_membership", "answer": "SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018"} {"question": "Show the names of countries and the average speed of roller coasters from each country.\nAdditional table information: table: roller_coaster", "answer": "SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name"} {"question": "Give the distinct names of wines made before 2000 or after 2010.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010"} {"question": "What is the name of the person who is the oldest?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person)"} {"question": "What are the names and genders of all artists who released songs in the month of March?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE '%Mar%'"} {"question": "Select the project names which are not assigned yet.\nAdditional table information: table: scientist_1", "answer": "SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo)"} {"question": "What is the maximum enrollment across all schools?\nAdditional table information: table: university_basketball", "answer": "SELECT MAX(Enrollment) FROM university"} {"question": "What are the names of all the video games and their types in alphabetical order?\nAdditional table information: table: game_1", "answer": "SELECT gname, gtype FROM Video_games ORDER BY gname NULLS FIRST"} {"question": "How old is the youngest winning pilot and what is their name?\nAdditional table information: table: aircraft", "answer": "SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age NULLS FIRST LIMIT 1"} {"question": "Count the number of different scientists assigned to any project.\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(DISTINCT scientist) FROM assignedto"} {"question": "How many students live in HKG or CHI?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student WHERE city_code = 'HKG' OR city_code = 'CHI'"} {"question": "What are the details for all projects that did not hire any staff in a research role?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher')"} {"question": "Give the maximum price and score for wines produced in the appelation St. Helena.\nAdditional table information: table: wine_1", "answer": "SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = 'St. Helena'"} {"question": "Find the names of courses that have either 3 credits or 1 credit but 4 hours.\nAdditional table information: table: college_3", "answer": "SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4"} {"question": "What are the maximum and minumum grade points?\nAdditional table information: table: college_3", "answer": "SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION"} {"question": "How many faculty members do we have for each faculty rank?\nAdditional table information: table: activity_1", "answer": "SELECT rank, COUNT(*) FROM Faculty GROUP BY rank"} {"question": "Count the number of wrestlers.\nAdditional table information: table: wrestler", "answer": "SELECT COUNT(*) FROM wrestler"} {"question": "How many stations does Mountain View city has?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(*) FROM station WHERE city = 'Mountain View'"} {"question": "What are the birthdays of people in ascending order of height?\nAdditional table information: table: body_builder", "answer": "SELECT Birth_Date FROM People ORDER BY Height ASC NULLS FIRST"} {"question": "Give me the dates when the max temperature was higher than 85.\nAdditional table information: table: bike_1", "answer": "SELECT date FROM weather WHERE max_temperature_f > 85"} {"question": "For each team, return the team name, id and the maximum salary among the team.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name, T1.team_id, MAX(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id"} {"question": "Show ids for all students who have advisor 1121.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE Advisor = 1121"} {"question": "Find the total number of students in each department.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*), dept_name FROM student GROUP BY dept_name"} {"question": "Find the name and email for the users who have more than one follower.\nAdditional table information: table: twitter_1", "answer": "SELECT T1.name, T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING COUNT(*) > 1"} {"question": "What is the first name and last name of the student who have most number of sports?\nAdditional table information: table: game_1", "answer": "SELECT T2.Fname, T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the emails of customers who have filed complaints on the product which has had the greatest number of complaints?\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What are the ids, scores, and dates of the games which caused at least two injury accidents?\nAdditional table information: table: game_injury", "answer": "SELECT T1.id, T1.score, T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2"} {"question": "What types of ships have both ships that have Panama Flags and Malta flags?\nAdditional table information: table: ship_1", "answer": "SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'"} {"question": "What are the first name and last name of all the teachers?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT firstname, lastname FROM teachers"} {"question": "How many different kinds of clients are supported by the web clients accelerators?\nAdditional table information: table: browser_web", "answer": "SELECT COUNT(DISTINCT client) FROM web_client_accelerator"} {"question": "What are the states, account types, and credit scores for customers who have 0 loans?\nAdditional table information: table: loan_1", "answer": "SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0"} {"question": "List first name and last name of customers lived in city Lockmanfurt.\nAdditional table information: table: driving_school", "answer": "SELECT T1.first_name, T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = 'Lockmanfurt'"} {"question": "Return all the committees that have delegates from Democratic party.\nAdditional table information: table: election", "answer": "SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Democratic'"} {"question": "Find all information of all the products with a price between $60 and $120.\nAdditional table information: table: manufactory_1", "answer": "SELECT * FROM products WHERE price BETWEEN 60 AND 120"} {"question": "Show the names of members and the location of the performances they attended.\nAdditional table information: table: performance_attendance", "answer": "SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID"} {"question": "Find the total number of king beds available.\nAdditional table information: table: inn_1", "answer": "SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King'"} {"question": "Show the apartment numbers, start dates, and end dates of all the apartment bookings.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id"} {"question": "What are the department names and how many employees work in each of them?\nAdditional table information: table: hr_1", "answer": "SELECT department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name"} {"question": "What are the distinct ids of customers who made an order after any order that was Cancelled?\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT MIN(order_date) FROM Customer_Orders WHERE order_status_code = 'Cancelled')"} {"question": "What is the phone and email for customer with first name Aniyah and last name Feest?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_phone, customer_email FROM Customers WHERE customer_first_name = 'Aniyah' AND customer_last_name = 'Feest'"} {"question": "How many distinct incident type codes are there?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT COUNT(DISTINCT incident_type_code) FROM Behavior_Incident"} {"question": "Find the names of schools that have more than one donator with donation amount above 8.5.\nAdditional table information: table: school_finance", "answer": "SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING COUNT(*) > 1"} {"question": "Find the last name of the first ever contact person of the organization with the highest UK Vat number.\nAdditional table information: table: e_government", "answer": "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"} {"question": "Count the number of transactions.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Financial_transactions"} {"question": "Find the number of products for each manufacturer, showing the name of each company.\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(*), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name"} {"question": "Find the first names and offices of all instructors who have taught some course and the course description and the department name.\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code"} {"question": "Show all flight numbers with aircraft Airbus A340-300.\nAdditional table information: table: flight_1", "answer": "SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = 'Airbus A340-300'"} {"question": "List the names of all the channels owned by either CCTV or HBS\nAdditional table information: table: program_share", "answer": "SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS'"} {"question": "Which parts have more than 2 faults? Show the part name and id.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_id HAVING COUNT(*) > 2"} {"question": "What are the different classes of races, and how many races correspond to each?\nAdditional table information: table: race_track", "answer": "SELECT CLASS, COUNT(*) FROM race GROUP BY CLASS"} {"question": "Find the id of users who are followed by Mary and Susan.\nAdditional table information: table: twitter_1", "answer": "SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = 'Mary' INTERSECT SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = 'Susan'"} {"question": "Show the product type codes that have at least two products.\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2"} {"question": "Which clubs have one or more members whose advisor is '1121'?\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121"} {"question": "What are the names of departments that have at least one employee.\nAdditional table information: table: hr_1", "answer": "SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id"} {"question": "What are the names of reviewers who had rated 3 star and 4 star?\nAdditional table information: table: movie_1", "answer": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4"} {"question": "What are the course codes for every class that the student with the last name Smithson took?\nAdditional table information: table: college_1", "answer": "SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'"} {"question": "Show all the buildings along with the number of faculty members the buildings have.\nAdditional table information: table: activity_1", "answer": "SELECT building, COUNT(*) FROM Faculty GROUP BY building"} {"question": "What are the different driver ids and nationalities of all drivers who had a laptime of more than 100000 milliseconds?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000"} {"question": "What is the name of the game that has been played the most?\nAdditional table information: table: game_1", "answer": "SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1"} {"question": "Compute the average salary of the players in the team called 'Boston Red Stockings'.\nAdditional table information: table: baseball_1", "answer": "SELECT AVG(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'"} {"question": "What are the cities that have a branch that opened in 2001 and a branch with more than 100 members?\nAdditional table information: table: shop_membership", "answer": "SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100"} {"question": "How films are produced by each studio?\nAdditional table information: table: film_rank", "answer": "SELECT Studio, COUNT(*) FROM film GROUP BY Studio"} {"question": "For each zip code, find the ids of all trips that have a higher average mean temperature above 60?\nAdditional table information: table: bike_1", "answer": "SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING AVG(T2.mean_temperature_f) > 60"} {"question": "How many different instruments are used in the song 'Badlands'?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Badlands'"} {"question": "What are the total number of credits offered by each department?\nAdditional table information: table: college_1", "answer": "SELECT SUM(T1.crs_credit), T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code"} {"question": "What are the types of vocals that the musician with the first name 'Solveig' played in the song 'A Bar in Amsterdam'?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = 'Solveig' AND T2.title = 'A Bar In Amsterdam'"} {"question": "Show card type codes with at least 5 cards.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING COUNT(*) >= 5"} {"question": "In February, which city marks the highest temperature?\nAdditional table information: table: city_record", "answer": "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"} {"question": "Show names of musicals which have at least three actors.\nAdditional table information: table: musical", "answer": "SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*) >= 3"} {"question": "For directors who had more than one movie, return the titles and produced years of all movies directed by them.\nAdditional table information: table: movie_1", "answer": "SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title"} {"question": "Find the average millisecond length of Latin and Pop tracks.\nAdditional table information: table: chinook_1", "answer": "SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Latin' OR T1.Name = 'Pop'"} {"question": "Return the phone and email of the customer with the first name Aniyah and last name Feest.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_phone, customer_email FROM Customers WHERE customer_first_name = 'Aniyah' AND customer_last_name = 'Feest'"} {"question": "What are the teams that have both wrestlers eliminated by Orton and wrestlers eliminated by Benjamin?\nAdditional table information: table: wrestler", "answer": "SELECT Team FROM Elimination WHERE Eliminated_By = 'Orton' INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = 'Benjamin'"} {"question": "What is the current series where the new series began in June 2011? \nAdditional table information: table: regional_marketing\ncolumns: state_territory, text_bg_color, format, current_slogan, current_series, Notes", "answer": "SELECT current_series FROM \"regional_marketing\" WHERE Notes = 'New series began in June 2011'"} {"question": "What are the names of all races held between 2009 and 2011?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011"} {"question": "What are the names of companies with revenue less than the lowest revenue of any manufacturer in Austin?\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM manufacturers WHERE revenue < (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin')"} {"question": "List the clubs that have at least a member with advisor '1121'.\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121"} {"question": "What are the titles of films that are either longer than 100 minutes or rated PG other than those that cost more than 200 to replace?\nAdditional table information: table: sakila_1", "answer": "SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200"} {"question": "Find all the campuses opened in 1958.\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE YEAR = 1958"} {"question": "Return the themes of farm competitions, sorted by year ascending.\nAdditional table information: table: farm", "answer": "SELECT Theme FROM farm_competition ORDER BY YEAR ASC NULLS FIRST"} {"question": "Find the title of course that is provided by both Statistics and Psychology departments.\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'"} {"question": "Find the name of dorms that do not have amenity TV Lounge.\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'"} {"question": "What is the description of the color for most products?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the names of patients who have made appointments.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn"} {"question": "Which vocal type did the musician with last name 'Heilo' played in the song with title 'Der Kapitan'?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = 'Heilo' AND T2.title = 'Der Kapitan'"} {"question": "What are the personal names used both by some course authors and some students?\nAdditional table information: table: e_learning", "answer": "SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students"} {"question": "For each manufacturer name, what are the names and prices of their most expensive product?\nAdditional table information: table: manufactory_1", "answer": "SELECT T1.Name, MAX(T1.Price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name"} {"question": "How many events did not have any participants?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events)"} {"question": "What is the last date that a staff member left a project?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1"} {"question": "Count the number of courses with more than 2 credits.\nAdditional table information: table: college_3", "answer": "SELECT COUNT(*) FROM COURSE WHERE Credits > 2"} {"question": "What are total transaction amounts for each transaction type?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT transaction_type, SUM(transaction_amount) FROM Financial_transactions GROUP BY transaction_type"} {"question": "What are the ids and trade names of the medicine that can interact with at least 3 enzymes?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3"} {"question": "Find the accreditation level that more than 3 phones use.\nAdditional table information: table: phone_1", "answer": "SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING COUNT(*) > 3"} {"question": "Return the names and locations of shops, ordered by name in alphabetical order.\nAdditional table information: table: device", "answer": "SELECT Shop_Name, LOCATION FROM shop ORDER BY Shop_Name ASC NULLS FIRST"} {"question": "Which problem id and log id are assigned to the staff named Rylan Homenick?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = 'Rylan' AND T1.staff_last_name = 'Homenick'"} {"question": "How many parks are there in Atlanta city?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM park WHERE city = 'Atlanta'"} {"question": "What are the ids of all male students who do not play football?\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = 'Football'"} {"question": "What is the name of the aircraft that has won an award the most?\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the fleet series of the aircrafts flied by pilots younger than 34\nAdditional table information: table: pilot_record", "answer": "SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34"} {"question": "What is the product ID of the most frequently ordered item on invoices?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the the lesson ids of all staff taught by Janessa Sawayn whose nickname has the letter s?\nAdditional table information: table: driving_school", "answer": "SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn' AND nickname LIKE '%s%'"} {"question": "How many allergy entries are there?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(DISTINCT allergy) FROM Allergy_type"} {"question": "List the branch name and city without any registered members.\nAdditional table information: table: shop_membership", "answer": "SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch)"} {"question": "Show the movie titles and book titles for all companies in China.\nAdditional table information: table: culture_company", "answer": "SELECT T1.title, T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'"} {"question": "What are the names of the storms that affected both the regions of Afghanistan and Albania?\nAdditional table information: table: storm_record", "answer": "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'"} {"question": "Find the last and first name of students who are playing Football or Lacrosse.\nAdditional table information: table: game_1", "answer": "SELECT T2.lname, T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = 'Football' OR T1.SportName = 'Lacrosse'"} {"question": "Which clubs have one or more members from the city with code 'HOU'? Give me the names of the clubs.\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = 'HOU'"} {"question": "What is the age of student Linda Smith?\nAdditional table information: table: restaurant_1", "answer": "SELECT Age FROM Student WHERE Fname = 'Linda' AND Lname = 'Smith'"} {"question": "What are the last names and ages of the students who are allergic to milk and cat?\nAdditional table information: table: allergy_1", "answer": "SELECT lname, age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = 'Milk' INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = 'Cat')"} {"question": "What are the names and balances of checking accounts belonging to the customer with the lowest savings balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance NULLS FIRST LIMIT 1"} {"question": "Find the subject ID, subject name, and the corresponding number of available courses for each subject.\nAdditional table information: table: e_learning", "answer": "SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id"} {"question": "How many instructors teach a course in the Spring of 2010?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "What is the first name, gpa and phone number of the top 5 students with highest gpa?\nAdditional table information: table: college_1", "answer": "SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5"} {"question": "Who is the founders of companies whose first letter is S?\nAdditional table information: table: manufactory_1", "answer": "SELECT founder FROM manufacturers WHERE name LIKE 'S%'"} {"question": "List all information regarding the basketball match.\nAdditional table information: table: university_basketball", "answer": "SELECT * FROM basketball_match"} {"question": "What is the name of the highest rated wine?\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE ORDER BY Score NULLS FIRST LIMIT 1"} {"question": "Show all ministers who do not belong to Progress Party.\nAdditional table information: table: party_people", "answer": "SELECT minister FROM party WHERE party_name <> 'Progress Party'"} {"question": "What are the names of all the playlists?\nAdditional table information: table: store_1", "answer": "SELECT name FROM playlists"} {"question": "How many clubs does the student named 'Eric Tai' belong to?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Eric' AND t3.lname = 'Tai'"} {"question": "What is the founded year of the non public school that was founded most recently?\nAdditional table information: table: university_basketball", "answer": "SELECT founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC LIMIT 1"} {"question": "Find the name of the customer that has been involved in the most policies.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the address and staff number of the shops that do not have any happy hour.\nAdditional table information: table: coffee_shop", "answer": "SELECT address, num_of_staff FROM shop WHERE NOT shop_id IN (SELECT shop_id FROM happy_hour)"} {"question": "How many students are 18 years old?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student WHERE age = 18"} {"question": "Return the name of the mountain with the greatest height.\nAdditional table information: table: climbing", "answer": "SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1"} {"question": "What is the last name of the youngest student?\nAdditional table information: table: allergy_1", "answer": "SELECT LName FROM Student WHERE age = (SELECT MIN(age) FROM Student)"} {"question": "What are the ids of all the employees who have destroyed documents?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "How many different majors are there and how many different city codes are there for each student?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student"} {"question": "How many male students (sex is 'M') are allergic to any type of food?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student WHERE sex = 'M' AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'food')"} {"question": "What are the names of cities that are in the county with the most police officers?\nAdditional table information: table: county_public_safety", "answer": "SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1)"} {"question": "Which customers made orders between 2009-01-01 and 2010-01-01? Find their names.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= '2009-01-01' AND T2.date_order_placed <= '2010-01-01'"} {"question": "Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company.\nAdditional table information: table: phone_1", "answer": "SELECT Company_name, COUNT(*) FROM phone GROUP BY Company_name ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Show locations and nicknames of schools.\nAdditional table information: table: school_player", "answer": "SELECT T1.Location, T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID"} {"question": "Which city lives most of staffs? List the city name and number of staffs.\nAdditional table information: table: driving_school", "answer": "SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the description of the service type which offers both the photo product and the film product?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'"} {"question": "What is the last name and office of the professor from the history department?\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'"} {"question": "What are the distinct years in which the competitions type is not 'Tournament'?\nAdditional table information: table: sports_competition", "answer": "SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> 'Tournament'"} {"question": "Show the dates, places, and names of events in descending order of the attendance.\nAdditional table information: table: news_report", "answer": "SELECT Date, Name, venue FROM event ORDER BY Event_Attendance DESC"} {"question": "Show the location name and code with the least documents.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.location_name, T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What are the names of the ships that are from either the US or the UK?\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship WHERE Nationality = 'United States' OR Nationality = 'United Kingdom'"} {"question": "Find the phone numbers of customers using the most common policy type among the available policies.\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "List the names of courses in alphabetical order?\nAdditional table information: table: student_assessment", "answer": "SELECT course_name FROM courses ORDER BY course_name NULLS FIRST"} {"question": "What is the mail date of the document with id 7?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7"} {"question": "Please list all songs in volumes in ascending alphabetical order.\nAdditional table information: table: music_4", "answer": "SELECT Song FROM volume ORDER BY Song NULLS FIRST"} {"question": "A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size.\nAdditional table information: table: store_1", "answer": "SELECT billing_country, SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8"} {"question": "Show each student's first name and last name.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT firstname, lastname FROM list"} {"question": "What is the name and detail of each staff member?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Name, Other_Details FROM Staff"} {"question": "What are the names of wrestlers and their teams in elimination, ordered descending by days held?\nAdditional table information: table: wrestler", "answer": "SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC"} {"question": "What is the total amount of moeny paid by the customer Carole Bernhard?\nAdditional table information: table: driving_school", "answer": "SELECT SUM(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Carole' AND T2.last_name = 'Bernhard'"} {"question": "Show all advisors and corresponding number of students.\nAdditional table information: table: allergy_1", "answer": "SELECT advisor, COUNT(*) FROM Student GROUP BY advisor"} {"question": "Find the full name of the customer with the email 'luisg@embraer.com.br'.\nAdditional table information: table: chinook_1", "answer": "SELECT FirstName, LastName FROM CUSTOMER WHERE Email = 'luisg@embraer.com.br'"} {"question": "Which address has both members younger than 30 and members older than 40?\nAdditional table information: table: coffee_shop", "answer": "SELECT address FROM member WHERE age < 30 INTERSECT SELECT address FROM member WHERE age > 40"} {"question": "Show the details and star ratings of the 3 least expensive hotels.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT other_hotel_details, star_rating_code FROM HOTELS ORDER BY price_range ASC NULLS FIRST LIMIT 3"} {"question": "What are the names of tracks that contain the the word you in them?\nAdditional table information: table: chinook_1", "answer": "SELECT Name FROM TRACK WHERE Name LIKE '%you%'"} {"question": "List the email addresses of the drama workshop groups located in Alaska state.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = 'Alaska'"} {"question": "List the companies and the investors of entrepreneurs.\nAdditional table information: table: entrepreneur", "answer": "SELECT Company, Investor FROM entrepreneur"} {"question": "Retrieve the title of the paper that has the largest number of authors.\nAdditional table information: table: icfp_1", "answer": "SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship)"} {"question": "What are the names of all employees who are not certified to fly Boeing 737-800s?\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Boeing 737-800'"} {"question": "Find the names of swimmers who has a result of 'win'.\nAdditional table information: table: swimming", "answer": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'"} {"question": "What are the different ages of editors? Show each age along with the number of editors of that age.\nAdditional table information: table: journal_committee", "answer": "SELECT Age, COUNT(*) FROM editor GROUP BY Age"} {"question": "What are the famous titles of artists who do not have any volumes?\nAdditional table information: table: music_4", "answer": "SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume)"} {"question": "How many students, on average, does each college have enrolled?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(enr) FROM College"} {"question": "What are the types of competition that have most 5 competitions for that type?\nAdditional table information: table: sports_competition", "answer": "SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5"} {"question": "Find the name, city, and country of the airport that has the highest latitude.\nAdditional table information: table: flight_4", "answer": "SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1"} {"question": "What are the distinct billing countries of the invoices?\nAdditional table information: table: chinook_1", "answer": "SELECT DISTINCT (BillingCountry) FROM INVOICE"} {"question": "What are the enrollments of schools whose denomination is not 'Catholic'?\nAdditional table information: table: school_player", "answer": "SELECT Enrollment FROM school WHERE Denomination <> 'Catholic'"} {"question": "Show the names of clubs that have players with position 'Right Wing'.\nAdditional table information: table: sports_competition", "answer": "SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = 'Right Wing'"} {"question": "Find the titles of all movies that have no ratings.\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating)"} {"question": "Which team offers the lowest average salary? Give me the name and id of the team.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name, T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY AVG(T2.salary) ASC NULLS FIRST LIMIT 1"} {"question": "What are the names and year of joining for artists that do not have the country 'United States'?\nAdditional table information: table: theme_gallery", "answer": "SELECT name, year_join FROM artist WHERE country <> 'United States'"} {"question": "What are the distinct unit prices of all tracks?\nAdditional table information: table: chinook_1", "answer": "SELECT DISTINCT (UnitPrice) FROM TRACK"} {"question": "Find the location and all games score of the school that has Clemson as its team name.\nAdditional table information: table: university_basketball", "answer": "SELECT t2.All_Games, t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'"} {"question": "What is the decor of room Recluse and defiance?\nAdditional table information: table: inn_1", "answer": "SELECT decor FROM Rooms WHERE roomName = 'Recluse and defiance'"} {"question": "What are the states with colleges that have enrollments less than the some other college?\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college)"} {"question": "What are the details of the three most expensive hotels?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3"} {"question": "Find the detail of products whose detail contains the word 'Latte' or the word 'Americano'\nAdditional table information: table: customers_and_addresses", "answer": "SELECT product_details FROM products WHERE product_details LIKE '%Latte%' OR product_details LIKE '%Americano%'"} {"question": "How many medicines were not approved by the FDA?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT COUNT(*) FROM medicine WHERE FDA_approved = 'No'"} {"question": "Find the name of people whose age is greater than any engineer sorted by their age.\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age NULLS FIRST"} {"question": "What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'?\nAdditional table information: table: local_govt_mdm", "answer": "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'"} {"question": "What are the names of shops that do not have any devices in stock?\nAdditional table information: table: device", "answer": "SELECT Shop_Name FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM stock)"} {"question": "List the name and the number of enrolled student for each course.\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name"} {"question": "Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000.\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000"} {"question": "What is the first and last name of the professor in biology department?\nAdditional table information: table: college_1", "answer": "SELECT T3.EMP_FNAME, T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = 'Biology'"} {"question": "How many storms had death records?\nAdditional table information: table: storm_record", "answer": "SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0"} {"question": "Who are the players from UCLA?\nAdditional table information: table: match_season", "answer": "SELECT Player FROM match_season WHERE College = 'UCLA'"} {"question": "Find the country of all appelations who have at most three wines.\nAdditional table information: table: wine_1", "answer": "SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING COUNT(*) <= 3"} {"question": "What are the official names of cities that have population over 1500 or less than 500?\nAdditional table information: table: farm", "answer": "SELECT Official_Name FROM city WHERE Population > 1500 OR Population < 500"} {"question": "What is the name and distance for the aircraft that has an id of 12?\nAdditional table information: table: flight_1", "answer": "SELECT name, distance FROM Aircraft WHERE aid = 12"} {"question": "Count the number of items store 1 has in stock.\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM inventory WHERE store_id = 1"} {"question": "Return the names of songs for which format is mp3 and resolution is below 1000.\nAdditional table information: table: music_1", "answer": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = 'mp3' INTERSECT SELECT song_name FROM song WHERE resolution < 1000"} {"question": "Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.\nAdditional table information: table: protein_institute", "answer": "SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000"} {"question": "What are the names of the songs whose title has the word 'the'?\nAdditional table information: table: music_2", "answer": "SELECT title FROM songs WHERE title LIKE '% the %'"} {"question": "What are the titles of films and corresponding types of market estimations?\nAdditional table information: table: film_rank", "answer": "SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID"} {"question": "Show the county name and population of all counties.\nAdditional table information: table: election", "answer": "SELECT County_name, Population FROM county"} {"question": "Return all distinct detention type codes.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT DISTINCT detention_type_code FROM Detention"} {"question": "Show all distinct positions of matches.\nAdditional table information: table: match_season", "answer": "SELECT DISTINCT POSITION FROM match_season"} {"question": "Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones.\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = 'Simon Woodroffe' OR T1.Investor = 'Peter Jones'"} {"question": "Which counties have two or more delegates? Give me the county names.\nAdditional table information: table: election", "answer": "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"} {"question": "Show all movie titles, years, and directors, ordered by budget.\nAdditional table information: table: culture_company", "answer": "SELECT title, YEAR, director FROM movie ORDER BY budget_million NULLS FIRST"} {"question": "Show the id and details of the investor that has the largest number of transactions.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the last date of the staff leaving the projects?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1"} {"question": "Find the average room count of the apartments that have the 'Studio' type code.\nAdditional table information: table: apartment_rentals", "answer": "SELECT AVG(room_count) FROM Apartments WHERE apt_type_code = 'Studio'"} {"question": "What are the booking start and end dates of the apartments with type code 'Duplex'?\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = 'Duplex'"} {"question": "What is the location of the party with the most hosts?\nAdditional table information: table: party_host", "answer": "SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1"} {"question": "List all the model names sorted by their launch year.\nAdditional table information: table: phone_1", "answer": "SELECT model_name FROM chip_model ORDER BY launch_year NULLS FIRST"} {"question": "Find the average prices of all products from each manufacture, and list each company's name.\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name"} {"question": "How many documents can one grant have at most? List the grant id and number.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM College WHERE enr > 18000 ORDER BY cName NULLS FIRST"} {"question": "Find the names of goods that receive a rating of 10.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating = 10"} {"question": "How many films are there in each category? List the genre name, genre id and the count.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id"} {"question": "What are the dates of the latest logon of the students with family name 'Jaskolski' or 'Langosh'?\nAdditional table information: table: e_learning", "answer": "SELECT date_of_latest_logon FROM Students WHERE family_name = 'Jaskolski' OR family_name = 'Langosh'"} {"question": "Show the addresses of the buildings that have apartments with more than 2 bathrooms.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2"} {"question": "What is the name and date of the most recent race?\nAdditional table information: table: formula_1", "answer": "SELECT name, date FROM races ORDER BY date DESC LIMIT 1"} {"question": "What is the average number of cities of markets with low film market estimate bigger than 10000?\nAdditional table information: table: film_rank", "answer": "SELECT AVG(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000"} {"question": "What are all role codes?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT role_code FROM ROLES"} {"question": "Show the studios that have produced films with director 'Nicholas Meyer' and 'Walter Hill'.\nAdditional table information: table: film_rank", "answer": "SELECT Studio FROM film WHERE Director = 'Nicholas Meyer' INTERSECT SELECT Studio FROM film WHERE Director = 'Walter Hill'"} {"question": "what are the order id and customer id of the oldest order?\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id, customer_id FROM orders ORDER BY date_order_placed NULLS FIRST LIMIT 1"} {"question": "Show names of actors in descending order of the year their musical is awarded.\nAdditional table information: table: musical", "answer": "SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID ORDER BY T2.Year DESC"} {"question": "What are the average ages for male and female students?\nAdditional table information: table: allergy_1", "answer": "SELECT AVG(age), sex FROM Student GROUP BY sex"} {"question": "Find the first and last name of all the teachers that teach EVELINA BROMLEY.\nAdditional table information: table: student_1", "answer": "SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'EVELINA' AND T1.lastname = 'BROMLEY'"} {"question": "What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163)"} {"question": "Find the year in which the least people enter hall of fame.\nAdditional table information: table: baseball_1", "answer": "SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What are the last names of customers without invoice totals exceeding 20?\nAdditional table information: table: chinook_1", "answer": "SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20"} {"question": "What are the names of all directors whose movies have been reviewed by Sarah Martinez?\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez'"} {"question": "Find the email and phone number of the customers who have never filed a complaint before.\nAdditional table information: table: customer_complaints", "answer": "SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)"} {"question": "Find the famous titles of artists that do not have any volume.\nAdditional table information: table: music_4", "answer": "SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume)"} {"question": "Count the number of different directors.\nAdditional table information: table: culture_company", "answer": "SELECT COUNT(DISTINCT director) FROM movie"} {"question": "Give the full name and customer id of the customer with the fewest accounts.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T2.customer_first_name, T2.customer_last_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Which bike traveled the most often in zip code 94002?\nAdditional table information: table: bike_1", "answer": "SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of trains starting from each origin.\nAdditional table information: table: station_weather", "answer": "SELECT origin, COUNT(*) FROM train GROUP BY origin"} {"question": "Which country has at most 3 stadiums listed?\nAdditional table information: table: swimming", "answer": "SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3"} {"question": "what is the powertrain (engine/transmission) when the order year is 2000? \nAdditional table information: table: \"vehicles\".\"cars\"\ncolumns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion", "answer": "SELECT powertrain FROM \"vehicles\".\"cars\" WHERE order_year = '2000'"} {"question": "What is the id of the organization with the maximum number of outcomes and how many outcomes are there?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find id of candidates whose assessment code is 'Pass'?\nAdditional table information: table: student_assessment", "answer": "SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = 'Pass'"} {"question": "Which buildings have more than one company offices? Give me the building names.\nAdditional table information: table: company_office", "answer": "SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1"} {"question": "What is the type description of the organization whose detail is listed as 'quo'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'"} {"question": "What are the names of all the states with college students playing in the mid position but no goalies?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'"} {"question": "Show all locations and the total number of platforms and passengers for all train stations in each location.\nAdditional table information: table: train_station", "answer": "SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION"} {"question": "Show the id and details for the investors who have the top 3 number of transactions.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What campus started in year 1956, has more than 200 full time students, and more than 400 students enrolled?\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200"} {"question": "Find the names of courses taught by the tutor who has personal name 'Julio'.\nAdditional table information: table: e_learning", "answer": "SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = 'Julio'"} {"question": "Who belong to the institution 'University of Oxford'? Show the first names and last names.\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'University of Oxford'"} {"question": "Which buildings does 'Emma' manage? Give me the short names of the buildings.\nAdditional table information: table: apartment_rentals", "answer": "SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = 'Emma'"} {"question": "Which customer's name contains 'Alex'? Find the full name.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers WHERE customer_name LIKE '%Alex%'"} {"question": "Find the address of all customers that live in Germany and have invoice.\nAdditional table information: table: chinook_1", "answer": "SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = 'Germany'"} {"question": "What is the total amount of settlement made for all the settlements?\nAdditional table information: table: insurance_policies", "answer": "SELECT SUM(Amount_Settled) FROM Settlements"} {"question": "For each movie that received more than 3 reviews, what is the average rating?\nAdditional table information: table: movie_1", "answer": "SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2"} {"question": "Which papers have the substring 'ML' in their titles? Return the titles of the papers.\nAdditional table information: table: icfp_1", "answer": "SELECT title FROM papers WHERE title LIKE '%ML%'"} {"question": "Give me the detail and opening hour for each museum.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Museum_Details, T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID"} {"question": "What is the number of technicians?\nAdditional table information: table: machine_repair", "answer": "SELECT COUNT(*) FROM technician"} {"question": "Which trip started from the station with the largest dock count? Give me the trip id.\nAdditional table information: table: bike_1", "answer": "SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1"} {"question": "Return the claim start date for the claims whose claimed amount is no more than the average\nAdditional table information: table: insurance_policies", "answer": "SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims)"} {"question": "Find the titles and studios of the films that are produced by some film studios that contained the word 'Universal'.\nAdditional table information: table: film_rank", "answer": "SELECT title, Studio FROM film WHERE Studio LIKE '%Universal%'"} {"question": "How many male (sex is M) students have class senator votes in the fall election cycle?\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = 'M' AND T2.Election_Cycle = 'Fall'"} {"question": "What are the first names of all students who live in the dorm with the most amenities?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What are the different names of the genres?\nAdditional table information: table: store_1", "answer": "SELECT DISTINCT name FROM genres"} {"question": "Which customers do not have a first notification of loss record? Give me the customer names.\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id"} {"question": "Show the transaction type and the number of transactions.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT transaction_type, COUNT(*) FROM Financial_transactions GROUP BY transaction_type"} {"question": "What are the first names of the professors who do not play Canoeing or Kayaking as activities?\nAdditional table information: table: activity_1", "answer": "SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'"} {"question": "Who are the top 3 players in terms of overall rating?\nAdditional table information: table: soccer_1", "answer": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3"} {"question": "Show the average age for male and female students.\nAdditional table information: table: allergy_1", "answer": "SELECT AVG(age), sex FROM Student GROUP BY sex"} {"question": "What is the apartment number of the apartment with the most beds?\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1"} {"question": "What are the average amount purchased and value purchased for the supplier who supplies the most products.\nAdditional table information: table: department_store", "answer": "SELECT AVG(total_amount_purchased), AVG(total_value_purchased) FROM Product_Suppliers WHERE supplier_id = (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "Which city has the highest temperature in February?\nAdditional table information: table: city_record", "answer": "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"} {"question": "Show all locations with only 1 station.\nAdditional table information: table: train_station", "answer": "SELECT LOCATION FROM station GROUP BY LOCATION HAVING COUNT(*) = 1"} {"question": "Return the elimination movies of wrestlers on Team Orton.\nAdditional table information: table: wrestler", "answer": "SELECT Elimination_Move FROM Elimination WHERE Team = 'Team Orton'"} {"question": "What is the payment method of the customer that has purchased the least quantity of items?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) NULLS FIRST LIMIT 1"} {"question": "Which publishers did not publish a book in 1989?\nAdditional table information: table: culture_company", "answer": "SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989"} {"question": "How many entrepreneurs correspond to each investor?\nAdditional table information: table: entrepreneur", "answer": "SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor"} {"question": "What are the positions of players whose average number of points scored by that position is larger than 20?\nAdditional table information: table: sports_competition", "answer": "SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20"} {"question": "Which city is post code 255 located in?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT city FROM addresses WHERE zip_postcode = 255"} {"question": "What are the job ids for jobs done more than once for a period of more than 300 days?\nAdditional table information: table: hr_1", "answer": "SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2"} {"question": "What are the names of all pilots listed by descending age?\nAdditional table information: table: aircraft", "answer": "SELECT Name FROM pilot ORDER BY Age DESC"} {"question": "What is the total share (in percent) of all the channels owned by CCTV?\nAdditional table information: table: program_share", "answer": "SELECT SUM(Share_in_percent) FROM channel WHERE OWNER = 'CCTV'"} {"question": "What are the names of regions that were affected by the storm in which the most people died?\nAdditional table information: table: storm_record", "answer": "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"} {"question": "List all statement ids and statement details.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT STATEMENT_ID, statement_details FROM Statements"} {"question": "How many markets have number of cities smaller than 300?\nAdditional table information: table: film_rank", "answer": "SELECT COUNT(*) FROM market WHERE Number_cities < 300"} {"question": "display the job title of jobs which minimum salary is greater than 9000.\nAdditional table information: table: hr_1", "answer": "SELECT job_title FROM jobs WHERE min_salary > 9000"} {"question": "For each party, return the name of the party and the number of delegates from that party.\nAdditional table information: table: election", "answer": "SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party"} {"question": "What are the first names of the teachers who teach grade 1?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1"} {"question": "What are the titles of all movies that have between 3 and 5 stars?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5"} {"question": "What are the titles of courses that are in the Statistics department but not the Psychology department?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'"} {"question": "List the names of counties in descending order of population.\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM county_public_safety ORDER BY Population DESC"} {"question": "What is the last name of the musician that have produced the most number of songs?\nAdditional table information: table: music_2", "answer": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many songs were released for each format?\nAdditional table information: table: music_1", "answer": "SELECT COUNT(*), formats FROM files GROUP BY formats"} {"question": "Report the first name and last name of all the students.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT firstname, lastname FROM list"} {"question": "What is the first, last name, gpa of the youngest one among students whose GPA is above 3?\nAdditional table information: table: college_1", "answer": "SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1"} {"question": "Return the ids of the two department store chains with the most department stores.\nAdditional table information: table: department_store", "answer": "SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY COUNT(*) DESC LIMIT 2"} {"question": "Find the oldest log id and its corresponding problem id.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_log_id, problem_id FROM problem_log ORDER BY log_entry_date NULLS FIRST LIMIT 1"} {"question": "What are the employee ids for employees who have held two or more jobs?\nAdditional table information: table: hr_1", "answer": "SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2"} {"question": "How many airports haven't the pilot 'Thompson' driven an aircraft?\nAdditional table information: table: flight_company", "answer": "SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson')"} {"question": "How many different types of transactions are there?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(DISTINCT transaction_type) FROM Financial_Transactions"} {"question": "Which authors have last name 'Ueno'? List their first names.\nAdditional table information: table: icfp_1", "answer": "SELECT fname FROM authors WHERE lname = 'Ueno'"} {"question": "Find the city where the most customers live.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the average population of all counties.\nAdditional table information: table: election", "answer": "SELECT AVG(Population) FROM county"} {"question": "find the ids of reviewers who did not give 4 star.\nAdditional table information: table: movie_1", "answer": "SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4"} {"question": "Count the number of colors that are not used in any products.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)"} {"question": "Show the album names, ids and the number of tracks for each album.\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Title, T2.AlbumID, COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID"} {"question": "What is the payment method code used by the most orders?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the first and last name of students whose age is younger than the average age.\nAdditional table information: table: dorm_1", "answer": "SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student)"} {"question": "Which cities have served as host cities more than once? Return me their GDP and population.\nAdditional table information: table: city_record", "answer": "SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING COUNT(*) > 1"} {"question": "What are all the fault descriptions and the fault status of all the faults recoreded in the logs?\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.fault_description, T2.fault_status FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id"} {"question": "How many different players trained for more than 1000 hours?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM Player WHERE HS > 1000"} {"question": "How many states have smaller colleges than average?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)"} {"question": "Report the number of students in each classroom.\nAdditional table information: table: student_1", "answer": "SELECT classroom, COUNT(*) FROM list GROUP BY classroom"} {"question": "What are the names of customers who have both savings and checking accounts?\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'"} {"question": "List the id of students who registered some courses and the number of their registered courses?\nAdditional table information: table: student_assessment", "answer": "SELECT T1.student_id, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id"} {"question": "What are the ids for transactions that have an amount greater than the average amount of a transaction?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT AVG(transaction_amount) FROM Financial_transactions)"} {"question": "What are the names of cities, as well as the names of the counties they correspond to?\nAdditional table information: table: county_public_safety", "answer": "SELECT T1.Name, T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID"} {"question": "Return the id of the store with the most customers.\nAdditional table information: table: sakila_1", "answer": "SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How much is the track Fast As a Shark?\nAdditional table information: table: store_1", "answer": "SELECT unit_price FROM tracks WHERE name = 'Fast As a Shark'"} {"question": "What is the id of the order which has the most items?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the total horses record for each farm, sorted ascending?\nAdditional table information: table: farm", "answer": "SELECT Total_Horses FROM farm ORDER BY Total_Horses ASC NULLS FIRST"} {"question": "What is the title and director for the movie with highest worldwide gross in the year 2000 or before?\nAdditional table information: table: culture_company", "answer": "SELECT title, director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1"} {"question": "What is the average age of students who have city code 'NYC' and have secretary votes for the spring election cycle?\nAdditional table information: table: voter_2", "answer": "SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = 'NYC' AND T2.Election_Cycle = 'Spring'"} {"question": "What are the id and first name of the student whose addresses have the highest average monthly rental?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.student_id, T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1"} {"question": "Show all information about each body builder.\nAdditional table information: table: body_builder", "answer": "SELECT * FROM body_builder"} {"question": "What are the total enrollments of universities of each affiliation type?\nAdditional table information: table: university_basketball", "answer": "SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation"} {"question": "What are the ids and names of department stores with both marketing and managing departments?\nAdditional table information: table: department_store", "answer": "SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = 'marketing' INTERSECT SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = 'managing'"} {"question": "Show the start dates and end dates of all the apartment bookings made by guests with gender code 'Female'.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = 'Female'"} {"question": "Show each county along with the number of schools and total enrollment in each county.\nAdditional table information: table: school_finance", "answer": "SELECT county, COUNT(*), SUM(enrollment) FROM school GROUP BY county"} {"question": "What are the positions and teams of pilots?\nAdditional table information: table: pilot_record", "answer": "SELECT POSITION, Team FROM pilot"} {"question": "What are the product ids and color descriptions for products with two or more characteristics?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.product_id, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING COUNT(*) >= 2"} {"question": "What is the type of video game Call of Destiny.\nAdditional table information: table: game_1", "answer": "SELECT gtype FROM Video_games WHERE gname = 'Call of Destiny'"} {"question": "What are the card numbers, names, and hometowns of every member ordered by descending level?\nAdditional table information: table: shop_membership", "answer": "SELECT card_number, name, hometown FROM member ORDER BY LEVEL DESC"} {"question": "Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.\nAdditional table information: table: tracking_orders", "answer": "SELECT invoice_number FROM invoices WHERE invoice_date < '1989-09-03' OR invoice_date > '2007-12-25'"} {"question": "What are the distinct last names of the students who have class president votes?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE"} {"question": "Find the student ID and middle name for all the students with at most two enrollments.\nAdditional table information: table: e_learning", "answer": "SELECT T1.student_id, T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2"} {"question": "Find the first and last name of the author(s) who wrote the paper 'Nameless, Painless'.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = 'Nameless , Painless'"} {"question": "What is the membership card held by both members living in Hartford and ones living in Waterbury address?\nAdditional table information: table: coffee_shop", "answer": "SELECT membership_card FROM member WHERE address = 'Hartford' INTERSECT SELECT membership_card FROM member WHERE address = 'Waterbury'"} {"question": "What are the distinct salaries of all instructors who earned less than the maximum salary?\nAdditional table information: table: college_2", "answer": "SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT MAX(salary) FROM instructor)"} {"question": "For each product type, return the maximum and minimum price.\nAdditional table information: table: department_store", "answer": "SELECT product_type_code, MAX(product_price), MIN(product_price) FROM products GROUP BY product_type_code"} {"question": "When was the document named 'Marry CV' stored? Give me the date.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT date_stored FROM All_documents WHERE Document_name = 'Marry CV'"} {"question": "What is the count of distinct employees with certificates?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(DISTINCT eid) FROM Certificate"} {"question": "Return the full names and salaries of employees with null commissions.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary FROM employees WHERE commission_pct = 'null'"} {"question": "What are the flight numbers for the aircraft Airbus A340-300?\nAdditional table information: table: flight_1", "answer": "SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = 'Airbus A340-300'"} {"question": "What are the names and ids of the different albums, and how many tracks are on each?\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Title, T2.AlbumID, COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID"} {"question": "How many faculty members does each building have? List the result with the name of the building.\nAdditional table information: table: activity_1", "answer": "SELECT building, COUNT(*) FROM Faculty GROUP BY building"} {"question": "Find the different first names and cities of the students who have allergy to milk or cat.\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT T1.fname, T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = 'Milk' OR T2.Allergy = 'Cat'"} {"question": "How many transaction does each account have? Show the number and account id.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*), account_id FROM Financial_transactions"} {"question": "List the number of invoices from Chicago, IL.\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM invoices WHERE billing_city = 'Chicago' AND billing_state = 'IL'"} {"question": "What is the maximum Online Mendelian Inheritance in Man (OMIM) value of the enzymes?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT MAX(OMIM) FROM enzyme"} {"question": "Show the location codes with at least 3 documents.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code FROM Document_locations GROUP BY location_code HAVING COUNT(*) >= 3"} {"question": "List ids for all student who are on scholarship.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'"} {"question": "Show names of companies and that of employees in descending order of number of years working for that employee.\nAdditional table information: table: company_employee", "answer": "SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working NULLS FIRST"} {"question": "Find the number of female students (with F sex) living in Smith Hall\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F'"} {"question": "What instruments does the the song 'Le Pop' use?\nAdditional table information: table: music_2", "answer": "SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'"} {"question": "How many video games exist?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(*) FROM Video_games"} {"question": "Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.\nAdditional table information: table: performance_attendance", "answer": "SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000"} {"question": "Find the emails of parties with the most popular party form.\nAdditional table information: table: e_government", "answer": "SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "Give the names of people who did not participate in the candidate election.\nAdditional table information: table: candidate_poll", "answer": "SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate)"} {"question": "Give the name of the highest paid instructor.\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor ORDER BY salary DESC LIMIT 1"} {"question": "Find the id and name of the staff who has been assigned for the shortest period.\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_id, T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from NULLS FIRST LIMIT 1"} {"question": "Show all distinct product categories along with the number of mailshots in each category.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT product_category, COUNT(*) FROM mailshot_campaigns GROUP BY product_category"} {"question": "What is the description of the restaurant type Sandwich?\nAdditional table information: table: restaurant_1", "answer": "SELECT ResTypeDescription FROM Restaurant_Type WHERE ResTypeName = 'Sandwich'"} {"question": "What is the first name of students who got grade C in any class?\nAdditional table information: table: college_1", "answer": "SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'"} {"question": "What are the last name and office of all history professors?\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'"} {"question": "List the text of all tweets in the order of date.\nAdditional table information: table: twitter_1", "answer": "SELECT text FROM tweets ORDER BY createdate NULLS FIRST"} {"question": "Show the name and phone for customers with a mailshot with outcome code 'No Response'.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response'"} {"question": "How many players did Boston Red Stockings have in 2000?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000"} {"question": "How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT SUM(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "What are the names of banks in the state of New York?\nAdditional table information: table: loan_1", "answer": "SELECT bname FROM bank WHERE state = 'New York'"} {"question": "Please show the songs that have result 'nominated' at music festivals.\nAdditional table information: table: music_4", "answer": "SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = 'Nominated'"} {"question": "What are the account ids, customer ids, and account names for all the accounts?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT account_id, customer_id, account_name FROM Accounts"} {"question": "display all the information of those employees who did not have any job in the past.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE NOT employee_id IN (SELECT employee_id FROM job_history)"} {"question": "Return the number of accounts that the customer with the first name Art and last name Turcotte has.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Art' AND T2.customer_last_name = 'Turcotte'"} {"question": "How many invoices do we have?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Invoices"} {"question": "Find the names of all instructors whose name includes the substring \u201cdar\u201d.\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE name LIKE '%dar%'"} {"question": "What is the minimum and maximum number of bathrooms of all the apartments?\nAdditional table information: table: apartment_rentals", "answer": "SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments"} {"question": "List all public schools and their locations.\nAdditional table information: table: university_basketball", "answer": "SELECT school, LOCATION FROM university WHERE affiliation = 'Public'"} {"question": "find the name of pilots who did not win the matches held in the country of Australia.\nAdditional table information: table: aircraft", "answer": "SELECT name FROM pilot WHERE NOT pilot_id IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')"} {"question": "What are the student IDs and middle names of the students enrolled in at most two courses?\nAdditional table information: table: e_learning", "answer": "SELECT T1.student_id, T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2"} {"question": "Show all locations where a gas station for company with market value greater than 100 is located.\nAdditional table information: table: gas_company", "answer": "SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100"} {"question": "List the names and phone numbers of all the distinct suppliers who supply red jeans.\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = 'red jeans'"} {"question": "What are the names of the songs that do not have back vocals?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = 'back'"} {"question": "Which customers have an insurance policy with the type code 'Deputy' or 'Uniform'? Return the customer details.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = 'Deputy' OR t1.policy_type_code = 'Uniform'"} {"question": "Of complaints with the type code 'Product Failure', how many had each different status code?\nAdditional table information: table: customer_complaints", "answer": "SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = 'Product Failure' GROUP BY complaint_status_code"} {"question": "Find the name of the teacher who teaches the largest number of students.\nAdditional table information: table: student_1", "answer": "SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname, T2.lastname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the titles of the papers the author 'Stephanie Weirich' wrote.\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Stephanie' AND t1.lname = 'Weirich'"} {"question": "Find the first and last name of the staff members who reported problems from the product 'rem' but not 'aut'?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1, product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = 'rem' EXCEPT SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1, product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = 'aut'"} {"question": "What is the most common status across all cities?\nAdditional table information: table: farm", "answer": "SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the bank branch that has lended the largest total amount in loans, specifically to customers with credit scores below 100?\nAdditional table information: table: loan_1", "answer": "SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY SUM(T1.amount) DESC LIMIT 1"} {"question": "What is the total budget amount for school 'Glenn' in all years?\nAdditional table information: table: school_finance", "answer": "SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'"} {"question": "Which role is most common for the staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average ticket sales gross in dollars of films?\nAdditional table information: table: film_rank", "answer": "SELECT AVG(Gross_in_dollar) FROM film"} {"question": "List all media types.\nAdditional table information: table: store_1", "answer": "SELECT name FROM media_types"} {"question": "What are the dates of the orders made by the customer named 'Jeramie'?\nAdditional table information: table: tracking_orders", "answer": "SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'"} {"question": "List the names of countries whose language is not 'German'.\nAdditional table information: table: roller_coaster", "answer": "SELECT Name FROM country WHERE Languages <> 'German'"} {"question": "What is the party of the youngest people?\nAdditional table information: table: debate", "answer": "SELECT Party FROM people ORDER BY Age ASC NULLS FIRST LIMIT 1"} {"question": "Show the number of documents.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Documents"} {"question": "Which category does the product named 'flax' belong to?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_category_code FROM products WHERE product_name = 'flax'"} {"question": "What are the names of the different artists from Bangladesh who never received a rating higher than a 7?\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT artist_name FROM artist WHERE country = 'Bangladesh' EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7"} {"question": "What are the statuses and average populations of each city?\nAdditional table information: table: farm", "answer": "SELECT Status, AVG(Population) FROM city GROUP BY Status"} {"question": "What are all the employee ids and the names of the countries in which they work?\nAdditional table information: table: hr_1", "answer": "SELECT T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id"} {"question": "What are the names of students who took a course in the Fall of 2003?\nAdditional table information: table: college_2", "answer": "SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)"} {"question": "Show publishers that have more than one publication.\nAdditional table information: table: book_2", "answer": "SELECT Publisher FROM publication GROUP BY Publisher HAVING COUNT(*) > 1"} {"question": "Return the average total amount purchased and total value purchased for the supplier who supplies the greatest number of products.\nAdditional table information: table: department_store", "answer": "SELECT AVG(total_amount_purchased), AVG(total_value_purchased) FROM Product_Suppliers WHERE supplier_id = (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "Show the nations that have both hosts older than 45 and hosts younger than 35.\nAdditional table information: table: party_host", "answer": "SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35"} {"question": "What are the headquarters that have both a company in the banking and 'oil and gas' industries?\nAdditional table information: table: gas_company", "answer": "SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'"} {"question": "What is the name of the instructor who advises the student with the greatest number of total credits?\nAdditional table information: table: college_2", "answer": "SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1"} {"question": "For each distinct product name, show its average product price.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name"} {"question": "What are the details of the car with id 1?\nAdditional table information: table: driving_school", "answer": "SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1"} {"question": "How many states have a college with more students than average?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(DISTINCT state) FROM college WHERE enr > (SELECT AVG(enr) FROM college)"} {"question": "What are the ids of the students who registered for course 301?\nAdditional table information: table: student_assessment", "answer": "SELECT student_id FROM student_course_attendance WHERE course_id = 301"} {"question": "For each faculty rank, show the number of faculty members who have it.\nAdditional table information: table: activity_1", "answer": "SELECT rank, COUNT(*) FROM Faculty GROUP BY rank"} {"question": "Return the phone numbers of employees with salaries between 8000 and 12000.\nAdditional table information: table: hr_1", "answer": "SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000"} {"question": "Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01?\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= '1975-01-01' AND T1.date_order_placed <= '1976-01-01'"} {"question": "What is the average number of votes of representatives from party 'Republican'?\nAdditional table information: table: election_representative", "answer": "SELECT AVG(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = 'Republican'"} {"question": "Find the checking balance of the accounts whose savings balance is higher than the average savings balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM savings))"} {"question": "What are the ids of courses without prerequisites?\nAdditional table information: table: college_2", "answer": "SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq"} {"question": "What is average salary of the players in the team named 'Boston Red Stockings' ?\nAdditional table information: table: baseball_1", "answer": "SELECT AVG(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'"} {"question": "Find the last names of teachers who are not involved in any detention.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id"} {"question": "Which teams had more than 3 eliminations?\nAdditional table information: table: wrestler", "answer": "SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3"} {"question": "What is the total point count of the youngest gymnast?\nAdditional table information: table: gymnast", "answer": "SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC NULLS FIRST LIMIT 1"} {"question": "Find the name and checking balance of the account with the lowest savings balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance NULLS FIRST LIMIT 1"} {"question": "Find the official names of cities with population bigger than 1500 or smaller than 500.\nAdditional table information: table: farm", "answer": "SELECT Official_Name FROM city WHERE Population > 1500 OR Population < 500"} {"question": "List the name of all playlist.\nAdditional table information: table: store_1", "answer": "SELECT name FROM playlists"} {"question": "What is the average amount of items ordered in each order?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT AVG(order_quantity) FROM order_items"} {"question": "Give the different positions of players who play for the country with the capital Dublin.\nAdditional table information: table: match_season", "answer": "SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = 'Dublin'"} {"question": "Find the last names of the members of the club 'Bootup Baltimore'.\nAdditional table information: table: club_1", "answer": "SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore'"} {"question": "What are the ids and names for each of the documents?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_id, document_name FROM Documents"} {"question": "What are the names and salaries of instructors who advises students in the History department?\nAdditional table information: table: college_2", "answer": "SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'"} {"question": "Find the founder of the company whose name begins with the letter 'S'.\nAdditional table information: table: manufactory_1", "answer": "SELECT founder FROM manufacturers WHERE name LIKE 'S%'"} {"question": "What is the match id of the competition called '1994 FIFA World Cup qualification'?\nAdditional table information: table: city_record", "answer": "SELECT match_id FROM MATCH WHERE competition = '1994 FIFA World Cup qualification'"} {"question": "How many different cities do people originate from?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(DISTINCT city) FROM Person"} {"question": "List the names and emails of customers who payed by Visa card.\nAdditional table information: table: customer_deliveries", "answer": "SELECT customer_email, customer_name FROM customers WHERE payment_method = 'Visa'"} {"question": "List all open years when at least two shops are opened.\nAdditional table information: table: shop_membership", "answer": "SELECT open_year FROM branch GROUP BY open_year HAVING COUNT(*) >= 2"} {"question": "What are the titles for courses with two prerequisites?\nAdditional table information: table: college_2", "answer": "SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2"} {"question": "What are the region names affected by the storm with a number of deaths of least 10?\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Who is the delegate of district 1 in the elections?\nAdditional table information: table: election", "answer": "SELECT Delegate FROM election WHERE District = 1"} {"question": "What is the email and phone number of Astrid Gruber the customer?\nAdditional table information: table: store_1", "answer": "SELECT email, phone FROM customers WHERE first_name = 'Astrid' AND last_name = 'Gruber'"} {"question": "In how many different cities are banks located?\nAdditional table information: table: loan_1", "answer": "SELECT COUNT(DISTINCT city) FROM bank"} {"question": "Return the weights of entrepreneurs, ordered descending by amount of money requested.\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC"} {"question": "Show all role codes with at least 3 employees.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code FROM Employees GROUP BY role_code HAVING COUNT(*) >= 3"} {"question": "Which friend of Zach has the longest-lasting friendship?\nAdditional table information: table: network_2", "answer": "SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach')"} {"question": "Show the countries that have managers of age above 50 or below 46.\nAdditional table information: table: railway", "answer": "SELECT Country FROM manager WHERE Age > 50 OR Age < 46"} {"question": "What was the most popular position at tryouts?\nAdditional table information: table: soccer_2", "answer": "SELECT pPos FROM tryout GROUP BY pPos ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the code of the course which the student whose last name is Smithson took?\nAdditional table information: table: college_1", "answer": "SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'"} {"question": "What is the area of the appelation that produces the highest number of wines before the year of 2010?\nAdditional table information: table: wine_1", "answer": "SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the snatch score and clean jerk score of body builders in ascending order of snatch score.\nAdditional table information: table: body_builder", "answer": "SELECT Snatch, Clean_Jerk FROM body_builder ORDER BY Snatch ASC NULLS FIRST"} {"question": "Find the number of distinct courses that have enrolled students.\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(course_id) FROM Student_Course_Enrolment"} {"question": "What are the different positions for match season?\nAdditional table information: table: match_season", "answer": "SELECT DISTINCT POSITION FROM match_season"} {"question": "What is the detail of the location UK Gallery?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Other_Details FROM LOCATIONS WHERE Location_Name = 'UK Gallery'"} {"question": "Count the number of submissions.\nAdditional table information: table: workshop_paper", "answer": "SELECT COUNT(*) FROM submission"} {"question": "What is the total student capacity of all dorms?\nAdditional table information: table: dorm_1", "answer": "SELECT SUM(student_capacity) FROM dorm"} {"question": "Show the names of members whose country is 'United States' or 'Canada'.\nAdditional table information: table: decoration_competition", "answer": "SELECT Name FROM member WHERE Country = 'United States' OR Country = 'Canada'"} {"question": "Who are all the directors?\nAdditional table information: table: cinema", "answer": "SELECT DISTINCT directed_by FROM film"} {"question": "Find the names of the artists who are from Bangladesh and have never received rating higher than 7.\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT artist_name FROM artist WHERE country = 'Bangladesh' EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7"} {"question": "What is the name of the song that was released most recently?\nAdditional table information: table: music_1", "answer": "SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1"} {"question": "What are the hosts of competitions whose theme is not 'Aliens'?\nAdditional table information: table: farm", "answer": "SELECT Hosts FROM farm_competition WHERE Theme <> 'Aliens'"} {"question": "What are the statement id and statement detail for the statement that has the most corresponding accounts?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.statement_id, T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the ids of all students for courses and what are the names of those courses?\nAdditional table information: table: student_assessment", "answer": "SELECT T1.student_id, T2.course_name FROM student_course_registrations AS T1 JOIN courses AS T2 ON T1.course_id = T2.course_id"} {"question": "List the names of climbers whose country is not Switzerland.\nAdditional table information: table: climbing", "answer": "SELECT Name FROM climber WHERE Country <> 'Switzerland'"} {"question": "What are the different ship flags, and how many ships have each?\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(*), flag FROM ship GROUP BY flag"} {"question": "What are the names of storms that did not affect any regions?\nAdditional table information: table: storm_record", "answer": "SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region)"} {"question": "What is the headquarter of the company with the largest sales?\nAdditional table information: table: company_employee", "answer": "SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1"} {"question": "Find the names of all the customers and staff members.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT customer_details FROM customers UNION SELECT staff_details FROM staff"} {"question": "Find the number of members of club 'Pen and Paper Gaming'.\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Pen and Paper Gaming'"} {"question": "For each zip code, return how many times max wind speed reached 25?\nAdditional table information: table: bike_1", "answer": "SELECT zip_code, COUNT(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code"} {"question": "how many ships are there?\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(*) FROM ship"} {"question": "What are the student ID and login name of the student who are enrolled in the most courses?\nAdditional table information: table: e_learning", "answer": "SELECT T1.student_id, T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the distinct last names of the students who have president votes but do not have 2192 as the advisor?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = '2192'"} {"question": "Give me a list of all the channel names sorted by the channel rating in descending order.\nAdditional table information: table: program_share", "answer": "SELECT name FROM channel ORDER BY rating_in_percent DESC"} {"question": "For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.fault_short_name, T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id"} {"question": "Show the names and heights of buildings with at least two institutions founded after 1880.\nAdditional table information: table: protein_institute", "answer": "SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2"} {"question": "What are the different statement ids on accounts, and the number of accounts for each?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID"} {"question": "What is the customer id of the customer who has the most orders?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the name and number of followers for each user, and sort the results by the number of followers in descending order.\nAdditional table information: table: twitter_1", "answer": "SELECT name, followers FROM user_profiles ORDER BY followers DESC"} {"question": "What are the medicine and trade names that can interact as an inhibitor and activitor with enzymes?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'"} {"question": "Show the name for regions not affected.\nAdditional table information: table: storm_record", "answer": "SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region)"} {"question": "Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT address_content FROM addresses WHERE city = 'East Julianaside' AND state_province_county = 'Texas' UNION SELECT address_content FROM addresses WHERE city = 'Gleasonmouth' AND state_province_county = 'Arizona'"} {"question": "Give the order ids for all orders, as well as the total product quantity in each.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT order_id, SUM(product_quantity) FROM Order_items GROUP BY order_id"} {"question": "What city does the employee who helps the customer with postal code 70174 live in?\nAdditional table information: table: chinook_1", "answer": "SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = '70174'"} {"question": "How many faculty lines are there in the university that conferred the least number of degrees in year 2001?\nAdditional table information: table: csu_1", "answer": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees NULLS FIRST LIMIT 1"} {"question": "List the names of companies by ascending number of sales.\nAdditional table information: table: company_employee", "answer": "SELECT Name FROM company ORDER BY Sales_in_Billion ASC NULLS FIRST"} {"question": "Show the average price range of hotels that have 5 star ratings and allow pets.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = '5' AND pets_allowed_yn = 1"} {"question": "What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?\nAdditional table information: table: formula_1", "answer": "SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year NULLS FIRST"} {"question": "What is the most common hometown of gymnasts?\nAdditional table information: table: gymnast", "answer": "SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is detail of the student who most recently registered course?\nAdditional table information: table: student_assessment", "answer": "SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1"} {"question": "Show all artist names with an average exhibition attendance over 200.\nAdditional table information: table: theme_gallery", "answer": "SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING AVG(T1.attendance) > 200"} {"question": "What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin?\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue) FROM manufacturers WHERE revenue > (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin')"} {"question": "Return the issue dates of volumes by artists who are at most 23 years old?\nAdditional table information: table: music_4", "answer": "SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23"} {"question": "List the names of people that are not entrepreneurs.\nAdditional table information: table: entrepreneur", "answer": "SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur)"} {"question": "How many tasks are there in total?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT COUNT(*) FROM Tasks"} {"question": "Which course author teaches the 'advanced database' course? Give me his or her login name.\nAdditional table information: table: e_learning", "answer": "SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = 'advanced database'"} {"question": "How many different students play games?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(DISTINCT StuID) FROM Plays_games"} {"question": "Find the name and age of all males in order of their age.\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE gender = 'male' ORDER BY age NULLS FIRST"} {"question": "find all dependent names who have a spouse relation with some employee.\nAdditional table information: table: company_1", "answer": "SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse'"} {"question": "What is the name of tracks whose genre is Rock?\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = 'Rock'"} {"question": "How many professors have a Ph.D. in each department?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code"} {"question": "Return the distinct name of customers whose order status is Pending, in the order of customer id.\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Pending' ORDER BY T2.customer_id NULLS FIRST"} {"question": "Return the names of entrepreneurs do no not have the investor Rachel Elnaugh.\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> 'Rachel Elnaugh'"} {"question": "What is the code of each role and the number of employees in each role?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code"} {"question": "Which assets did not incur any fault log? List the asset model.\nAdditional table information: table: assets_maintenance", "answer": "SELECT asset_model FROM Assets WHERE NOT asset_id IN (SELECT asset_id FROM Fault_Log)"} {"question": "What is the average quantities ordered with payment method code 'MasterCard' on invoices?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = 'MasterCard'"} {"question": "Show all headquarters without a company in banking industry.\nAdditional table information: table: gas_company", "answer": "SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'"} {"question": "Who are the players that have names containing the letter a?\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'"} {"question": "What are the customer phone numbers under the policy 'Life Insurance'?\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_phone FROM available_policies WHERE policy_type_code = 'Life Insurance'"} {"question": "Find the name and level of catalog structure with level between 5 and 10.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10"} {"question": "Show all product names and the number of customers having an order on each product.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.product_name, COUNT(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name"} {"question": "Return the account details with the greatest value, as well as those that include the character 5.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE '%5%'"} {"question": "What is the number of employees?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Employee"} {"question": "Show each location and the number of cinemas there.\nAdditional table information: table: cinema", "answer": "SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION"} {"question": "Show all student ids who are older than 20.\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Student WHERE age > 20"} {"question": "How many female people are older than 30 in our record?\nAdditional table information: table: wedding", "answer": "SELECT COUNT(*) FROM people WHERE is_male = 'F' AND age > 30"} {"question": "What is the location of the festival with the largest number of audience?\nAdditional table information: table: entertainment_awards", "answer": "SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1"} {"question": "What are the themes and locations of parties?\nAdditional table information: table: party_host", "answer": "SELECT Party_Theme, LOCATION FROM party"} {"question": "Show the names of mountains with height more than 5000 or prominence more than 1000.\nAdditional table information: table: climbing", "answer": "SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000"} {"question": "Count the number of artists.\nAdditional table information: table: music_4", "answer": "SELECT COUNT(*) FROM artist"} {"question": "Show the most common nationality of hosts.\nAdditional table information: table: party_host", "answer": "SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the job ID for those jobs which average salary is above 8000.\nAdditional table information: table: hr_1", "answer": "SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000"} {"question": "List the date, theme and sales of the journal which did not have any of the listed editors serving on committee.\nAdditional table information: table: journal_committee", "answer": "SELECT date, theme, sales FROM journal EXCEPT SELECT T1.date, T1.theme, T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID"} {"question": "Who served as an advisor for students who have treasurer votes in the spring election cycle?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = 'Spring'"} {"question": "What are the unique labels for the albums?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT label) FROM albums"} {"question": "Sort the first names of all the authors in alphabetical order.\nAdditional table information: table: icfp_1", "answer": "SELECT fname FROM authors ORDER BY fname NULLS FIRST"} {"question": "What are the maximum and minimum age of students with major 600?\nAdditional table information: table: voter_2", "answer": "SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600"} {"question": "What city is the headquarter of the store Blackville?\nAdditional table information: table: store_product", "answer": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = 'Blackville'"} {"question": "How many storms occured in each region?\nAdditional table information: table: storm_record", "answer": "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"} {"question": "List the distinct ranges of the mountains with the top 3 prominence.\nAdditional table information: table: climbing", "answer": "SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3"} {"question": "How old are the students with allergies to food and animal types on average?\nAdditional table information: table: allergy_1", "answer": "SELECT AVG(age) FROM Student WHERE StuID IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'food' INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'animal')"} {"question": "Find the first names of all the authors who have written a paper with title containing the word 'Functional'.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE '%Functional%'"} {"question": "What are all the different food allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = 'food'"} {"question": "How many clubs are there?\nAdditional table information: table: sports_competition", "answer": "SELECT COUNT(*) FROM club"} {"question": "What are the ids and names of customers with addressed that contain WY and who do not use a credit card for payment?\nAdditional table information: table: department_store", "answer": "SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE '%WY%' AND payment_method_code <> 'Credit Card'"} {"question": "display the first and last name, department, city, and state province for each employee.\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id"} {"question": "Return the names of singers who are from UK and released an English song.\nAdditional table information: table: music_1", "answer": "SELECT artist_name FROM artist WHERE country = 'UK' INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'english'"} {"question": "What is the highest acc percent score in the competition?\nAdditional table information: table: university_basketball", "answer": "SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1"} {"question": "What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'"} {"question": "What are the id of songs whose format is mp3.\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM files WHERE formats = 'mp3'"} {"question": "How many churches opened before 1850 are there?\nAdditional table information: table: wedding", "answer": "SELECT COUNT(*) FROM Church WHERE Open_Date < 1850"} {"question": "List the forenames of all distinct drivers in alphabetical order?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT forename FROM drivers ORDER BY forename ASC NULLS FIRST"} {"question": "How many different projects are there?\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(DISTINCT name) FROM projects"} {"question": "What are the team and the location of school each player belongs to?\nAdditional table information: table: school_player", "answer": "SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID"} {"question": "Return the description of the document type name 'Film'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_description FROM Ref_document_types WHERE document_type_name = 'Film'"} {"question": "Find the number of adults for the room reserved and checked in by CONRAD SELBIG on Oct 23, 2010.\nAdditional table information: table: inn_1", "answer": "SELECT Adults FROM Reservations WHERE CheckIn = '2010-10-23' AND FirstName = 'CONRAD' AND LastName = 'SELBIG'"} {"question": "Find the first names and last names of the authors whose institution affiliation is 'University of Oxford'.\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'University of Oxford'"} {"question": "Show the product ids and the number of unique orders containing each product.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT product_id, COUNT(DISTINCT order_id) FROM Order_items GROUP BY product_id"} {"question": "What are the countries that have never participated in any friendly-type competitions?\nAdditional table information: table: sports_competition", "answer": "SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'"} {"question": "Find the average elevation of all airports for each country.\nAdditional table information: table: flight_4", "answer": "SELECT AVG(elevation), country FROM airports GROUP BY country"} {"question": "Find the committees that have delegates both from from the democratic party and the liberal party.\nAdditional table information: table: election", "answer": "SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Democratic' INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Liberal'"} {"question": "What is the latitude, longitude, and city of the station from which the trip with smallest duration started?\nAdditional table information: table: bike_1", "answer": "SELECT T1.lat, T1.long, T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration NULLS FIRST LIMIT 1"} {"question": "What is the cell phone number of the student whose address has the lowest monthly rental?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental ASC NULLS FIRST LIMIT 1"} {"question": "Find the name and city of the airport which is the source for the most number of flight routes.\nAdditional table information: table: flight_4", "answer": "SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which party has the largest number of delegates?\nAdditional table information: table: election", "answer": "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"} {"question": "What are the ids and names of accounts with 4 or more transactions?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.account_id, T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING COUNT(*) >= 4"} {"question": "Show name and distance for all aircrafts.\nAdditional table information: table: flight_1", "answer": "SELECT name, distance FROM Aircraft"} {"question": "get the details of employees who manage a department.\nAdditional table information: table: hr_1", "answer": "SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id"} {"question": "Which room has the highest rate? List the room's full name, rate, check in and check out date.\nAdditional table information: table: inn_1", "answer": "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"} {"question": "Count the number of gymnasts.\nAdditional table information: table: gymnast", "answer": "SELECT COUNT(*) FROM gymnast"} {"question": "List the names of all the customers in alphabetical order.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT customer_details FROM customers ORDER BY customer_details NULLS FIRST"} {"question": "Find the distinct years when the governor was named 'Eliot Spitzer'.\nAdditional table information: table: election", "answer": "SELECT DISTINCT YEAR FROM party WHERE Governor = 'Eliot Spitzer'"} {"question": "List the project details of the project both producing patent and paper as outcomes.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent'"} {"question": "Find the number and average age of students living in each city.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code"} {"question": "What are the cities with exactly two airports?\nAdditional table information: table: flight_4", "answer": "SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2"} {"question": "Show ids for all employees who don't have a certificate.\nAdditional table information: table: flight_1", "answer": "SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate"} {"question": "What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?\nAdditional table information: table: formula_1", "answer": "SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Australian Grand Prix' EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Chinese Grand Prix'"} {"question": "Find the ids and names of stations from which at least 200 trips started.\nAdditional table information: table: bike_1", "answer": "SELECT start_station_id, start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200"} {"question": "Find the names of departments that are either in division AS or in division EN and in Building NEB.\nAdditional table information: table: college_3", "answer": "SELECT DName FROM DEPARTMENT WHERE Division = 'AS' UNION SELECT DName FROM DEPARTMENT WHERE Division = 'EN' AND Building = 'NEB'"} {"question": "Find the number of routes that have destination John F Kennedy International Airport.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'"} {"question": "What is the name of the 3 employees who get paid the least?\nAdditional table information: table: flight_1", "answer": "SELECT name FROM Employee ORDER BY salary ASC NULLS FIRST LIMIT 3"} {"question": "What is the phone number of the customer who has filed the most recent complaint?\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1"} {"question": "What is the name of the entrepreneur with the greatest weight?\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1"} {"question": "Give the full name and staff id of the staff who has handled the fewest payments.\nAdditional table information: table: sakila_1", "answer": "SELECT T1.first_name, T1.last_name, T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What is the unit of measuerment of the product category code 'Herbs'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'"} {"question": "What are the nicknames of schools whose division is not 1?\nAdditional table information: table: school_player", "answer": "SELECT Nickname FROM school_details WHERE Division <> 'Division 1'"} {"question": "What are the distinct customers who have orders with status 'On Road'? Give me the customer details?\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road'"} {"question": "Return the name of the party with the most members.\nAdditional table information: table: party_people", "answer": "SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the id and name of the aircraft that can cover the maximum distance?\nAdditional table information: table: flight_1", "answer": "SELECT aid, name FROM Aircraft ORDER BY distance DESC LIMIT 1"} {"question": "Show all distinct lot details.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT DISTINCT lot_details FROM LOTS"} {"question": "What is the last name of the staff member in charge of the complaint on the product with the lowest price?\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price NULLS FIRST LIMIT 1"} {"question": "What is the maximum fastest lap speed in the Monaco Grand Prix in 2008?\nAdditional table information: table: formula_1", "answer": "SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'"} {"question": "Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT Employees.employee_name, COUNT(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id, Circulation_History.draft_number, Circulation_History.copy_number ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Give the name of the products that have a color description 'yellow'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow'"} {"question": "What are the full names, departments, cities, and state provinces for each employee?\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id"} {"question": "Find the names and descriptions of the photos taken at the tourist attraction called 'film festival'.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'film festival'"} {"question": "What are the names of enzymes that include the string 'ALA'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name FROM enzyme WHERE name LIKE '%ALA%'"} {"question": "What is the name of the movie that is rated by most of times?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names of Japanese constructors that have once earned more than 5 points?\nAdditional table information: table: formula_1", "answer": "SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = 'Japanese' AND T2.points > 5"} {"question": "Which projects have no outcome? List the project details.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes)"} {"question": "Which vocal type is the most frequently appearring type?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the names of all counties sorted by population in ascending order.\nAdditional table information: table: election", "answer": "SELECT County_name FROM county ORDER BY Population ASC NULLS FIRST"} {"question": "What are the teams with the most technicians?\nAdditional table information: table: machine_repair", "answer": "SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many students does LORIA ONDERSMA teaches?\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'LORIA' AND T2.lastname = 'ONDERSMA'"} {"question": "Count the number of climbers.\nAdditional table information: table: climbing", "answer": "SELECT COUNT(*) FROM climber"} {"question": "Find the number of items that did not receive any review.\nAdditional table information: table: epinions_1", "answer": "SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review)"} {"question": "Return the names and ids of all products whose price is between 600 and 700.\nAdditional table information: table: department_store", "answer": "SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700"} {"question": "List the id, country, city and name of the airports ordered alphabetically by the name.\nAdditional table information: table: flight_company", "answer": "SELECT id, country, city, name FROM airport ORDER BY name NULLS FIRST"} {"question": "What is the average and maximum number of hours students who made the team practiced?\nAdditional table information: table: soccer_2", "answer": "SELECT AVG(T1.HS), MAX(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'"} {"question": "Show the names of companies and the number of employees they have\nAdditional table information: table: company_employee", "answer": "SELECT T3.Name, COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name"} {"question": "What si the youngest employee's first and last name?\nAdditional table information: table: store_1", "answer": "SELECT first_name, last_name FROM employees ORDER BY birth_date DESC LIMIT 1"} {"question": "Give the full name and phone of the customer who has the account name 162.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = '162'"} {"question": "Find the department name that is in Building 'Mergenthaler'.\nAdditional table information: table: college_3", "answer": "SELECT DName FROM DEPARTMENT WHERE Building = 'Mergenthaler'"} {"question": "Find the match ids of the cities that hosted competition '1994 FIFA World Cup qualification'?\nAdditional table information: table: city_record", "answer": "SELECT match_id FROM MATCH WHERE competition = '1994 FIFA World Cup qualification'"} {"question": "Show all train names and times in stations in London in descending order by train time.\nAdditional table information: table: train_station", "answer": "SELECT T3.name, T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC"} {"question": "Return the names of all regions other than Denmark.\nAdditional table information: table: storm_record", "answer": "SELECT region_name FROM region WHERE region_name <> 'Denmark'"} {"question": "What are the majors only less than three students are studying?\nAdditional table information: table: voter_2", "answer": "SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3"} {"question": "Find the classroom that the most students use.\nAdditional table information: table: student_1", "answer": "SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the host year of city 'Taizhou ( Zhejiang )'?\nAdditional table information: table: city_record", "answer": "SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = 'Taizhou ( Zhejiang )'"} {"question": "When do all the researcher role staff start to work, and when do they stop working?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'"} {"question": "Show the transportation method most people choose to get to tourist attractions.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the shop name corresponding to the shop that opened in the most recent year?\nAdditional table information: table: device", "answer": "SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1"} {"question": "What are the first, middle, and last names of all individuals, ordered by last name?\nAdditional table information: table: e_government", "answer": "SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name NULLS FIRST"} {"question": "Which sport has most number of students on scholarship?\nAdditional table information: table: game_1", "answer": "SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the duration, file size and format of songs whose genre is pop, ordered by title?\nAdditional table information: table: music_1", "answer": "SELECT T1.duration, T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = 'pop' ORDER BY T2.song_name NULLS FIRST"} {"question": "Find the name of the patient who made the appointment with the most recent start date.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1"} {"question": "Find the first names of all customers that live in Brazil and have an invoice.\nAdditional table information: table: chinook_1", "answer": "SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = 'Brazil'"} {"question": "Retrieve the average age of members of the club 'Tennis Club'.\nAdditional table information: table: club_1", "answer": "SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'"} {"question": "What are the total number of Domestic Passengers of airports that contain the word 'London'.\nAdditional table information: table: aircraft", "answer": "SELECT SUM(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE '%London%'"} {"question": "Which customers have used the service named 'Close a policy' or 'Upgrade a policy'? Give me the customer names.\nAdditional table information: table: insurance_fnol", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = 'Close a policy' OR t3.service_name = 'Upgrade a policy'"} {"question": "What are the last names of the author of the paper titled 'Binders Unbound'?\nAdditional table information: table: icfp_1", "answer": "SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = 'Binders Unbound'"} {"question": "How many engineers did each staff contact? List both the contact staff name and number of engineers contacted.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name"} {"question": "Return the names of tracks that have no had any races.\nAdditional table information: table: race_track", "answer": "SELECT name FROM track WHERE NOT track_id IN (SELECT track_id FROM race)"} {"question": "What zip codes have a station with a max temperature greater than or equal to 80 and when did it reach that temperature?\nAdditional table information: table: bike_1", "answer": "SELECT date, zip_code FROM weather WHERE max_temperature_f >= 80"} {"question": "How many customers are there?\nAdditional table information: table: loan_1", "answer": "SELECT SUM(no_of_customers) FROM bank"} {"question": "Show the name of the party that has the most delegates.\nAdditional table information: table: election", "answer": "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"} {"question": "What are the ids for courses that were offered in both Fall of 2009 and Spring of 2010?\nAdditional table information: table: college_2", "answer": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "Find the id and local authority of the station with has the highest average high temperature.\nAdditional table information: table: station_weather", "answer": "SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id ORDER BY AVG(high_temperature) DESC LIMIT 1"} {"question": "Please show different software platforms and the corresponding number of devices using each.\nAdditional table information: table: device", "answer": "SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform"} {"question": "What are the names of the technicians aged either 36 or 37?\nAdditional table information: table: machine_repair", "answer": "SELECT Name FROM technician WHERE Age = 36 OR Age = 37"} {"question": "How many songs have a shared vocal?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = 'shared'"} {"question": "What is the average gradepoint for students with the last name Smith?\nAdditional table information: table: college_3", "answer": "SELECT AVG(T2.gradepoint) FROM ENROLLED_IN AS T1, GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = 'Smith'"} {"question": "What are the salaries and manager ids for employees who have managers?\nAdditional table information: table: hr_1", "answer": "SELECT salary, manager_id FROM employees WHERE manager_id <> 'null'"} {"question": "Show me the number of parks the state of NY has.\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM park WHERE state = 'NY'"} {"question": "Find the state which has the most number of customers.\nAdditional table information: table: loan_1", "answer": "SELECT state FROM bank GROUP BY state ORDER BY SUM(no_of_customers) DESC LIMIT 1"} {"question": "Which author has written the most papers? Find his or her last name.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names and ages of editors?\nAdditional table information: table: journal_committee", "answer": "SELECT Name, Age FROM editor"} {"question": "What are the titles and directors of all movies that have a rating higher than the average James Cameron film rating?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = 'James Cameron')"} {"question": "What is the name of the movie that has been reviewed the most?\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of departments either in division AS, or in division EN and in building NEB?\nAdditional table information: table: college_3", "answer": "SELECT DName FROM DEPARTMENT WHERE Division = 'AS' UNION SELECT DName FROM DEPARTMENT WHERE Division = 'EN' AND Building = 'NEB'"} {"question": "What are the ages of all of Zach's friends who are in the longest relationship?\nAdditional table information: table: network_2", "answer": "SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach')"} {"question": "What are the first and last name of the president of the club 'Bootup Baltimore'?\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Bootup Baltimore' AND t2.position = 'President'"} {"question": "What are the ids and names of the web accelerators that are compatible with two or more browsers?\nAdditional table information: table: browser_web", "answer": "SELECT T1.id, T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2"} {"question": "Find the name of the department that offers the highest total credits?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1"} {"question": "Count the number of markets that have a number of cities lower than 300.\nAdditional table information: table: film_rank", "answer": "SELECT COUNT(*) FROM market WHERE Number_cities < 300"} {"question": "What are the names of the tourist attractions that have parking or shopping as their feature details?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping'"} {"question": "Find the name of amenity that is most common in all dorms.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the result of the submission with the highest score.\nAdditional table information: table: workshop_paper", "answer": "SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1"} {"question": "Find all the stage positions of the musicians with first name 'Solveig'\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = 'Solveig'"} {"question": "What are the advisors\nAdditional table information: table: game_1", "answer": "SELECT advisor FROM Student GROUP BY advisor HAVING COUNT(*) >= 2"} {"question": "Find all the customer information in state NY.\nAdditional table information: table: chinook_1", "answer": "SELECT * FROM CUSTOMER WHERE State = 'NY'"} {"question": "What is the most used instrument?\nAdditional table information: table: music_2", "answer": "SELECT instrument FROM instruments GROUP BY instrument ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the product type, name, and price for products supplied by supplier 3.\nAdditional table information: table: department_store", "answer": "SELECT T2.product_type_code, T2.product_name, T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3"} {"question": "What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.\nAdditional table information: table: pilot_record", "answer": "SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality"} {"question": "How many different products correspond to each order id?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT order_id, COUNT(DISTINCT product_id) FROM Order_items GROUP BY order_id"} {"question": "How many drivers did not participate in the races held in 2009?\nAdditional table information: table: formula_1", "answer": "SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009)"} {"question": "Find all the forenames of distinct drivers who was in position 1 as standing and won?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1"} {"question": "What is the total quantity of products purchased by 'Rodrick Heaney'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT SUM(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = 'Rodrick Heaney'"} {"question": "Find the ids of all distinct customers who made order after some orders that were Cancelled.\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT MIN(order_date) FROM Customer_Orders WHERE order_status_code = 'Cancelled')"} {"question": "What are the names of the songs that are modern or sung in English?\nAdditional table information: table: music_1", "answer": "SELECT song_name FROM song WHERE genre_is = 'modern' OR languages = 'english'"} {"question": "What are the details of all products?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT DISTINCT product_details FROM products"} {"question": "List the first name and last name of customers have the amount of outstanding between 1000 and 3000.\nAdditional table information: table: driving_school", "answer": "SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000"} {"question": "What are the destinations and number of flights to each one?\nAdditional table information: table: flight_1", "answer": "SELECT destination, COUNT(*) FROM Flight GROUP BY destination"} {"question": "What are the different names for all songs that have a higher resolution than English songs?\nAdditional table information: table: music_1", "answer": "SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT MIN(resolution) FROM song WHERE languages = 'english')"} {"question": "What is the maximum page size for everything that has more than 3 products listed?\nAdditional table information: table: store_product", "answer": "SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3"} {"question": "What are the names of the regions in alphabetical order?\nAdditional table information: table: storm_record", "answer": "SELECT region_name FROM region ORDER BY region_name NULLS FIRST"} {"question": "Find the average price of wines that are not produced from Sonoma county.\nAdditional table information: table: wine_1", "answer": "SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma')"} {"question": "How many students participated in tryouts for each college by descennding count?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*), cName FROM tryout GROUP BY cName ORDER BY COUNT(*) DESC"} {"question": "Find the number of users in each role.\nAdditional table information: table: document_management", "answer": "SELECT COUNT(*), role_code FROM users GROUP BY role_code"} {"question": "What is the time of elimination for the wrestler with the most days held?\nAdditional table information: table: wrestler", "answer": "SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1"} {"question": "What are the players who played for Columbus Crew, and how many years did each play for?\nAdditional table information: table: match_season", "answer": "SELECT T1.Player, T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Columbus Crew'"} {"question": "Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000.\nAdditional table information: table: book_2", "answer": "SELECT Publisher FROM publication WHERE Price > 10000000 INTERSECT SELECT Publisher FROM publication WHERE Price < 5000000"} {"question": "How many staff does each project has? List the project id and the number in an ascending order.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) ASC NULLS FIRST"} {"question": "Show the role code with the least employees.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Show the names of players and names of their coaches in descending order of the votes of players.\nAdditional table information: table: riding_club", "answer": "SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC"} {"question": "List the titles of all items in alphabetic order .\nAdditional table information: table: epinions_1", "answer": "SELECT title FROM item ORDER BY title NULLS FIRST"} {"question": "Count the number of stores the chain South has.\nAdditional table information: table: department_store", "answer": "SELECT COUNT(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = 'South'"} {"question": "What is the name of each aircraft and how many flights does each one complete?\nAdditional table information: table: flight_1", "answer": "SELECT T2.name, COUNT(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid"} {"question": "What are the headquarters without companies that are in the banking industry?\nAdditional table information: table: gas_company", "answer": "SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'"} {"question": "Show the crime rate of counties with a city having white percentage more than 90.\nAdditional table information: table: county_public_safety", "answer": "SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90"} {"question": "What is all the information regarding employees with salaries above the minimum and under 2500?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500"} {"question": "Show me all the restaurants.\nAdditional table information: table: restaurant_1", "answer": "SELECT ResName FROM Restaurant"} {"question": "How many clubs does 'Linda Smith' have membership for?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = 'Linda' AND t3.lname = 'Smith'"} {"question": "Find the top 3 artists who have the largest number of songs works whose language is Bangla.\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'bangla' GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Find the number of students in one classroom.\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*), classroom FROM list GROUP BY classroom"} {"question": "What campuses are in Los Angeles county?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE county = 'Los Angeles'"} {"question": "Find the number of distinct currency codes used in drama workshop groups.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups"} {"question": "Find the name of scientists who are assigned to some project.\nAdditional table information: table: scientist_1", "answer": "SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn"} {"question": "How many students play each sport?\nAdditional table information: table: game_1", "answer": "SELECT sportname, COUNT(*) FROM Sportsinfo GROUP BY sportname"} {"question": "What is the sum of checking and savings balances for all customers, ordered by the total balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance NULLS FIRST"} {"question": "Show the invoice number and the number of transactions for each invoice.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT invoice_number, COUNT(*) FROM Financial_transactions GROUP BY invoice_number"} {"question": "What is the maximum elevation of all airports in the country of Iceland?\nAdditional table information: table: flight_4", "answer": "SELECT MAX(elevation) FROM airports WHERE country = 'Iceland'"} {"question": "Of all players with an overall rating greater than 80, how many are right-footed and left-footed?\nAdditional table information: table: soccer_1", "answer": "SELECT preferred_foot, COUNT(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot"} {"question": "What cities do students live in?\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT city_code FROM Student"} {"question": "Find all the customer last names that do not have invoice totals larger than 20.\nAdditional table information: table: chinook_1", "answer": "SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20"} {"question": "Show the countries that have both managers of age above 50 and managers of age below 46.\nAdditional table information: table: railway", "answer": "SELECT Country FROM manager WHERE Age > 50 INTERSECT SELECT Country FROM manager WHERE Age < 46"} {"question": "Show the city and the number of branches opened before 2010 for each city.\nAdditional table information: table: shop_membership", "answer": "SELECT city, COUNT(*) FROM branch WHERE open_year < 2010 GROUP BY city"} {"question": "Which headquarter locations are used by more than 2 companies?\nAdditional table information: table: company_office", "answer": "SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2"} {"question": "How many professors who are from either Accounting or Biology department?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'"} {"question": "How many budget types do we have?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Ref_budget_codes"} {"question": "Show the names of products and the number of events they are in, sorted by the number of events in descending order.\nAdditional table information: table: solvency_ii", "answer": "SELECT T1.Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC"} {"question": "What are the ids, full names, and salaries for employees making more than average and who work in a department with employees who have the letter J in their first name?\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%')"} {"question": "What is the budget type code with most number of documents.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the minimum, mean, and maximum age across all students?\nAdditional table information: table: allergy_1", "answer": "SELECT MIN(age), AVG(age), MAX(age) FROM Student"} {"question": "What are the id and name of the photos for mountains?\nAdditional table information: table: mountain_photos", "answer": "SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.height > 4000"} {"question": "Show the locations that have more than one railways.\nAdditional table information: table: railway", "answer": "SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1"} {"question": "Find the maximum and minimum durations of tracks in milliseconds.\nAdditional table information: table: chinook_1", "answer": "SELECT MAX(Milliseconds), MIN(Milliseconds) FROM TRACK"} {"question": "What are the names of the mills which are not located in 'Donceel'?\nAdditional table information: table: architecture", "answer": "SELECT name FROM mill WHERE LOCATION <> 'Donceel'"} {"question": "Find the name of the campuses opened before 1800.\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE YEAR < 1800"} {"question": "List the hardware model name and company name for the phone whose screen mode type is 'Graphics.'\nAdditional table information: table: phone_1", "answer": "SELECT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = 'Graphics'"} {"question": "Find the names of all the products whose stock number starts with '2'.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE '2%'"} {"question": "Find the physician who was trained in the most expensive procedure?\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment ORDER BY T3.cost DESC LIMIT 1"} {"question": "How many cities have a stadium that was opened before the year of 2006?\nAdditional table information: table: swimming", "answer": "SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006"} {"question": "What is the first name, last name, and phone of the customer with account name 162?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = '162'"} {"question": "What is the average number of attendees for performances?\nAdditional table information: table: performance_attendance", "answer": "SELECT AVG(Attendance) FROM performance"} {"question": "List all the image name and URLs in the order of their names.\nAdditional table information: table: document_management", "answer": "SELECT image_name, image_url FROM images ORDER BY image_name NULLS FIRST"} {"question": "Show names for all aircrafts of which John Williams has certificates.\nAdditional table information: table: flight_1", "answer": "SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = 'John Williams'"} {"question": "What are the names of parties and their respective regions?\nAdditional table information: table: party_people", "answer": "SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id"} {"question": "Count the total number of available services.\nAdditional table information: table: insurance_fnol", "answer": "SELECT COUNT(*) FROM services"} {"question": "What are the names and ages of every person who is a friend of both Dan and Alice?\nAdditional table information: table: network_2", "answer": "SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'"} {"question": "How many distinct cities does the employees live in?\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(DISTINCT city) FROM EMPLOYEE"} {"question": "Which customer uses the most policies? Give me the customer name.\nAdditional table information: table: insurance_fnol", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Please show different denominations and the corresponding number of schools.\nAdditional table information: table: school_player", "answer": "SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination"} {"question": "What is the name of customers who do not use Cash as payment method.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers WHERE payment_method <> 'Cash'"} {"question": "What are the maximum, minimum, and average booked count for the products booked?\nAdditional table information: table: products_for_hire", "answer": "SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked"} {"question": "What is the school code of the accounting department?\nAdditional table information: table: college_1", "answer": "SELECT school_code FROM department WHERE dept_name = 'Accounting'"} {"question": "What is the document type code with most number of documents?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the distinct ages of the heads who are acting?\nAdditional table information: table: department_management", "answer": "SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes'"} {"question": "Show the shipping charge and customer id for customer orders with order status Cancelled or Paid.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT order_shipping_charges, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'"} {"question": "Return the unique name for stations that have ever had 7 bikes available.\nAdditional table information: table: bike_1", "answer": "SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7"} {"question": "What are the headquarters with at least two companies in the banking industry?\nAdditional table information: table: gas_company", "answer": "SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2"} {"question": "Retrieve the open and close dates of all the policies associated with the customer whose name contains 'Diana'\nAdditional table information: table: insurance_fnol", "answer": "SELECT t2.date_opened, t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE '%Diana%'"} {"question": "Show the country names and the corresponding number of players.\nAdditional table information: table: match_season", "answer": "SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name"} {"question": "For each headquarter, what are the headquarter and how many companies are centered there?\nAdditional table information: table: gas_company", "answer": "SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters"} {"question": "Find the total credits of courses provided by different department.\nAdditional table information: table: college_2", "answer": "SELECT SUM(credits), dept_name FROM course GROUP BY dept_name"} {"question": "What is the number of invoices and total money billed in them from CA?\nAdditional table information: table: store_1", "answer": "SELECT billing_state, COUNT(*), SUM(total) FROM invoices WHERE billing_state = 'CA'"} {"question": "What are the tracks that Dean Peeters bought?\nAdditional table information: table: store_1", "answer": "SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = 'Daan' AND T4.last_name = 'Peeters'"} {"question": "What are the checking and savings balances in accounts belonging to Brown?\nAdditional table information: table: small_bank_1", "answer": "SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'"} {"question": "Which order has the most recent shipment? Give me the order id.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments)"} {"question": "What are the grapes, appelations, and wines with scores above 93, sorted by Name?\nAdditional table information: table: wine_1", "answer": "SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name NULLS FIRST"} {"question": "List the name for storms and the number of affected regions for each storm.\nAdditional table information: table: storm_record", "answer": "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"} {"question": "How many cities are there in state 'Colorado'?\nAdditional table information: table: e_government", "answer": "SELECT COUNT(*) FROM addresses WHERE state_province_county = 'Colorado'"} {"question": "What are the products that have problems reported after 1986-11-13? Give me the product id and the count of problems reported after 1986-11-13.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > '1986-11-13' GROUP BY T2.product_id"} {"question": "What are the names of documents that have both one of the three most common types and one of three most common structures?\nAdditional table information: table: document_management", "answer": "SELECT document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What are the official names of cities that have not hosted a farm competition?\nAdditional table information: table: farm", "answer": "SELECT Official_Name FROM city WHERE NOT City_ID IN (SELECT Host_city_ID FROM farm_competition)"} {"question": "What are the names of all colleges that have two or more players?\nAdditional table information: table: match_season", "answer": "SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2"} {"question": "What are the course names for courses taught on MTW?\nAdditional table information: table: college_3", "answer": "SELECT CName FROM COURSE WHERE Days = 'MTW'"} {"question": "Which courses are taught on days MTW?\nAdditional table information: table: college_3", "answer": "SELECT CName FROM COURSE WHERE Days = 'MTW'"} {"question": "What are the distinct grant amount for the grants where the documents were sent before '1986-08-26 20:49:27' and grant were ended after '1989-03-16 18:27:16'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16'"} {"question": "Count the number of voting records for each election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle"} {"question": "Find the maximum and minimum monthly rental for all student addresses.\nAdditional table information: table: behavior_monitoring", "answer": "SELECT MAX(monthly_rental), MIN(monthly_rental) FROM Student_Addresses"} {"question": "Give the name of the student in the History department with the most credits.\nAdditional table information: table: college_2", "answer": "SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1"} {"question": "What are all the friends of Alice who are female?\nAdditional table information: table: network_2", "answer": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'"} {"question": "Which problems are reported before 1978-06-26? Give me the ids of the problems.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_id FROM problems WHERE date_problem_reported < '1978-06-26'"} {"question": "Show flight number for all flights with more than 2000 distance.\nAdditional table information: table: flight_1", "answer": "SELECT flno FROM Flight WHERE distance > 2000"} {"question": "What is the name of the medication used for the patient staying in room 111?\nAdditional table information: table: hospital_1", "answer": "SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111"} {"question": "How many rooms in total are there in the apartments in the building with short name 'Columbus Square'?\nAdditional table information: table: apartment_rentals", "answer": "SELECT SUM(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = 'Columbus Square'"} {"question": "What are the different product sizes?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT DISTINCT product_size FROM Products"} {"question": "How many female students (sex is F) whose age is below 25?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25"} {"question": "Find the number of albums by the artist 'Metallica'.\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = 'Metallica'"} {"question": "Show member names without any registered branch.\nAdditional table information: table: shop_membership", "answer": "SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch)"} {"question": "List the name of the school with the smallest enrollment.\nAdditional table information: table: school_finance", "answer": "SELECT school_name FROM school ORDER BY enrollment NULLS FIRST LIMIT 1"} {"question": "What are the invoice dates, order ids, and order details for all invoices?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.invoice_date, T1.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id"} {"question": "What are the memories and carriers of phones?\nAdditional table information: table: phone_market", "answer": "SELECT Memory_in_G, Carrier FROM phone"} {"question": "How many staff have the first name Ludie?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Staff WHERE first_name = 'Ludie'"} {"question": "Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name, T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance DESC LIMIT 3"} {"question": "How many products are never booked with amount higher than 200?\nAdditional table information: table: products_for_hire", "answer": "SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200)"} {"question": "What is maximum, minimum and average amount of outstanding of customer?\nAdditional table information: table: driving_school", "answer": "SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers"} {"question": "Find the name and email of the user whose name contains the word \u2018Swift\u2019.\nAdditional table information: table: twitter_1", "answer": "SELECT name, email FROM user_profiles WHERE name LIKE '%Swift%'"} {"question": "What are the names of storms that both affected two or more regions and affected a total of 10 or more cities?\nAdditional table information: table: storm_record", "answer": "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"} {"question": "What is the booking status code of the apartment with apartment number 'Suite 634'?\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = 'Suite 634'"} {"question": "Find how many different affiliation types there are.\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(DISTINCT affiliation) FROM university"} {"question": "What are the names of all students who tried out in alphabetical order?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName NULLS FIRST"} {"question": "Show the headquarters shared by more than two companies.\nAdditional table information: table: company_office", "answer": "SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2"} {"question": "What is the average snatch score of body builders?\nAdditional table information: table: body_builder", "answer": "SELECT AVG(Snatch) FROM body_builder"} {"question": "What are the names of the managers for gas stations that are operated by the ExxonMobil company?\nAdditional table information: table: gas_company", "answer": "SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'"} {"question": "How many teachers does the student named MADLOCK RAY have?\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'MADLOCK' AND T1.lastname = 'RAY'"} {"question": "Find the name of rooms whose price is higher than the average price.\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms WHERE basePrice > (SELECT AVG(basePrice) FROM Rooms)"} {"question": "What is all the information about employees who have never had a job in the past?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE NOT employee_id IN (SELECT employee_id FROM job_history)"} {"question": "What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?\nAdditional table information: table: wine_1", "answer": "SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = 'Zinfandel'"} {"question": "What is the description of the type of the company who concluded its contracts most recently?\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id JOIN Ref_Company_Types AS T3 ON T1.company_type_code = T3.company_type_code ORDER BY T2.contract_end_date DESC LIMIT 1"} {"question": "List each birth place along with the number of people from there.\nAdditional table information: table: body_builder", "answer": "SELECT Birth_Place, COUNT(*) FROM people GROUP BY Birth_Place"} {"question": "What are the songs in volumes with more than 1 week on top?\nAdditional table information: table: music_4", "answer": "SELECT Song FROM volume WHERE Weeks_on_Top > 1"} {"question": "What are the name and population of each county?\nAdditional table information: table: election", "answer": "SELECT County_name, Population FROM county"} {"question": "List the problem id and log id which are assigned to the staff named Rylan Homenick.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = 'Rylan' AND T1.staff_last_name = 'Homenick'"} {"question": "What are the names and scores of all wines?\nAdditional table information: table: wine_1", "answer": "SELECT Name, Score FROM WINE"} {"question": "Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.\nAdditional table information: table: school_finance", "answer": "SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING SUM(T1.budgeted) > 100 OR SUM(T3.amount) > 10"} {"question": "Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.\nAdditional table information: table: department_store", "answer": "SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING AVG(total_amount_purchased) > 50000 OR AVG(total_amount_purchased) < 30000"} {"question": "Which physician was trained in the procedure that costs the most.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment ORDER BY T3.cost DESC LIMIT 1"} {"question": "What is average age for different job title?\nAdditional table information: table: network_2", "answer": "SELECT AVG(age), job FROM Person GROUP BY job"} {"question": "What are the names of people in ascending alphabetical order?\nAdditional table information: table: gymnast", "answer": "SELECT Name FROM People ORDER BY Name ASC NULLS FIRST"} {"question": "What are the names of each scientist, the names of the projects that they work on, and the hours for each of those projects, listed in alphabetical order by project name, then scientist name.\nAdditional table information: table: scientist_1", "answer": "SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name NULLS FIRST, T1.Name NULLS FIRST"} {"question": "Return the first names of customers who did not rented a film after the date '2005-08-23 02:06:01'.\nAdditional table information: table: sakila_1", "answer": "SELECT first_name FROM customer WHERE NOT customer_id IN (SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01')"} {"question": "Return the name and country corresponding to the artist who has had the most exhibitions.\nAdditional table information: table: theme_gallery", "answer": "SELECT T2.name, T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the address of the restaurant Subway?\nAdditional table information: table: restaurant_1", "answer": "SELECT Address FROM Restaurant WHERE ResName = 'Subway'"} {"question": "Return the average age across all artists.\nAdditional table information: table: music_4", "answer": "SELECT AVG(Age) FROM artist"} {"question": "What are the first and last names of all the employees and how many people report to them?\nAdditional table information: table: store_1", "answer": "SELECT T2.first_name, T2.last_name, COUNT(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY COUNT(T1.reports_to) DESC LIMIT 1"} {"question": "Which major has between 2 and 30 number of students? List major and the number of students.\nAdditional table information: table: restaurant_1", "answer": "SELECT Major, COUNT(*) FROM Student GROUP BY Major HAVING COUNT(Major) BETWEEN 2 AND 30"} {"question": "Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?\nAdditional table information: table: election", "answer": "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"} {"question": "Count the products that have the color description 'white' or have the characteristic name 'hot'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'white' OR t3.characteristic_name = 'hot'"} {"question": "What are the emails of employees with null commission, salary between 7000 and 12000, and who work in department 50?\nAdditional table information: table: hr_1", "answer": "SELECT email FROM employees WHERE commission_pct = 'null' AND salary BETWEEN 7000 AND 12000 AND department_id = 50"} {"question": "What are the names of the clubs that have players in the position of 'Right Wing'?\nAdditional table information: table: sports_competition", "answer": "SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = 'Right Wing'"} {"question": "How many artists are male and how many are female?\nAdditional table information: table: music_1", "answer": "SELECT COUNT(*), gender FROM artist GROUP BY gender"} {"question": "Return the top 3 greatest support rates.\nAdditional table information: table: candidate_poll", "answer": "SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3"} {"question": "Show all information on the airport that has the largest number of international passengers.\nAdditional table information: table: aircraft", "answer": "SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1"} {"question": "How many available hotels are there in total?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT COUNT(*) FROM HOTELS"} {"question": "What are the 3 most common cloud covers in the zip code of 94107?\nAdditional table information: table: bike_1", "answer": "SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Count the total number of counties.\nAdditional table information: table: election", "answer": "SELECT COUNT(*) FROM county"} {"question": "Give me the name of the customer who ordered the most items in total.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1"} {"question": "What is the average age for all person?\nAdditional table information: table: network_2", "answer": "SELECT AVG(age) FROM Person"} {"question": "What are the names and dates for documents corresponding to project that has the details 'Graph Database project'?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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'"} {"question": "List the name of staff who has been assigned multiple jobs.\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT(*) > 1"} {"question": "Find the student ID and login name of the student with the most course enrollments\nAdditional table information: table: e_learning", "answer": "SELECT T1.student_id, T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the minimum, average, and maximum age of all students.\nAdditional table information: table: allergy_1", "answer": "SELECT MIN(age), AVG(age), MAX(age) FROM Student"} {"question": "What are the first and last names of the 5 customers who purchased something most recently?\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5"} {"question": "List the campus that have between 600 and 1000 faculty lines in year 2004.\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004"} {"question": "Find the title and score of the movie with the lowest rating among all movies directed by each director.\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director"} {"question": "How many books are there for each publisher?\nAdditional table information: table: culture_company", "answer": "SELECT publisher, COUNT(*) FROM book_club GROUP BY publisher"} {"question": "Find the average price of all product clothes.\nAdditional table information: table: department_store", "answer": "SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes'"} {"question": "Which major has the most students?\nAdditional table information: table: voter_2", "answer": "SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the name of the bank branch with the greatest number of customers?\nAdditional table information: table: loan_1", "answer": "SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1"} {"question": "Return all the distinct secretary votes made in the fall election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = 'Fall'"} {"question": "What is all the information about employees with D or S in their first name, ordered by salary descending?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC"} {"question": "What is the id of the account with the most transactions?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the players from college UCLA.\nAdditional table information: table: match_season", "answer": "SELECT Player FROM match_season WHERE College = 'UCLA'"} {"question": "Which apartment type code appears the most often?\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the ages of all music artists?\nAdditional table information: table: music_4", "answer": "SELECT Age FROM artist"} {"question": "Return the gender and name of artist who produced the song with the lowest resolution.\nAdditional table information: table: music_1", "answer": "SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution NULLS FIRST LIMIT 1"} {"question": "What are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located in London?\nAdditional table information: table: shop_membership", "answer": "SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'"} {"question": "How many campuses are there in Los Angeles county?\nAdditional table information: table: csu_1", "answer": "SELECT COUNT(*) FROM campuses WHERE county = 'Los Angeles'"} {"question": "Find the name of the target user with the lowest trust score.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY trust NULLS FIRST LIMIT 1"} {"question": "Show the authors who have submissions to more than one workshop.\nAdditional table information: table: workshop_paper", "answer": "SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1"} {"question": "Find the titles of items that received any rating below 5.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5"} {"question": "Which tests have 'Pass' results? Return the dates when the tests were taken.\nAdditional table information: table: e_learning", "answer": "SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = 'Pass'"} {"question": "Show the price ranges of hotels with 5 star ratings.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT price_range FROM HOTELS WHERE star_rating_code = '5'"} {"question": "What is the id and name of the staff who has been assigned for the least amount of time?\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_id, T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from NULLS FIRST LIMIT 1"} {"question": "List the names of all distinct nurses ordered by alphabetical order?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT name FROM nurse ORDER BY name NULLS FIRST"} {"question": "Show the id of each employee and the number of document destruction authorised by that employee.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID"} {"question": "List the types of competition and the number of competitions of each type.\nAdditional table information: table: sports_competition", "answer": "SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type"} {"question": "Find the name and access counts of all documents, in alphabetic order of the document name.\nAdditional table information: table: document_management", "answer": "SELECT document_name, access_count FROM documents ORDER BY document_name NULLS FIRST"} {"question": "Find the IDs of customers whose name contains 'Diana'.\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_id FROM customers WHERE customer_name LIKE '%Diana%'"} {"question": "Find the last names of faculties who are members of computer science department.\nAdditional table information: table: college_3", "answer": "SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = 'Computer Science'"} {"question": "Find the emails of the user named 'Mary'.\nAdditional table information: table: twitter_1", "answer": "SELECT email FROM user_profiles WHERE name = 'Mary'"} {"question": "Find the name of customers who have both saving and checking account types.\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'"} {"question": "What are the names of all the races that occurred in the year 2017?\nAdditional table information: table: formula_1", "answer": "SELECT name FROM races WHERE YEAR = 2017"} {"question": "What are the names of all the media types?\nAdditional table information: table: store_1", "answer": "SELECT name FROM media_types"} {"question": "What is the most common role for the staff?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names of the top 3 departments that provide the largest amount of courses?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Find the number of funiture types produced by each manufacturer as well as the company names.\nAdditional table information: table: manufacturer", "answer": "SELECT COUNT(*), t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id"} {"question": "What are all the players who played in match season, sorted by college in ascending alphabetical order?\nAdditional table information: table: match_season", "answer": "SELECT player FROM match_season ORDER BY College ASC NULLS FIRST"} {"question": "Find the last name of female (sex is F) students in the descending order of age.\nAdditional table information: table: college_3", "answer": "SELECT LName FROM STUDENT WHERE Sex = 'F' ORDER BY Age DESC"} {"question": "What is the name of the department with the most credits?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1"} {"question": "Find the product names whose average product price is below 1000000.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000"} {"question": "List the total points of gymnasts in descending order of floor exercise points.\nAdditional table information: table: gymnast", "answer": "SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC"} {"question": "What are the official names of cities that have hosted more than one competition?\nAdditional table information: table: farm", "answer": "SELECT T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT(*) > 1"} {"question": "List total amount of invoice from Chicago, IL.\nAdditional table information: table: store_1", "answer": "SELECT SUM(total) FROM invoices WHERE billing_city = 'Chicago' AND billing_state = 'IL'"} {"question": "What are the names of all the reviewers and movie names?\nAdditional table information: table: movie_1", "answer": "SELECT name FROM Reviewer UNION SELECT title FROM Movie"} {"question": "What are the result description of the project whose detail is 'sint'?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'"} {"question": "Show the host names for parties with number of hosts greater than 20.\nAdditional table information: table: party_host", "answer": "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"} {"question": "Show the ids of all employees who have authorized destruction.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed"} {"question": "Which customers have an insurance policy with the type code 'Deputy'? Give me the customer details.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = 'Deputy'"} {"question": "What is the average age for a male in each job?\nAdditional table information: table: network_2", "answer": "SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job"} {"question": "Which parties did not have any delegates in elections?\nAdditional table information: table: election", "answer": "SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election)"} {"question": "Find the number of customers in total.\nAdditional table information: table: customer_deliveries", "answer": "SELECT COUNT(*) FROM customers"} {"question": "What information do you have on colleges sorted by increasing enrollment numbers?\nAdditional table information: table: soccer_2", "answer": "SELECT * FROM College ORDER BY enr NULLS FIRST"} {"question": "What are the building full names that contain the word 'court'?\nAdditional table information: table: apartment_rentals", "answer": "SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE '%court%'"} {"question": "List the names of buildings that have no company office.\nAdditional table information: table: company_office", "answer": "SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM Office_locations)"} {"question": "When did researchers start and stop working?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'"} {"question": "What are the names and genders of staff who were assigned in 2016?\nAdditional table information: table: department_store", "answer": "SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE '2016%'"} {"question": "Return the minimum, maximum, and average seating across all tracks.\nAdditional table information: table: race_track", "answer": "SELECT MIN(seating), MAX(seating), AVG(seating) FROM track"} {"question": "Show the id, the account name, and other account details for all accounts by the customer with first name 'Meaghan'.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.account_id, T1.date_account_opened, T1.account_name, T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan'"} {"question": "Which teachers teach in classroom 110? Give me their first names.\nAdditional table information: table: student_1", "answer": "SELECT firstname FROM teachers WHERE classroom = 110"} {"question": "What are the names and enrollment numbers for colleges that have more than 10000 enrolled and are located in Louisiana?\nAdditional table information: table: soccer_2", "answer": "SELECT cName, enr FROM College WHERE enr > 10000 AND state = 'LA'"} {"question": "Find the number of students in each major.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), major FROM student GROUP BY major"} {"question": "how many times is the fleet series (quantity) is 468-473 (6)? \nAdditional table information: table: \"vehicles\".\"cars\"\ncolumns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion", "answer": "SELECT COUNT order_year FROM \"vehicles\".\"cars\" WHERE fleet_series_quantity = '468-473 (6)'"} {"question": "What is the names of the physicians who prescribe medication Thesisin?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = 'Thesisin'"} {"question": "What are the names of people who are shorter than average?\nAdditional table information: table: candidate_poll", "answer": "SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people)"} {"question": "what is the name and position of the head whose department has least number of employees?\nAdditional table information: table: hospital_1", "answer": "SELECT T2.name, T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY COUNT(departmentID) NULLS FIRST LIMIT 1"} {"question": "Compute the average profits companies make.\nAdditional table information: table: company_office", "answer": "SELECT AVG(Profits_billion) FROM Companies"} {"question": "What are the first and last name of the author who published the paper titled 'Nameless, Painless'?\nAdditional table information: table: icfp_1", "answer": "SELECT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = 'Nameless , Painless'"} {"question": "What are the distinct names of customers who have purchased a keyboard?\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = 'keyboard'"} {"question": "What are card ids, customer ids, card types, and card numbers for each customer card?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_id, customer_id, card_type_code, card_number FROM Customers_cards"} {"question": "Show the names of phones with carrier either 'Sprint' or 'TMobile'.\nAdditional table information: table: phone_market", "answer": "SELECT Name FROM phone WHERE Carrier = 'Sprint' OR Carrier = 'TMobile'"} {"question": "How many airlines operate out of each country in descending order?\nAdditional table information: table: flight_4", "answer": "SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC"} {"question": "Find distinct cities of addresses of people?\nAdditional table information: table: student_assessment", "answer": "SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id"} {"question": "What is the minimum, average, and maximum distance of all aircrafts.\nAdditional table information: table: flight_1", "answer": "SELECT MIN(distance), AVG(distance), MAX(distance) FROM Aircraft"} {"question": "Give me the maximum low temperature and average precipitation at the Amersham station.\nAdditional table information: table: station_weather", "answer": "SELECT MAX(t1.low_temperature), AVG(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = 'Amersham'"} {"question": "What is the total number of companies?\nAdditional table information: table: gas_company", "answer": "SELECT COUNT(*) FROM company"} {"question": "List each donator name and the amount of endowment in descending order of the amount of endowment.\nAdditional table information: table: school_finance", "answer": "SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC"} {"question": "Count the number of different companies.\nAdditional table information: table: entrepreneur", "answer": "SELECT COUNT(DISTINCT Company) FROM entrepreneur"} {"question": "When are the birthdays of customer who are classified as 'Good Customer' status?\nAdditional table information: table: driving_school", "answer": "SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'"} {"question": "List names of all pilot aged 30 or younger in descending alphabetical order.\nAdditional table information: table: aircraft", "answer": "SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC"} {"question": "Show the party and the number of drivers in each party.\nAdditional table information: table: school_bus", "answer": "SELECT party, COUNT(*) FROM driver GROUP BY party"} {"question": "What are the ids of the problems which are reported before 1978-06-26?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_id FROM problems WHERE date_problem_reported < '1978-06-26'"} {"question": "List all the product names with the color description 'white'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = 'white'"} {"question": "What was the date of the earliest payment?\nAdditional table information: table: sakila_1", "answer": "SELECT payment_date FROM payment ORDER BY payment_date ASC NULLS FIRST LIMIT 1"} {"question": "Find the first name, last name and id for the top three players won the most player awards.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_first, T1.name_last, T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What is the duration, file size, and song format for every pop song, ordered by title alphabetically?\nAdditional table information: table: music_1", "answer": "SELECT T1.duration, T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = 'pop' ORDER BY T2.song_name NULLS FIRST"} {"question": "Tell me the number of orders with 'Second time' as order detail.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(*) FROM customer_orders WHERE order_details = 'Second time'"} {"question": "What are the first and last names of the customers with the 10 cheapest invoices?\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total NULLS FIRST LIMIT 10"} {"question": "What are the distinct names of nurses on call?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse"} {"question": "Which department has more than 1 head at a time? List the id, name and the number of heads.\nAdditional table information: table: department_management", "answer": "SELECT T1.department_id, T1.name, COUNT(*) FROM management AS T2 JOIN department AS T1 ON T1.department_id = T2.department_id GROUP BY T1.department_id HAVING COUNT(*) > 1"} {"question": "What are the names of the pilots in alphabetical order?\nAdditional table information: table: aircraft", "answer": "SELECT Name FROM pilot ORDER BY Name ASC NULLS FIRST"} {"question": "How many apartments do not have any facility?\nAdditional table information: table: apartment_rentals", "answer": "SELECT COUNT(*) FROM Apartments WHERE NOT apt_id IN (SELECT apt_id FROM Apartment_Facilities)"} {"question": "Show all storm names affecting region 'Denmark'.\nAdditional table information: table: storm_record", "answer": "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'"} {"question": "Find the first names of students who took exactly one class.\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING COUNT(*) = 1"} {"question": "For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> 'null' GROUP BY director"} {"question": "List the first names of people in alphabetical order?\nAdditional table information: table: student_assessment", "answer": "SELECT first_name FROM people ORDER BY first_name NULLS FIRST"} {"question": "How many counties correspond to each police force?\nAdditional table information: table: county_public_safety", "answer": "SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force"} {"question": "List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.\nAdditional table information: table: scientist_1", "answer": "SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name NULLS FIRST, T1.Name NULLS FIRST"} {"question": "Show the account id and name with at least 4 transactions.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.account_id, T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING COUNT(*) >= 4"} {"question": "What is the average number of pages per minute color?\nAdditional table information: table: store_product", "answer": "SELECT AVG(pages_per_minute_color) FROM product"} {"question": "List the name of artworks in ascending alphabetical order.\nAdditional table information: table: entertainment_awards", "answer": "SELECT Name FROM artwork ORDER BY Name ASC NULLS FIRST"} {"question": "Show the names of all the employees with role 'HR'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_name FROM Employees WHERE role_code = 'HR'"} {"question": "Find the average age of students who live in the city with code 'NYC' and have secretary votes in the spring election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = 'NYC' AND T2.Election_Cycle = 'Spring'"} {"question": "How many students are there?\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list"} {"question": "What is the name of the media type that is least common across all tracks?\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What are the customer ids for customers who do not have an account?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts"} {"question": "Find the number of products with category 'Spices' and typically sold above 1000.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products WHERE product_category_code = 'Spices' AND typical_buying_price > 1000"} {"question": "Find the the names of the tourist attractions that the tourist named Alison visited but Rosalind did not visit.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Alison' EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Rosalind'"} {"question": "Find the full names of employees who help customers with the first name Leonie.\nAdditional table information: table: chinook_1", "answer": "SELECT T2.FirstName, T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = 'Leonie'"} {"question": "Show the zip code of the county with name 'Howard'.\nAdditional table information: table: election", "answer": "SELECT Zip_code FROM county WHERE County_name = 'Howard'"} {"question": "What is the title of a course that is listed in both the Statistics and Psychology departments?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'"} {"question": "List the subject ID, name of subject and the number of courses available for each subject in ascending order of the course counts.\nAdditional table information: table: e_learning", "answer": "SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC NULLS FIRST"} {"question": "What is the name of the customer that made the order with the largest quantity?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items)"} {"question": "What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county?\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = 'Orange')"} {"question": "What are the names of the climbers, ordered by points descending?\nAdditional table information: table: climbing", "answer": "SELECT Name FROM climber ORDER BY Points DESC"} {"question": "What are the support, consider, and oppose rates of each candidate, ordered ascending by their unsure rate?\nAdditional table information: table: candidate_poll", "answer": "SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate NULLS FIRST"} {"question": "What are the average price and score of wines for each appelation?\nAdditional table information: table: wine_1", "answer": "SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation"} {"question": "Show all cities where students live.\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT city_code FROM Student"} {"question": "What are the details of the project that is producing both patents and papers as outcomes?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent'"} {"question": "List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.\nAdditional table information: table: baseball_1", "answer": "SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'"} {"question": "Which students have professors as their advisors? Find their student ids.\nAdditional table information: table: activity_1", "answer": "SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = 'Professor'"} {"question": "What are the themes and years for exhibitions, sorted by ticket price descending?\nAdditional table information: table: theme_gallery", "answer": "SELECT theme, YEAR FROM exhibition ORDER BY ticket_price DESC"} {"question": "What is the name of the department with the most students enrolled?\nAdditional table information: table: college_1", "answer": "SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Select the names of manufacturer whose products have an average price higher than or equal to $150.\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150"} {"question": "Count the number of total papers.\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(*) FROM papers"} {"question": "How many distinct governors are there?\nAdditional table information: table: election", "answer": "SELECT COUNT(DISTINCT Governor) FROM party"} {"question": "what are the names of the ships ordered by ascending tonnage?\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship ORDER BY Tonnage ASC NULLS FIRST"} {"question": "Which days had a minimum dew point smaller than any day in zip code 94107, and in which zip codes were those measurements taken?\nAdditional table information: table: bike_1", "answer": "SELECT date, zip_code FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107)"} {"question": "List all club names in ascending order of start year.\nAdditional table information: table: sports_competition", "answer": "SELECT name FROM club ORDER BY Start_year ASC NULLS FIRST"} {"question": "List the name of physicians who never took any appointment.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID"} {"question": "When did Carole Bernhard first become a customer?\nAdditional table information: table: driving_school", "answer": "SELECT date_became_customer FROM Customers WHERE first_name = 'Carole' AND last_name = 'Bernhard'"} {"question": "What are the dates that had the top 5 cloud cover rates? Also tell me the cloud cover rate.\nAdditional table information: table: bike_1", "answer": "SELECT date, cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5"} {"question": "How many projects are there?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Projects"} {"question": "How many countries do not have an roller coaster longer than 3000?\nAdditional table information: table: roller_coaster", "answer": "SELECT COUNT(*) FROM country WHERE NOT country_id IN (SELECT country_id FROM roller_coaster WHERE LENGTH > 3000)"} {"question": "Return the names of products in the category 'Spices'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_name FROM products WHERE product_category_code = 'Spices'"} {"question": "What instrument did the musician with last name 'Heilo' use in the song 'Badlands'?\nAdditional table information: table: music_2", "answer": "SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = 'Heilo' AND T3.title = 'Badlands'"} {"question": "What are the department ids for which more than 10 employees had a commission?\nAdditional table information: table: hr_1", "answer": "SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10"} {"question": "What are the distinct hometowns of gymnasts with total points more than 57.5?\nAdditional table information: table: gymnast", "answer": "SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5"} {"question": "Show ids, first names, last names, and phones for all customers.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, customer_first_name, customer_last_name, customer_phone FROM Customers"} {"question": "What are the first names for all students who are from the major numbered 600?\nAdditional table information: table: game_1", "answer": "SELECT Fname FROM Student WHERE Major = 600"} {"question": "Find the major that is studied by the largest number of students.\nAdditional table information: table: voter_2", "answer": "SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the last names of faculty in building Barton, sorted by last name?\nAdditional table information: table: college_3", "answer": "SELECT Lname FROM FACULTY WHERE Building = 'Barton' ORDER BY Lname NULLS FIRST"} {"question": "Which customers have both 'On Road' and 'Shipped' as order status? List the customer names.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Shipped'"} {"question": "List the maximum scores of the team Boston Red Stockings when the team won in postseason?\nAdditional table information: table: baseball_1", "answer": "SELECT MAX(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'"} {"question": "List the name, location, mascot for all schools.\nAdditional table information: table: school_finance", "answer": "SELECT school_name, LOCATION, mascot FROM school"} {"question": "How many students have each different allergy?\nAdditional table information: table: allergy_1", "answer": "SELECT Allergy, COUNT(*) FROM Has_allergy GROUP BY Allergy"} {"question": "How many bands are there?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM Band"} {"question": "List the names of all genres in alphabetical oder, together with its ratings.\nAdditional table information: table: music_1", "answer": "SELECT g_name, rating FROM genre ORDER BY g_name NULLS FIRST"} {"question": "Find the title of course that is provided by Statistics but not Psychology departments.\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'"} {"question": "Find the name of persons who are friends with Alice for the shortest years.\nAdditional table information: table: network_2", "answer": "SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT MIN(YEAR) FROM PersonFriend WHERE friend = 'Alice')"} {"question": "What are the types of video games and how many are in each type?\nAdditional table information: table: game_1", "answer": "SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype"} {"question": "What is the id of the reviewer whose name has substring \u201cMike\u201d?\nAdditional table information: table: movie_1", "answer": "SELECT rID FROM Reviewer WHERE name LIKE '%Mike%'"} {"question": "What are the apartment number and the room count of each apartment?\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_number, room_count FROM Apartments"} {"question": "List all people names in the order of their date of birth from old to young.\nAdditional table information: table: candidate_poll", "answer": "SELECT name FROM people ORDER BY date_of_birth NULLS FIRST"} {"question": "What is the name of the person who has the oldest average age for their friends, and what is that average age?\nAdditional table information: table: network_2", "answer": "SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1"} {"question": "What are the numbers of constructors for different nationalities?\nAdditional table information: table: formula_1", "answer": "SELECT COUNT(*), nationality FROM constructors GROUP BY nationality"} {"question": "Show first name, last name, age for all female students. Their sex is F.\nAdditional table information: table: allergy_1", "answer": "SELECT Fname, Lname, Age FROM Student WHERE Sex = 'F'"} {"question": "Whare the names, friends, and ages of all people who are older than the average age of a person?\nAdditional table information: table: network_2", "answer": "SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person)"} {"question": "How many activities do we have?\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Activity"} {"question": "Which district has the least area?\nAdditional table information: table: store_product", "answer": "SELECT district_name FROM district ORDER BY city_area ASC NULLS FIRST LIMIT 1"} {"question": "How many cards does customer Art Turcotte have?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Art' AND T2.customer_last_name = 'Turcotte'"} {"question": "What is the full name of the employee who has the most customers?\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "For each fourth-grade classroom, show the classroom number and the total number of students using it.\nAdditional table information: table: student_1", "answer": "SELECT classroom, COUNT(*) FROM list WHERE grade = '4' GROUP BY classroom"} {"question": "How many accounts are there for each customer id?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id"} {"question": "What are the times of elimination for any instances in which the elimination was done by Punk or Orton?\nAdditional table information: table: wrestler", "answer": "SELECT TIME FROM elimination WHERE Eliminated_By = 'Punk' OR Eliminated_By = 'Orton'"} {"question": "What are names of customers who never ordered product Latte.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'"} {"question": "Which state has the most customers?\nAdditional table information: table: customer_complaints", "answer": "SELECT state FROM customers GROUP BY state ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What are the names and prices of all products in the store?\nAdditional table information: table: manufactory_1", "answer": "SELECT name, price FROM products"} {"question": "For each Orange county campus, report the number of degrees granted after 2000.\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = 'Orange' AND T2.year >= 2000 GROUP BY T1.campus"} {"question": "What is the name of the player with the largest number of votes?\nAdditional table information: table: riding_club", "answer": "SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1"} {"question": "What is the average price across all products?\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(price) FROM products"} {"question": "Show ids for all documents in type CV without expense budgets.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_id FROM Documents WHERE document_type_code = 'CV' EXCEPT SELECT document_id FROM Documents_with_expenses"} {"question": "How many different source system code for the cmi cross references are there?\nAdditional table information: table: local_govt_mdm", "answer": "SELECT COUNT(DISTINCT source_system_code) FROM CMI_cross_references"} {"question": "What is the lowest salary in departments with average salary greater than the overall average.\nAdditional table information: table: college_2", "answer": "SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor)"} {"question": "Find the titles of all movies not reviewed by Chris Jackson.\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson'"} {"question": "List the names of the customers who have once bought product 'food'.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1, orders AS T2, order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = 'food' GROUP BY T1.customer_id HAVING COUNT(*) >= 1"} {"question": "Find all the policy type codes associated with the customer 'Dayana Robel'\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = 'Dayana Robel'"} {"question": "Which papers' first author is affiliated with an institution in the country 'Japan' and has last name 'Ohori'? Give me the titles of the papers.\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = 'Japan' AND t2.authorder = 1 AND t1.lname = 'Ohori'"} {"question": "For each election cycle, report the number of voting records.\nAdditional table information: table: voter_2", "answer": "SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle"} {"question": "What is the issue date of the volume with the minimum weeks on top?\nAdditional table information: table: music_4", "answer": "SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC NULLS FIRST LIMIT 1"} {"question": "Show the most common headquarter for companies.\nAdditional table information: table: company_employee", "answer": "SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the names and classes of ships that do not have a captain?\nAdditional table information: table: ship_1", "answer": "SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)"} {"question": "How many papers are published by the institution 'Tokohu University'?\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'Tokohu University'"} {"question": "Show the description of the transaction type that occurs most frequently.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the shipping agent names?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT shipping_agent_name FROM Ref_Shipping_Agents"} {"question": "What is the song in the volume with the maximum weeks on top?\nAdditional table information: table: music_4", "answer": "SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1"} {"question": "List all program origins in the alphabetical order.\nAdditional table information: table: program_share", "answer": "SELECT origin FROM program ORDER BY origin NULLS FIRST"} {"question": "Please show the nominee who has been nominated the greatest number of times.\nAdditional table information: table: musical", "answer": "SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the average prices of products, grouped by manufacturer code?\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(Price), manufacturer FROM Products GROUP BY manufacturer"} {"question": "What is the address of employee Nancy Edwards?\nAdditional table information: table: store_1", "answer": "SELECT address FROM employees WHERE first_name = 'Nancy' AND last_name = 'Edwards'"} {"question": "Find the name of customer who has the lowest credit score.\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer ORDER BY credit_score NULLS FIRST LIMIT 1"} {"question": "What are the product names with average product price smaller than 1000000?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000"} {"question": "Find the name of medication used on the patient who stays in room 111?\nAdditional table information: table: hospital_1", "answer": "SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111"} {"question": "Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.\nAdditional table information: table: wine_1", "answer": "SELECT MAX(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'Central Coast' AND T2.year < 2005"} {"question": "List all of the ids for left-footed players with a height between 180cm and 190cm.\nAdditional table information: table: soccer_1", "answer": "SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = 'left'"} {"question": "Show all game names played by at least 1000 hours.\nAdditional table information: table: game_1", "answer": "SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000"} {"question": "How many musicians play in the song 'Flash'?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = 'Flash'"} {"question": "What are the first name and last name of each male member in club 'Hopkins Student Enterprises'?\nAdditional table information: table: club_1", "answer": "SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Hopkins Student Enterprises' AND t3.sex = 'M'"} {"question": "Return the the names of the drama workshop groups that are located in Feliciaberg city.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = 'Feliciaberg'"} {"question": "What are the locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets?\nAdditional table information: table: gas_company", "answer": "SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3"} {"question": "Show all titles and their instructors' names for courses in 2008, in alphabetical order by title.\nAdditional table information: table: college_2", "answer": "SELECT T1.title, T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title NULLS FIRST"} {"question": "What are the names of wines made from red grapes and with prices above 50?\nAdditional table information: table: wine_1", "answer": "SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red' AND T2.price > 50"} {"question": "What is the salaray and name of the employee that is certified to fly the most planes?\nAdditional table information: table: flight_1", "answer": "SELECT T1.name, T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which authors have submitted to more than one workshop?\nAdditional table information: table: workshop_paper", "answer": "SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1"} {"question": "What are the names of the channels owned by CCTV or HBS?\nAdditional table information: table: program_share", "answer": "SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS'"} {"question": "Show the description for role name 'Proof Reader'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_description FROM ROLES WHERE role_name = 'Proof Reader'"} {"question": "Count the number of companies.\nAdditional table information: table: company_office", "answer": "SELECT COUNT(*) FROM Companies"} {"question": "What are the first and last names of the performer who was in the back stage position for the song 'Badlands'?\nAdditional table information: table: music_2", "answer": "SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = 'Badlands' AND T1.StagePosition = 'back'"} {"question": "What are the facility codes of the apartments with more than four bedrooms?\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4"} {"question": "Show all transaction ids with transaction code 'PUR'.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR'"} {"question": "What is zip code of customer with first name as Carole and last name as Bernhard?\nAdditional table information: table: driving_school", "answer": "SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = 'Carole' AND T1.last_name = 'Bernhard'"} {"question": "What are the names and flags of ships that do not have a captain with the rank of Midshipman?\nAdditional table information: table: ship_1", "answer": "SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')"} {"question": "What are the different names of the product characteristics?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT DISTINCT characteristic_name FROM CHARACTERISTICS"} {"question": "Show all cities along with the number of drama workshop groups in each city.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town"} {"question": "List the names of members who did not attend any performance.\nAdditional table information: table: performance_attendance", "answer": "SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM member_attendance)"} {"question": "Find the names of students who have taken any course in the fall semester of year 2003.\nAdditional table information: table: college_2", "answer": "SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)"} {"question": "How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?\nAdditional table information: table: mountain_photos", "answer": "SELECT COUNT(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia'"} {"question": "Show the names of members and the location of performances they attended in ascending alphabetical order of their names.\nAdditional table information: table: performance_attendance", "answer": "SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name ASC NULLS FIRST"} {"question": "What is the zip code of the address where the teacher with first name 'Lyla' lives?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'Lyla'"} {"question": "How many airports are there per city in the United States? Order the cities by decreasing number of airports.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC"} {"question": "Show different locations and the number of performances at each location.\nAdditional table information: table: performance_attendance", "answer": "SELECT LOCATION, COUNT(*) FROM performance GROUP BY LOCATION"} {"question": "What are the distinct majors that students with treasurer votes are studying?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote"} {"question": "What are the full names and gradepoints for all enrollments?\nAdditional table information: table: college_3", "answer": "SELECT T3.Fname, T3.LName, T2.gradepoint FROM ENROLLED_IN AS T1, GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID"} {"question": "Return the duration of the actor with the greatest age.\nAdditional table information: table: musical", "answer": "SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1"} {"question": "How many items in inventory does store 1 have?\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM inventory WHERE store_id = 1"} {"question": "Find the name of the person who has friends with age above 40 but not under age 30?\nAdditional table information: table: network_2", "answer": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)"} {"question": "Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM savings)"} {"question": "display job ID for those jobs that were done by two or more for more than 300 days.\nAdditional table information: table: hr_1", "answer": "SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2"} {"question": "Show the organizer and name for churches that opened between 1830 and 1840.\nAdditional table information: table: wedding", "answer": "SELECT organized_by, name FROM church WHERE open_date BETWEEN 1830 AND 1840"} {"question": "What are the names and parties of representatives?\nAdditional table information: table: election_representative", "answer": "SELECT Name, Party FROM representative"} {"question": "Find the name of rooms booked by some customers whose first name contains ROY.\nAdditional table information: table: inn_1", "answer": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'"} {"question": "How many players enter hall of fame each year?\nAdditional table information: table: baseball_1", "answer": "SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid"} {"question": "Check the invoices record and compute the average quantities ordered with the payment method 'MasterCard'.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = 'MasterCard'"} {"question": "How many distinct countries are the climbers from?\nAdditional table information: table: climbing", "answer": "SELECT COUNT(DISTINCT Country) FROM climber"} {"question": "What is the id of the store that has the most items in inventory?\nAdditional table information: table: sakila_1", "answer": "SELECT store_id FROM inventory GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names of the customers who have order status both 'On Road' and 'Shipped'.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Shipped'"} {"question": "What is the name and country of origin for each artist who has released a song with a resolution higher than 900?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING COUNT(*) >= 1"} {"question": "What are the first names and date of birth of professors teaching course ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT DISTINCT T1.EMP_FNAME, T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = 'ACCT-211'"} {"question": "Which department has the lowest budget?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM department ORDER BY budget NULLS FIRST LIMIT 1"} {"question": "Find out 5 customers who most recently purchased something. List customers' first and last name.\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5"} {"question": "Count the number of users that are logged in.\nAdditional table information: table: document_management", "answer": "SELECT COUNT(*) FROM users WHERE user_login = 1"} {"question": "How old is each gender, on average?\nAdditional table information: table: network_2", "answer": "SELECT AVG(age), gender FROM Person GROUP BY gender"} {"question": "Find the names of customers who never ordered product Latte.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'"} {"question": "What are the names of customers who have a loan of more than 3000 in amount?\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000"} {"question": "Return the highest acc percent across all basketball matches.\nAdditional table information: table: university_basketball", "answer": "SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1"} {"question": "How many students got accepted after the tryout?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM tryout WHERE decision = 'yes'"} {"question": "Return the hometown that is most common among gymnasts.\nAdditional table information: table: gymnast", "answer": "SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of gymnasts whose hometown is not 'Santo Domingo'?\nAdditional table information: table: gymnast", "answer": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown <> 'Santo Domingo'"} {"question": "A list of the top 10 countries by average invoice size. List country name and average invoice size.\nAdditional table information: table: store_1", "answer": "SELECT billing_country, AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10"} {"question": "What are the total purchases for members rated at level 6?\nAdditional table information: table: shop_membership", "answer": "SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6"} {"question": "What is the ordered list of customer ids?\nAdditional table information: table: insurance_fnol", "answer": "SELECT customer_id, customer_name FROM customers ORDER BY customer_id ASC NULLS FIRST"} {"question": "Count the number of book clubs.\nAdditional table information: table: culture_company", "answer": "SELECT COUNT(*) FROM book_club"} {"question": "Show names of pilots that have more than one record.\nAdditional table information: table: pilot_record", "answer": "SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1"} {"question": "Find the category descriptions of the products whose descriptions include letter 't'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'"} {"question": "Find the id of songs that are available in mp4 format and have resolution lower than 1000.\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM files WHERE formats = 'mp4' INTERSECT SELECT f_id FROM song WHERE resolution < 1000"} {"question": "Which students are unaffected by allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy"} {"question": "List the all the distinct names of the products with the characteristic name 'warm'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'warm'"} {"question": "What is the name of the ship with the largest tonnage?\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1"} {"question": "How old is the youngest person for each job?\nAdditional table information: table: network_2", "answer": "SELECT MIN(age), job FROM Person GROUP BY job"} {"question": "List the name and phone number of all suppliers in the alphabetical order of their addresses.\nAdditional table information: table: department_store", "answer": "SELECT T1.supplier_name, T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details NULLS FIRST"} {"question": "How many customers have at least one order with status 'Cancelled'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = 'Cancelled'"} {"question": "What is the average unit price of all the tracks?\nAdditional table information: table: chinook_1", "answer": "SELECT AVG(UnitPrice) FROM TRACK"} {"question": "Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.\nAdditional table information: table: flight_1", "answer": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Boeing 737-800' INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Airbus A340-300'"} {"question": "What are the name of pilots aged 25 or older?\nAdditional table information: table: aircraft", "answer": "SELECT Name FROM pilot WHERE Age >= 25"} {"question": "Count the number of distinct claim outcome codes.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT COUNT(DISTINCT claim_outcome_code) FROM claims_processing"} {"question": "What are the codes corresponding to document types for which there are less than 3 documents?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3"} {"question": "Which park had most attendances in 2008?\nAdditional table information: table: baseball_1", "answer": "SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1"} {"question": "Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).\nAdditional table information: table: manufactory_1", "answer": "SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC, name ASC NULLS FIRST"} {"question": "Which allergy type has least number of allergies?\nAdditional table information: table: allergy_1", "answer": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Count the number of games taken place in park 'Columbia Park' in 1907.\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park'"} {"question": "List the names of pilots in ascending order of rank.\nAdditional table information: table: pilot_record", "answer": "SELECT Pilot_name FROM pilot ORDER BY Rank ASC NULLS FIRST"} {"question": "What are the types of film market estimations in year 1995?\nAdditional table information: table: film_rank", "answer": "SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995"} {"question": "List the names of entrepreneurs and their companies in descending order of money requested?\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested NULLS FIRST"} {"question": "Show the name of the building that has the most company offices.\nAdditional table information: table: company_office", "answer": "SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the number of rooms for each bed type?\nAdditional table information: table: inn_1", "answer": "SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType"} {"question": "How many users are there?\nAdditional table information: table: twitter_1", "answer": "SELECT COUNT(*) FROM user_profiles"} {"question": "What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'?\nAdditional table information: table: game_injury", "answer": "SELECT player, number_of_matches, SOURCE FROM injury_accident WHERE injury <> 'Knee problem'"} {"question": "What is the name of the customer who has the most orders?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of wines that are more expensive then all wines made in the year 2006?\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006)"} {"question": "What are the name of rooms booked by customers whose first name has 'ROY' in part?\nAdditional table information: table: inn_1", "answer": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'"} {"question": "What are the weights of entrepreneurs in descending order of money requested?\nAdditional table information: table: entrepreneur", "answer": "SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC"} {"question": "What are the names of body builders whose total score is higher than 300?\nAdditional table information: table: body_builder", "answer": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300"} {"question": "List the camera lens names containing substring 'Digital'.\nAdditional table information: table: mountain_photos", "answer": "SELECT name FROM camera_lens WHERE name LIKE '%Digital%'"} {"question": "How many different courses offered by Physics department?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'"} {"question": "Count the number of different hometowns of these people.\nAdditional table information: table: gymnast", "answer": "SELECT COUNT(DISTINCT Hometown) FROM people"} {"question": "What is the name and salary for employee with id 242518965?\nAdditional table information: table: flight_1", "answer": "SELECT name, salary FROM Employee WHERE eid = 242518965"} {"question": "What are the maximum, minimum and average home games each stadium held?\nAdditional table information: table: game_injury", "answer": "SELECT MAX(home_games), MIN(home_games), AVG(home_games) FROM stadium"} {"question": "Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue) FROM manufacturers WHERE revenue > (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin')"} {"question": "Count the number of customers who do not have an account.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Accounts)"} {"question": "Return the countries of the mountains that have a height larger than 5000.\nAdditional table information: table: climbing", "answer": "SELECT Country FROM mountain WHERE Height > 5000"} {"question": "Compute the number of products with a price larger than or equal to $180.\nAdditional table information: table: manufactory_1", "answer": "SELECT COUNT(*) FROM products WHERE price >= 180"} {"question": "What campuses are located in Chico?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE LOCATION = 'Chico'"} {"question": "Which game type has most number of games?\nAdditional table information: table: game_1", "answer": "SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of students who participate in the tryout for each college ordered by descending count.\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*), cName FROM tryout GROUP BY cName ORDER BY COUNT(*) DESC"} {"question": "What is the code of each location and the number of documents in that location?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code, COUNT(*) FROM Document_locations GROUP BY location_code"} {"question": "What are the full names of employees who with in department 70 or 90?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90"} {"question": "What are the names and ids of all stations that have more than 14 bikes available on average or had bikes installed in December?\nAdditional table information: table: bike_1", "answer": "SELECT T1.name, T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING AVG(T2.bikes_available) > 14 UNION SELECT name, id FROM station WHERE installation_date LIKE '12/%'"} {"question": "Give the color description for the product 'catnip'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = 'catnip'"} {"question": "Find the total and average amount of settlements.\nAdditional table information: table: insurance_fnol", "answer": "SELECT SUM(settlement_amount), AVG(settlement_amount) FROM settlements"} {"question": "find the name of people whose height is lower than the average.\nAdditional table information: table: candidate_poll", "answer": "SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people)"} {"question": "What is the savings balance of the account belonging to the customer with the highest checking balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1"} {"question": "Find the titles of all the papers written by 'Aaron Turon'.\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Aaron' AND t1.lname = 'Turon'"} {"question": "Find the id and surname of the driver who participated the most number of races?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of dorms and total capacity for each gender.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), SUM(student_capacity), gender FROM dorm GROUP BY gender"} {"question": "Find the details for all chip models.\nAdditional table information: table: phone_1", "answer": "SELECT * FROM chip_model"} {"question": "What are all info of students who registered courses but not attended courses?\nAdditional table information: table: student_assessment", "answer": "SELECT * FROM student_course_registrations WHERE NOT student_id IN (SELECT student_id FROM student_course_attendance)"} {"question": "Find the number of male (sex is 'M') students who have some food type allery.\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student WHERE sex = 'M' AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = 'food')"} {"question": "List the nominees that have been nominated more than two musicals.\nAdditional table information: table: musical", "answer": "SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*) > 2"} {"question": "List the names and origins of people who are not body builders.\nAdditional table information: table: body_builder", "answer": "SELECT Name, birth_place FROM people EXCEPT SELECT T1.Name, T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id"} {"question": "show all train numbers and names ordered by their time from early to late.\nAdditional table information: table: station_weather", "answer": "SELECT train_number, name FROM train ORDER BY TIME NULLS FIRST"} {"question": "Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000.\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft, T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000"} {"question": "What is the name of the department with an instructure who has a name like 'Soisalon'?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'"} {"question": "How many students are there?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM student"} {"question": "Return the number of music festivals of each category.\nAdditional table information: table: music_4", "answer": "SELECT Category, COUNT(*) FROM music_festival GROUP BY Category"} {"question": "What are the names of the customers who bought product 'food' at least once?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1, orders AS T2, order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = 'food' GROUP BY T1.customer_id HAVING COUNT(*) >= 1"} {"question": "List the order id, customer id for orders in Cancelled status, ordered by their order dates.\nAdditional table information: table: department_store", "answer": "SELECT order_id, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' ORDER BY order_date NULLS FIRST"} {"question": "What are the names of all female candidates in alphabetical order (sex is F)?\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name NULLS FIRST"} {"question": "What products are available at store named 'Miramichi'?\nAdditional table information: table: store_product", "answer": "SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = 'Miramichi'"} {"question": "Show all product names without an order.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id"} {"question": "Show the average and maximum damage for all storms with max speed higher than 1000.\nAdditional table information: table: storm_record", "answer": "SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000"} {"question": "List the dates of debates with number of audience bigger than 150\nAdditional table information: table: debate", "answer": "SELECT Date FROM debate WHERE Num_of_Audience > 150"} {"question": "What are the names of technicians and the machine series that they repair?\nAdditional table information: table: machine_repair", "answer": "SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID"} {"question": "What are the ids of stations that are located in San Francisco and have average bike availability above 10.\nAdditional table information: table: bike_1", "answer": "SELECT id FROM station WHERE city = 'San Francisco' INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING AVG(bikes_available) > 10"} {"question": "What are the first names of the faculty members playing both Canoeing and Kayaking?\nAdditional table information: table: activity_1", "answer": "SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Kayaking'"} {"question": "What is the total salary paid by team Boston Red Stockings in 2010?\nAdditional table information: table: baseball_1", "answer": "SELECT SUM(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2010"} {"question": "Find the name of the most expensive product.\nAdditional table information: table: customer_deliveries", "answer": "SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1"} {"question": "How many sections does each course have?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code"} {"question": "What is the station station and end station for the trips with the three smallest ids?\nAdditional table information: table: bike_1", "answer": "SELECT start_station_name, end_station_name FROM trip ORDER BY id NULLS FIRST LIMIT 3"} {"question": "For each trip, return its ending station's installation date.\nAdditional table information: table: bike_1", "answer": "SELECT T1.id, T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id"} {"question": "Show director with the largest number of show times in total.\nAdditional table information: table: cinema", "answer": "SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1"} {"question": "What are the different product colors?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT DISTINCT product_color FROM Products"} {"question": "Which destination has least number of flights?\nAdditional table information: table: flight_1", "answer": "SELECT destination FROM Flight GROUP BY destination ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What are the names of customers using the most popular payment method?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "Which artist does the album 'Balls to the Wall' belong to?\nAdditional table information: table: chinook_1", "answer": "SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = 'Balls to the Wall'"} {"question": "Show all game names played by Linda Smith\nAdditional table information: table: game_1", "answer": "SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = 'Smith' AND T3.Fname = 'Linda'"} {"question": "List the asset id, details, make and model for every asset.\nAdditional table information: table: assets_maintenance", "answer": "SELECT asset_id, asset_details, asset_make, asset_model FROM Assets"} {"question": "Which allergy type is the least common?\nAdditional table information: table: allergy_1", "answer": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What are the names of the schools with the top 3 largest class sizes?\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM college ORDER BY enr DESC LIMIT 3"} {"question": "What are the first names of all teachers who have taught a course and the corresponding descriptions?\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code"} {"question": "what is the salary and name of the employee who has the most number of aircraft certificates?\nAdditional table information: table: flight_1", "answer": "SELECT T1.name, T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of mountains in ascending alphabetical order?\nAdditional table information: table: climbing", "answer": "SELECT Name FROM mountain ORDER BY Name ASC NULLS FIRST"} {"question": "What are the names of the heads who are born outside the California state?\nAdditional table information: table: department_management", "answer": "SELECT name FROM head WHERE born_state <> 'California'"} {"question": "List the full name (first and last name), and salary for those employees who earn below 6000.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary FROM employees WHERE salary < 6000"} {"question": "For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT classroom, grade FROM list"} {"question": "display all the information of the employees whose salary if within the range of smallest salary and 2500.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500"} {"question": "Find the names of items whose rank is higher than 3 and whose average rating is above 5.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id HAVING AVG(T2.rating) > 5"} {"question": "How many coaches does each club has? List the club id, name and the number of coaches.\nAdditional table information: table: riding_club", "answer": "SELECT T1.club_id, T1.club_name, COUNT(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id"} {"question": "How many different colleges were represented at tryouts?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(DISTINCT cName) FROM tryout"} {"question": "For each location, how many gas stations are there in order?\nAdditional table information: table: gas_company", "answer": "SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*) NULLS FIRST"} {"question": "What is the project detail for the project with document 'King Book'?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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'"} {"question": "How many airlines are there?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airlines"} {"question": "Find the names of all distinct wines that have appellations in North Coast area.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'North Coast'"} {"question": "Show ids for all employees with at least 100000 salary.\nAdditional table information: table: flight_1", "answer": "SELECT eid FROM Employee WHERE salary > 100000"} {"question": "How many Annual Meeting events happened in the United Kingdom region?\nAdditional table information: table: party_people", "answer": "SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = 'United Kingdom' AND t3.Event_Name = 'Annaual Meeting'"} {"question": "What is the id, name and nationality of the architect who built most mills?\nAdditional table information: table: architecture", "answer": "SELECT T1.id, T1.name, T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the denomination shared by schools founded before 1890 and schools founded after 1900\nAdditional table information: table: school_player", "answer": "SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900"} {"question": "Return the primary conference of the school with the lowest acc percentage score.\nAdditional table information: table: university_basketball", "answer": "SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent NULLS FIRST LIMIT 1"} {"question": "List the name of ships that are not involved in any mission\nAdditional table information: table: ship_mission", "answer": "SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission)"} {"question": "Select the names and the prices of all the products in the store.\nAdditional table information: table: manufactory_1", "answer": "SELECT name, price FROM products"} {"question": "What is the total time for all lessons taught by Janessa Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT SUM(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "What are ids and total number of hours played for each game?\nAdditional table information: table: game_1", "answer": "SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid"} {"question": "What are the life spans of representatives from New York state or Indiana state?\nAdditional table information: table: election_representative", "answer": "SELECT Lifespan FROM representative WHERE State = 'New York' OR State = 'Indiana'"} {"question": "List the position of players with average number of points scored by players of that position bigger than 20.\nAdditional table information: table: sports_competition", "answer": "SELECT POSITION FROM player GROUP BY name HAVING AVG(Points) >= 20"} {"question": "What is the name of the staff that is in charge of the attraction named 'US museum'?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'US museum'"} {"question": "Show the apartment numbers of apartments with unit status availability of both 0 and 1.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1"} {"question": "Show the position of players and the corresponding number of players.\nAdditional table information: table: match_season", "answer": "SELECT POSITION, COUNT(*) FROM match_season GROUP BY POSITION"} {"question": "Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.\nAdditional table information: table: college_1", "answer": "SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'"} {"question": "Which channels are not owned by CCTV? Give me the channel names.\nAdditional table information: table: program_share", "answer": "SELECT name FROM channel WHERE OWNER <> 'CCTV'"} {"question": "Find the name and city of the airport which is the destination of the most number of routes.\nAdditional table information: table: flight_4", "answer": "SELECT T1.name, T1.city, T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the dates of the assessment notes?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT date_of_notes FROM Assessment_Notes"} {"question": "Count the number of financial transactions that the account with the name 337 has.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = '337'"} {"question": "Show the names of people and the number of times they have been on the affirmative side of debates.\nAdditional table information: table: debate", "answer": "SELECT T2.Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name"} {"question": "What are the different types of video games?\nAdditional table information: table: game_1", "answer": "SELECT DISTINCT gtype FROM Video_games"} {"question": "What is the name of the airport that is the destination of the most number of routes that start in China?\nAdditional table information: table: flight_4", "answer": "SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is id of the city that hosted events in the most recent year?\nAdditional table information: table: city_record", "answer": "SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1"} {"question": "What is the id of the longest song?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM files ORDER BY duration DESC LIMIT 1"} {"question": "Please show the names and the players of clubs.\nAdditional table information: table: sports_competition", "answer": "SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID"} {"question": "How many professors do have a Ph.D. degree?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.'"} {"question": "Show codes and fates of missions, and names of ships involved.\nAdditional table information: table: ship_mission", "answer": "SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID"} {"question": "Which teachers teach in classroom 109? Give me their last names.\nAdditional table information: table: student_1", "answer": "SELECT lastname FROM teachers WHERE classroom = 109"} {"question": "What is the department name and corresponding building for the department with the greatest budget?\nAdditional table information: table: college_2", "answer": "SELECT dept_name, building FROM department ORDER BY budget DESC LIMIT 1"} {"question": "What is the count of customers that Steve Johnson supports?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = 'Steve' AND T1.last_name = 'Johnson'"} {"question": "What is the total number of students?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Student"} {"question": "Find the name, account type, and account balance of the customer who has the highest credit score.\nAdditional table information: table: loan_1", "answer": "SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1"} {"question": "Show the players and years played for players from team 'Columbus Crew'.\nAdditional table information: table: match_season", "answer": "SELECT T1.Player, T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = 'Columbus Crew'"} {"question": "Show the document type code with fewer than 3 documents.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3"} {"question": "What are the ids of the students who are under 20 years old and are involved in at least one activity.\nAdditional table information: table: activity_1", "answer": "SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20"} {"question": "Which distinct source system code includes the substring 'en'?\nAdditional table information: table: local_govt_mdm", "answer": "SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%'"} {"question": "Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.claim_id, T1.date_claim_made, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the total and minimum enrollment of all schools?\nAdditional table information: table: university_basketball", "answer": "SELECT SUM(enrollment), MIN(enrollment) FROM university"} {"question": "Find the attribute data type for the attribute named 'Green'.\nAdditional table information: table: product_catalog", "answer": "SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = 'Green'"} {"question": "Find the name of the first 5 customers.\nAdditional table information: table: customer_deliveries", "answer": "SELECT customer_name FROM Customers ORDER BY date_became_customer NULLS FIRST LIMIT 5"} {"question": "What are the first name and last name of the players whose death record is empty?\nAdditional table information: table: baseball_1", "answer": "SELECT name_first, name_last FROM player WHERE death_year = ''"} {"question": "What are the daily hire costs for the products with substring 'Book' in its name?\nAdditional table information: table: products_for_hire", "answer": "SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%'"} {"question": "Which transportation method is used the most often to get to tourist attractions?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the number of customers.\nAdditional table information: table: customer_complaints", "answer": "SELECT COUNT(*) FROM customers"} {"question": "What are all the dates of enrollment and completion in record?\nAdditional table information: table: e_learning", "answer": "SELECT date_of_enrolment, date_of_completion FROM Student_Course_Enrolment"} {"question": "Show all payment method codes and the number of orders for each code.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT payment_method_code, COUNT(*) FROM INVOICES GROUP BY payment_method_code"} {"question": "What are the ids of the problems which are reported after 1978-06-26?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_id FROM problems WHERE date_problem_reported > '1978-06-26'"} {"question": "What is the title of the album that was released by the artist whose name has the phrase 'Led'?\nAdditional table information: table: store_1", "answer": "SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'"} {"question": "Find the name of the customer who made the order of the largest amount of goods.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items)"} {"question": "Find the first names and last names of male (sex is M) faculties who live in building NEB.\nAdditional table information: table: college_3", "answer": "SELECT Fname, Lname FROM FACULTY WHERE sex = 'M' AND Building = 'NEB'"} {"question": "Which papers have the substring 'Database' in their titles? Show the titles of the papers.\nAdditional table information: table: icfp_1", "answer": "SELECT title FROM papers WHERE title LIKE '%Database%'"} {"question": "In what city does Janessa Sawayn live?\nAdditional table information: table: driving_school", "answer": "SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "which course has most number of registered students?\nAdditional table information: table: student_assessment", "answer": "SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the names and details of all the staff members.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Name, Other_Details FROM Staff"} {"question": "How many students are there?\nAdditional table information: table: club_1", "answer": "SELECT COUNT(*) FROM student"} {"question": "What are the details for the project whose research has been published?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'"} {"question": "List the official names of cities that have not held any competition.\nAdditional table information: table: farm", "answer": "SELECT Official_Name FROM city WHERE NOT City_ID IN (SELECT Host_city_ID FROM farm_competition)"} {"question": "How many actors have appeared in each musical?\nAdditional table information: table: musical", "answer": "SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID"} {"question": "For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > '1986-11-13' GROUP BY T2.product_id"} {"question": "find the full name of employees who report to Nancy Edwards?\nAdditional table information: table: store_1", "answer": "SELECT T2.first_name, T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = 'Nancy' AND T1.last_name = 'Edwards'"} {"question": "Which school has the smallest amount of professors?\nAdditional table information: table: college_1", "answer": "SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "How many wrestlers are there?\nAdditional table information: table: wrestler", "answer": "SELECT COUNT(*) FROM wrestler"} {"question": "Which employees were hired after September 7th, 1987?\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE hire_date > '1987-09-07'"} {"question": "display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary, department_id, MAX(salary) FROM employees GROUP BY department_id"} {"question": "Give the ids of the three products purchased in the largest amounts.\nAdditional table information: table: department_store", "answer": "SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3"} {"question": "What is the owner of the channel that has the highest rating ratio?\nAdditional table information: table: program_share", "answer": "SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1"} {"question": "What are the line 1 of addresses shared by some students and some teachers?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id"} {"question": "What is the id of every song that has a resolution higher than that of a song with a rating below 8?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM song WHERE resolution > (SELECT MAX(resolution) FROM song WHERE rating < 8)"} {"question": "Find the number of routes from the United States to Canada.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')"} {"question": "What are the locations of all the gas stations ordered by opening year?\nAdditional table information: table: gas_company", "answer": "SELECT LOCATION FROM gas_station ORDER BY open_year NULLS FIRST"} {"question": "Which year had the greatest number of courses?\nAdditional table information: table: college_2", "answer": "SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the largest and smallest customer codes?\nAdditional table information: table: department_store", "answer": "SELECT MAX(customer_code), MIN(customer_code) FROM Customers"} {"question": "How many students enrolled in class ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'"} {"question": "What is the product description of the product booked with an amount of 102.76?\nAdditional table information: table: products_for_hire", "answer": "SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76"} {"question": "Which room has cheapest base price? List the room's name and the base price.\nAdditional table information: table: inn_1", "answer": "SELECT roomName, basePrice FROM Rooms ORDER BY basePrice ASC NULLS FIRST LIMIT 1"} {"question": "What are the last names for all scholarship students?\nAdditional table information: table: game_1", "answer": "SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'"} {"question": "List official names of cities in descending order of population.\nAdditional table information: table: farm", "answer": "SELECT Official_Name FROM city ORDER BY Population DESC"} {"question": "What are the titles of all the albums?\nAdditional table information: table: store_1", "answer": "SELECT title FROM albums"} {"question": "List the builders of railways in ascending alphabetical order.\nAdditional table information: table: railway", "answer": "SELECT Builder FROM railway ORDER BY Builder ASC NULLS FIRST"} {"question": "What is the address of each course author or tutor?\nAdditional table information: table: e_learning", "answer": "SELECT address_line_1 FROM Course_Authors_and_Tutors"} {"question": "Find the market shares and names of furnitures which no any company is producing in our records.\nAdditional table information: table: manufacturer", "answer": "SELECT Market_Rate, name FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte)"} {"question": "What is the name of the institution the author 'Katsuhiro Ueno' belongs to?\nAdditional table information: table: icfp_1", "answer": "SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = 'Katsuhiro' AND t1.lname = 'Ueno'"} {"question": "Which course is enrolled in by the most students? Give me the course name.\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of the states where at least 3 heads were born?\nAdditional table information: table: department_management", "answer": "SELECT born_state FROM head GROUP BY born_state HAVING COUNT(*) >= 3"} {"question": "Find the name of the train whose route runs through greatest number of stations.\nAdditional table information: table: station_weather", "answer": "SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id = t2.train_id GROUP BY t2.train_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the id, forename and number of races of all drivers who have at least participated in two races?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2"} {"question": "Find the number of the products that have their color described as 'red' and have a characteristic named 'slow'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'slow'"} {"question": "What are all the songs in albums under label 'Universal Music Group'?\nAdditional table information: table: music_2", "answer": "SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = 'Universal Music Group'"} {"question": "Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components.\nAdditional table information: table: manufacturer", "answer": "SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10"} {"question": "Show the transaction type code that occurs the fewest times.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Which contact channel has been used by the customer with name 'Tillman Ernser'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Tillman Ernser'"} {"question": "List the name of albums that are released by aritist whose name has 'Led'\nAdditional table information: table: store_1", "answer": "SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'"} {"question": "what is the fuel propulsion where the fleet series (quantity) is 310-329 (20)? \nAdditional table information: table: \"vehicles\".\"cars\"\ncolumns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion", "answer": "SELECT fuel_propulsion FROM \"vehicles\".\"cars\" WHERE fleet_series_quantity = '310-329 (20)'"} {"question": "What are the names of wrestlers who have never been eliminated?\nAdditional table information: table: wrestler", "answer": "SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination)"} {"question": "Give all information regarding instructors, in order of salary from least to greatest.\nAdditional table information: table: college_2", "answer": "SELECT * FROM instructor ORDER BY salary NULLS FIRST"} {"question": "What are the distinct names of wines that have appellations in the North Coast area?\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'North Coast'"} {"question": "Show the name of each county along with the corresponding number of delegates from that county.\nAdditional table information: table: election", "answer": "SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id"} {"question": "Which college has the most authors with submissions?\nAdditional table information: table: workshop_paper", "answer": "SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many patients do each physician take care of? List their names and number of patients they take care of.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name, COUNT(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid"} {"question": "Give the names of mountains in alphabetical order.\nAdditional table information: table: climbing", "answer": "SELECT Name FROM mountain ORDER BY Name ASC NULLS FIRST"} {"question": "How many customers in total?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Customers"} {"question": "What is the product, chromosome, and porphyria of the enzymes located at 'Cytosol'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT product, chromosome, porphyria FROM enzyme WHERE LOCATION = 'Cytosol'"} {"question": "Show the names of phones and the districts of markets they are on.\nAdditional table information: table: phone_market", "answer": "SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID"} {"question": "Show the facility codes of apartments with more than 4 bedrooms.\nAdditional table information: table: apartment_rentals", "answer": "SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4"} {"question": "Show the names of buildings except for those having an institution founded in 2003.\nAdditional table information: table: protein_institute", "answer": "SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003"} {"question": "Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.\nAdditional table information: table: sakila_1", "answer": "SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING COUNT(*) < 3"} {"question": "which gender got the highest average uncertain ratio.\nAdditional table information: table: candidate_poll", "answer": "SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1"} {"question": "What is the category and typical buying price of the product with name 'cumin'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_category_code, typical_buying_price FROM products WHERE product_name = 'cumin'"} {"question": "What is the first and last name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in.\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID"} {"question": "What are the types of vocals that the musician with the last name 'Heilo' played in 'Der Kapitan'?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = 'Heilo' AND T2.title = 'Der Kapitan'"} {"question": "What are the details of the student who registered for the most number of courses?\nAdditional table information: table: student_assessment", "answer": "SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the first name of the staff who did not give any lesson?\nAdditional table information: table: driving_school", "answer": "SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id"} {"question": "What are the years, titles, and publishers for all books, ordered by year descending?\nAdditional table information: table: culture_company", "answer": "SELECT YEAR, book_title, publisher FROM book_club ORDER BY YEAR DESC"} {"question": "What is the name of the district with the smallest area?\nAdditional table information: table: store_product", "answer": "SELECT district_name FROM district ORDER BY city_area ASC NULLS FIRST LIMIT 1"} {"question": "What are the titles of all movies that James Cameron directed after 2000?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000"} {"question": "Find the number of projects which each scientist is working on and scientist's name.\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name"} {"question": "What are the name, latitude, and city of the station with the lowest latitude?\nAdditional table information: table: bike_1", "answer": "SELECT name, lat, city FROM station ORDER BY lat NULLS FIRST LIMIT 1"} {"question": "Which service id and type has the least number of participants?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What is the payment method that were used the least often?\nAdditional table information: table: insurance_policies", "answer": "SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What are each document's location code, and starting date and ending data in that location?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code, date_in_location_from, date_in_locaton_to FROM Document_locations"} {"question": "Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.\nAdditional table information: table: soccer_2", "answer": "SELECT cName, enr FROM College WHERE enr > 10000 AND state = 'LA'"} {"question": "What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = 'white' AND t2.unit_of_measure <> 'Handful'"} {"question": "Count the number of different statuses.\nAdditional table information: table: farm", "answer": "SELECT COUNT(DISTINCT Status) FROM city"} {"question": "What is the maximum, minimum and average market share of the listed browsers?\nAdditional table information: table: browser_web", "answer": "SELECT MAX(market_share), MIN(market_share), AVG(market_share) FROM browser"} {"question": "In zip code 94107, on which day neither Fog nor Rain was not observed?\nAdditional table information: table: bike_1", "answer": "SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS <> 'Fog' AND EVENTS <> 'Rain'"} {"question": "What is the name of the body builder with the greatest body weight?\nAdditional table information: table: body_builder", "answer": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1"} {"question": "What are the names of the states that have 2 to 4 employees living there?\nAdditional table information: table: driving_school", "answer": "SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4"} {"question": "Find all students taught by MARROTTE KIRK. Output first and last names of students.\nAdditional table information: table: student_1", "answer": "SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'MARROTTE' AND T2.lastname = 'KIRK'"} {"question": "What is the total number of enrollment of schools that do not have any goalie player?\nAdditional table information: table: soccer_2", "answer": "SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = 'goalie')"} {"question": "What are the department name and room for the course INTRODUCTION TO COMPUTER SCIENCE?\nAdditional table information: table: college_3", "answer": "SELECT T2.Dname, T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = 'INTRODUCTION TO COMPUTER SCIENCE'"} {"question": "What are the store names of drama workshop groups?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Store_Name FROM Drama_Workshop_Groups"} {"question": "Find the name, type, and flag of the ship that is built in the most recent year.\nAdditional table information: table: ship_1", "answer": "SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1"} {"question": "Find the name of the customer who made the most orders.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Please show the police forces and the number of counties with each police force.\nAdditional table information: table: county_public_safety", "answer": "SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force"} {"question": "Which authors with submissions are from college 'Florida' or 'Temple'?\nAdditional table information: table: workshop_paper", "answer": "SELECT Author FROM submission WHERE College = 'Florida' OR College = 'Temple'"} {"question": "Which catalog content has the smallest capacity? Return the catalog entry name.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC NULLS FIRST LIMIT 1"} {"question": "What are the allergy types and how many allergies correspond to each one?\nAdditional table information: table: allergy_1", "answer": "SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype"} {"question": "What is the role name and role description for employee called Ebba?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = 'Ebba'"} {"question": "How many trips started from Mountain View city and ended at Palo Alto city?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(*) FROM station AS T1, trip AS T2, station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = 'Mountain View' AND T3.city = 'Palo Alto'"} {"question": "Find the names of states that have some college students playing in the mid position but not in the goalie position.\nAdditional table information: table: soccer_2", "answer": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'"} {"question": "Provide the last name of the youngest student.\nAdditional table information: table: allergy_1", "answer": "SELECT LName FROM Student WHERE age = (SELECT MIN(age) FROM Student)"} {"question": "Give me the average and minimum price (in Euro) of the products.\nAdditional table information: table: product_catalog", "answer": "SELECT AVG(price_in_euros), MIN(price_in_euros) FROM catalog_contents"} {"question": "Where is the club 'Hopkins Student Enterprises' located?\nAdditional table information: table: club_1", "answer": "SELECT clublocation FROM club WHERE clubname = 'Hopkins Student Enterprises'"} {"question": "What campuses are located in the county of Los Angeles?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE county = 'Los Angeles'"} {"question": "What are the id of all the files in mp3 format?\nAdditional table information: table: music_1", "answer": "SELECT f_id FROM files WHERE formats = 'mp3'"} {"question": "List the creation year, name and budget of each department.\nAdditional table information: table: department_management", "answer": "SELECT creation, name, budget_in_billions FROM department"} {"question": "Which tourist attraction is associated with the photo 'game1'? Return its name.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = 'game1'"} {"question": "Which classrooms are used by grade 5?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT classroom FROM list WHERE grade = 5"} {"question": "Which authors did not submit to any workshop?\nAdditional table information: table: workshop_paper", "answer": "SELECT Author FROM submission WHERE NOT Submission_ID IN (SELECT Submission_ID FROM acceptance)"} {"question": "What is the id of the event with the most participants?\nAdditional table information: table: local_govt_in_alabama", "answer": "SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return complaint status codes have more than 3 corresponding complaints?\nAdditional table information: table: customer_complaints", "answer": "SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3"} {"question": "Return all players sorted by college in ascending alphabetical order.\nAdditional table information: table: match_season", "answer": "SELECT player FROM match_season ORDER BY College ASC NULLS FIRST"} {"question": "What are the names of the dorm that does not have a TV Lounge?\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'"} {"question": "What is the title of the course that is a prerequisite for Mobile Computing?\nAdditional table information: table: college_2", "answer": "SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')"} {"question": "Find the name of the customers who have at most two orders.\nAdditional table information: table: tracking_orders", "answer": "SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2"} {"question": "List all region names in alphabetical order.\nAdditional table information: table: storm_record", "answer": "SELECT region_name FROM region ORDER BY region_name NULLS FIRST"} {"question": "What are the names of people who are not entrepreneurs?\nAdditional table information: table: entrepreneur", "answer": "SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur)"} {"question": "How many gas station are opened between 2000 and 2005?\nAdditional table information: table: gas_company", "answer": "SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005"} {"question": "How many clubs have total medals less than 10?\nAdditional table information: table: sports_competition", "answer": "SELECT COUNT(*) FROM club_rank WHERE Total < 10"} {"question": "Count the number of players who enter hall of fame for each year.\nAdditional table information: table: baseball_1", "answer": "SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid"} {"question": "Find the name and id of the top 3 expensive rooms.\nAdditional table information: table: inn_1", "answer": "SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3"} {"question": "What are the distinct positions of the players from a country whose capital is Dublin?\nAdditional table information: table: match_season", "answer": "SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = 'Dublin'"} {"question": "How many customers have no payment histories?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments)"} {"question": "How many parks does Atlanta city have?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM park WHERE city = 'Atlanta'"} {"question": "How many papers are 'Atsushi Ohori' the author of?\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Atsushi' AND t1.lname = 'Ohori'"} {"question": "For each year, return the year and the average number of attendance at home games.\nAdditional table information: table: baseball_1", "answer": "SELECT YEAR, AVG(attendance) FROM home_game GROUP BY YEAR"} {"question": "What are the addresses of the course authors or tutors with personal name 'Cathrine'\nAdditional table information: table: e_learning", "answer": "SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name = 'Cathrine'"} {"question": "Compute the total order quantities of the product 'photo'.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = 'photo'"} {"question": "Which clubs are located at 'AKW'? Return the club names.\nAdditional table information: table: club_1", "answer": "SELECT clubname FROM club WHERE clublocation = 'AKW'"} {"question": "Who are the advisors for students that live in a city with city code 'BAL'?\nAdditional table information: table: voter_2", "answer": "SELECT Advisor FROM STUDENT WHERE city_code = 'BAL'"} {"question": "Count the number of players who were born in USA and have bats information 'R'.\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM player WHERE birth_country = 'USA' AND bats = 'R'"} {"question": "Return the total and minimum enrollments across all schools.\nAdditional table information: table: university_basketball", "answer": "SELECT SUM(enrollment), MIN(enrollment) FROM university"} {"question": "How many problems does the product with the most problems have? List the number of the problems and product name.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Compute the mean price of procedures physician John Wen was trained in.\nAdditional table information: table: hospital_1", "answer": "SELECT AVG(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "What are the names, headquarters and founders of the company with the highest revenue?\nAdditional table information: table: manufactory_1", "answer": "SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1"} {"question": "What are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?\nAdditional table information: table: store_product", "answer": "SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000"} {"question": "Sort the names of all counties in descending alphabetical order.\nAdditional table information: table: election", "answer": "SELECT County_name FROM county ORDER BY County_name DESC"} {"question": "What is the average number of gold medals for clubs?\nAdditional table information: table: sports_competition", "answer": "SELECT AVG(Gold) FROM club_rank"} {"question": "List venues of all matches in the order of their dates starting from the most recent one.\nAdditional table information: table: city_record", "answer": "SELECT venue FROM MATCH ORDER BY date DESC"} {"question": "List top 10 employee work longest in the company. List employee's first and last name.\nAdditional table information: table: store_1", "answer": "SELECT first_name, last_name FROM employees ORDER BY hire_date ASC NULLS FIRST LIMIT 10"} {"question": "Show the theme for exhibitions with both records of an attendance below 100 and above 500.\nAdditional table information: table: theme_gallery", "answer": "SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500"} {"question": "Find the number of different cities which banks are located at.\nAdditional table information: table: loan_1", "answer": "SELECT COUNT(DISTINCT city) FROM bank"} {"question": "Give the building that the instructor who teaches the greatest number of courses lives in.\nAdditional table information: table: college_3", "answer": "SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many phone hardware models are produced by the company named 'Nokia Corporation'?\nAdditional table information: table: phone_1", "answer": "SELECT COUNT(*) FROM phone WHERE Company_name = 'Nokia Corporation'"} {"question": "What are the names of the technicians that have not been assigned to repair machines?\nAdditional table information: table: machine_repair", "answer": "SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment)"} {"question": "Find the number of dorms that have some amenity.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(DISTINCT dormid) FROM has_amenity"} {"question": "Which customer have the most policies? Give me the customer details.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the official name and status of the city with the largest population.\nAdditional table information: table: farm", "answer": "SELECT Official_Name, Status FROM city ORDER BY Population DESC LIMIT 1"} {"question": "Show the name of buildings that do not have any institution.\nAdditional table information: table: protein_institute", "answer": "SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution)"} {"question": "How many faculty members are at the university that gave the least number of degrees in 2001?\nAdditional table information: table: csu_1", "answer": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees NULLS FIRST LIMIT 1"} {"question": "Find the emails and phone numbers of all the customers, ordered by email address and phone number.\nAdditional table information: table: customer_complaints", "answer": "SELECT email_address, phone_number FROM customers ORDER BY email_address NULLS FIRST, phone_number NULLS FIRST"} {"question": "What are the names of the members that have never registered at any branch?\nAdditional table information: table: shop_membership", "answer": "SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch)"} {"question": "What is the company where Eduardo Martins is a customer?\nAdditional table information: table: store_1", "answer": "SELECT company FROM customers WHERE first_name = 'Eduardo' AND last_name = 'Martins'"} {"question": "List the top 10 customers by total gross sales. List customers' first and last name and total gross sales.\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10"} {"question": "List the names of products that are not in any event.\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Name FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events)"} {"question": "Show the number of transactions with transaction type code 'SALE' for different investors if it is larger than 0.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT investor_id, COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = 'SALE' GROUP BY investor_id"} {"question": "Which cities have lower temperature in March than in July and have been once host cities?\nAdditional table information: table: city_record", "answer": "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"} {"question": "What are the ids for courses in the Fall of 2009 or the Spring of 2010?\nAdditional table information: table: college_2", "answer": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010"} {"question": "What are the maximum and minimum settlement amount on record?\nAdditional table information: table: insurance_fnol", "answer": "SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements"} {"question": "What are the names of companies that do not make DVD drives?\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T1.name = 'DVD drive'"} {"question": "Show the minimum amount of transactions whose type code is 'PUR' and whose share count is bigger than 50.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT MIN(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = 'PUR' AND share_count > 50"} {"question": "What is the order id and order details for the order more than two invoices.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING COUNT(*) > 2"} {"question": "What is the shipping agent code of shipping agent UPS?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = 'UPS'"} {"question": "What are the dates of ceremony at music festivals corresponding to volumes that lasted more than 2 weeks on top?\nAdditional table information: table: music_4", "answer": "SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2"} {"question": "What are the names of actors and the musicals that they are in?\nAdditional table information: table: musical", "answer": "SELECT T1.Name, T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID"} {"question": "What are the names of members and their corresponding parties?\nAdditional table information: table: party_people", "answer": "SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id"} {"question": "What are the different transaction types, and how many transactions of each have taken place?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT transaction_type, COUNT(*) FROM Financial_transactions GROUP BY transaction_type"} {"question": "Count the number of all the calendar items.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM Ref_calendar"} {"question": "What are the ids, names, and FDA approval status for medicines ordered by descending number of possible enzyme interactions?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC"} {"question": "How many branches where have more than average number of memberships are there?\nAdditional table information: table: shop_membership", "answer": "SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch)"} {"question": "Find the names of all wines produced in 2008.\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE WHERE YEAR = '2008'"} {"question": "Find the title and star rating of the movie that got the least rating star for each reviewer.\nAdditional table information: table: movie_1", "answer": "SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID"} {"question": "Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100"} {"question": "Find the name of amenities Smith Hall dorm have.\nAdditional table information: table: dorm_1", "answer": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall'"} {"question": "What are the distinct wineries which produce wines costing between 50 and 100?\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100"} {"question": "Count the number of regions.\nAdditional table information: table: storm_record", "answer": "SELECT COUNT(*) FROM region"} {"question": "What is the city with the most number of flagship stores?\nAdditional table information: table: store_product", "answer": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the name of musicals that do not have actors.\nAdditional table information: table: musical", "answer": "SELECT Name FROM musical WHERE NOT Musical_ID IN (SELECT Musical_ID FROM actor)"} {"question": "Count the number of addressed in the California district.\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM address WHERE district = 'California'"} {"question": "which country did participated in the most number of Tournament competitions?\nAdditional table information: table: sports_competition", "answer": "SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the id of the candidate whose email is stanley.monahan@example.org?\nAdditional table information: table: student_assessment", "answer": "SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = 'stanley.monahan@example.org'"} {"question": "What are the characters and duration of actors?\nAdditional table information: table: musical", "answer": "SELECT Character, Duration FROM actor"} {"question": "Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.\nAdditional table information: table: scientist_1", "answer": "SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)"} {"question": "What are the countries that participated in both friendly and tournament type competitions?\nAdditional table information: table: sports_competition", "answer": "SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'"} {"question": "Count the number of documents with the type code BK that correspond to each product id.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = 'BK' GROUP BY project_id"} {"question": "Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in?\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM procedures WHERE cost > 1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "Show the number of document types.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM Ref_document_types"} {"question": "What is the id of the product that was ordered the most often?\nAdditional table information: table: department_store", "answer": "SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many films have the word 'Dummy' in their titles?\nAdditional table information: table: cinema", "answer": "SELECT COUNT(*) FROM film WHERE title LIKE '%Dummy%'"} {"question": "Find all the distinct district names ordered by city area in descending.\nAdditional table information: table: store_product", "answer": "SELECT DISTINCT District_name FROM district ORDER BY city_area DESC"} {"question": "For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.\nAdditional table information: table: student_1", "answer": "SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade"} {"question": "What is the software platform that is most common amongst all devices?\nAdditional table information: table: device", "answer": "SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the name of customers who do not have a loan with a type of Mortgages.\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages'"} {"question": "How many weddings are there in year 2016?\nAdditional table information: table: wedding", "answer": "SELECT COUNT(*) FROM wedding WHERE YEAR = 2016"} {"question": "List all channel names ordered by their rating in percent from big to small.\nAdditional table information: table: program_share", "answer": "SELECT name FROM channel ORDER BY rating_in_percent DESC"} {"question": "Find the name and account balance of the customer whose name includes the letter \u2018a\u2019.\nAdditional table information: table: loan_1", "answer": "SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'"} {"question": "Find the first and last name of students who are living in the dorms that have amenity TV Lounge.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')"} {"question": "What are the names of all the clubs starting with the oldest?\nAdditional table information: table: sports_competition", "answer": "SELECT name FROM club ORDER BY Start_year ASC NULLS FIRST"} {"question": "Find the types and details for all premises and order by the premise type.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT premises_type, premise_details FROM premises ORDER BY premises_type NULLS FIRST"} {"question": "What is the location code for the country 'Canada'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code FROM Ref_locations WHERE location_name = 'Canada'"} {"question": "What is the name of all tracks in the Rock genre?\nAdditional table information: table: store_1", "answer": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = 'Rock'"} {"question": "How many phones are there?\nAdditional table information: table: phone_market", "answer": "SELECT COUNT(*) FROM phone"} {"question": "Return the name, phone number and email address for the customer with the most orders.\nAdditional table information: table: department_store", "answer": "SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Please show the most common publication date.\nAdditional table information: table: book_2", "answer": "SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the average prices of wines for different years?\nAdditional table information: table: wine_1", "answer": "SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR"} {"question": "give me names of all compatible browsers and accelerators in the descending order of compatible year\nAdditional table information: table: browser_web", "answer": "SELECT T2.name, T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id ORDER BY T1.compatible_since_year DESC"} {"question": "What are the names of procedures physician John Wen was trained in?\nAdditional table information: table: hospital_1", "answer": "SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "What is the name of the aircraft that was on flight number 99?\nAdditional table information: table: flight_1", "answer": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99"} {"question": "Find the name of the ship that is steered by the youngest captain.\nAdditional table information: table: ship_1", "answer": "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"} {"question": "Find the total quantity of products associated with the orders in the 'Cancelled' status.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = 'Cancelled'"} {"question": "What are the different majors?\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT Major FROM Student"} {"question": "Show the average price of hotels for each star rating code.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code"} {"question": "List the name of products in ascending order of price.\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Name FROM Products ORDER BY Product_Price ASC NULLS FIRST"} {"question": "What are the full names of customers who have accounts?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id"} {"question": "What is all the information about courses, ordered by credits ascending?\nAdditional table information: table: college_3", "answer": "SELECT * FROM COURSE ORDER BY Credits NULLS FIRST"} {"question": "What is the average number of hosts for parties?\nAdditional table information: table: party_host", "answer": "SELECT AVG(Number_of_hosts) FROM party"} {"question": "List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'.\nAdditional table information: table: driving_school", "answer": "SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn' AND nickname LIKE '%s%'"} {"question": "List all country and league names.\nAdditional table information: table: soccer_1", "answer": "SELECT T1.name, T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id"} {"question": "What is the county that produces the most wines scoring higher than 90?\nAdditional table information: table: wine_1", "answer": "SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show all the Store_Name of drama workshop groups.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Store_Name FROM Drama_Workshop_Groups"} {"question": "List ids and details for all projects.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT project_id, project_details FROM Projects"} {"question": "List all countries of markets in descending order of number of cities.\nAdditional table information: table: film_rank", "answer": "SELECT Country FROM market ORDER BY Number_cities DESC"} {"question": "Show writers who have published a book with price more than 4000000.\nAdditional table information: table: book_2", "answer": "SELECT T1.Writer FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID WHERE T2.Price > 4000000"} {"question": "What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?\nAdditional table information: table: ship_1", "answer": "SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'"} {"question": "Find the total rating ratio for each channel owner.\nAdditional table information: table: program_share", "answer": "SELECT SUM(Rating_in_percent), OWNER FROM channel GROUP BY OWNER"} {"question": "Count the number of bank branches.\nAdditional table information: table: loan_1", "answer": "SELECT COUNT(*) FROM bank"} {"question": "How many different advisors are listed?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(DISTINCT advisor) FROM Student"} {"question": "List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'"} {"question": "How many different colleges are there?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM College"} {"question": "What is the year in which most ships were built?\nAdditional table information: table: ship_1", "answer": "SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many documents were shipped by USPS?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT COUNT(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = 'USPS'"} {"question": "How many universities have a location that contains NY?\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(*) FROM university WHERE LOCATION LIKE '%NY%'"} {"question": "What are the ids and details of all accounts?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT account_id, account_details FROM Accounts"} {"question": "Find the names of all instructors whose salary is greater than the salary of all instructors in the Biology department.\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE salary > (SELECT MAX(salary) FROM instructor WHERE dept_name = 'Biology')"} {"question": "What are the distinct names and phone numbers for suppliers who have red jeans?\nAdditional table information: table: department_store", "answer": "SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = 'red jeans'"} {"question": "What are the names of customers who do not have saving accounts?\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'"} {"question": "Find the names of the tourist attractions that is either accessible by walk or at address 660 Shea Crescent.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '660 Shea Crescent' OR T2.How_to_Get_There = 'walk'"} {"question": "Return the sum and average of all settlement amounts.\nAdditional table information: table: insurance_fnol", "answer": "SELECT SUM(settlement_amount), AVG(settlement_amount) FROM settlements"} {"question": "Count the number of countries.\nAdditional table information: table: match_season", "answer": "SELECT COUNT(*) FROM country"} {"question": "What are the type come, name, and description of the document that has either the name 'Noel CV' or 'King Book'?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'"} {"question": "What are the first names of all students in course ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'"} {"question": "How much money did Lucas Mancini spend?\nAdditional table information: table: store_1", "answer": "SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = 'Lucas' AND T1.last_name = 'Mancini'"} {"question": "Give me the claim date, settlement date for all the claims whose claimed amount is larger than the average.\nAdditional table information: table: insurance_policies", "answer": "SELECT Date_Claim_Made, Date_Claim_Settled FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims)"} {"question": "Show the names and genders of players with a coach starting after 2011.\nAdditional table information: table: riding_club", "answer": "SELECT T3.Player_name, T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011"} {"question": "List all the distinct stations from which a trip of duration below 100 started.\nAdditional table information: table: bike_1", "answer": "SELECT DISTINCT start_station_name FROM trip WHERE duration < 100"} {"question": "Show the statuses of roller coasters longer than 3300 or higher than 100.\nAdditional table information: table: roller_coaster", "answer": "SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100"} {"question": "How many different professors are there for the different schools?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code"} {"question": "How many professors are teaching class with code ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = 'ACCT-211'"} {"question": "Find all students taught by OTHA MOYER. Output the first and last names of the students.\nAdditional table information: table: student_1", "answer": "SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'"} {"question": "Find the department name of the instructor whose name contains 'Soisalon'.\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'"} {"question": "How many invoices were billed from Chicago, IL?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM invoices WHERE billing_city = 'Chicago' AND billing_state = 'IL'"} {"question": "What are the first name and last name of all the instructors?\nAdditional table information: table: activity_1", "answer": "SELECT fname, lname FROM Faculty WHERE Rank = 'Instructor'"} {"question": "List the name of the company that produced more than one phone model.\nAdditional table information: table: phone_1", "answer": "SELECT Company_name FROM phone GROUP BY Company_name HAVING COUNT(*) > 1"} {"question": "Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code, bathroom_count, bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY SUM(room_count) DESC LIMIT 1"} {"question": "Which building has the largest number of company offices? Give me the building name.\nAdditional table information: table: company_office", "answer": "SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?\nAdditional table information: table: sakila_1", "answer": "SELECT first_name FROM customer WHERE NOT customer_id IN (SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01')"} {"question": "What is the average GPA of students taking ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'"} {"question": "Return the average gross sales in dollars across all films.\nAdditional table information: table: film_rank", "answer": "SELECT AVG(Gross_in_dollar) FROM film"} {"question": "For each id of a driver who participated in at most 30 races, how many races did they participate in?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30"} {"question": "What is the oldest log id and its corresponding problem id?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_log_id, problem_id FROM problem_log ORDER BY log_entry_date NULLS FIRST LIMIT 1"} {"question": "Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= '2009-01-01' AND T2.date_order_placed <= '2010-01-01'"} {"question": "What are the low and high estimates of film markets?\nAdditional table information: table: film_rank", "answer": "SELECT Low_Estimate, High_Estimate FROM film_market_estimation"} {"question": "Count the number of times the team 'Boston Red Stockings' lost in 2009 postseason.\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009"} {"question": "List all department names ordered by their starting date.\nAdditional table information: table: company_1", "answer": "SELECT dname FROM department ORDER BY mgr_start_date NULLS FIRST"} {"question": "What is average and maximum salary of all employees.\nAdditional table information: table: flight_1", "answer": "SELECT AVG(salary), MAX(salary) FROM Employee"} {"question": "Find the first name and gender of the student who has allergy to milk but not cat.\nAdditional table information: table: allergy_1", "answer": "SELECT fname, sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = 'Milk' EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = 'Cat')"} {"question": "Find the id and name of the stadium where the largest number of injury accidents occurred.\nAdditional table information: table: game_injury", "answer": "SELECT T1.id, T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many students attend course English?\nAdditional table information: table: student_assessment", "answer": "SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'English'"} {"question": "What are the names of the different bank branches, and what are their total loan amounts?\nAdditional table information: table: loan_1", "answer": "SELECT SUM(amount), T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname"} {"question": "What are the different ids and names of the stations that have had more than 12 bikes available?\nAdditional table information: table: bike_1", "answer": "SELECT DISTINCT T1.id, T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12"} {"question": "What is the name of the department with the student that has the lowest GPA?\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa NULLS FIRST LIMIT 1"} {"question": "How many students live in each city and what are their average ages?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code"} {"question": "How many employees have a first name of Ludie?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Staff WHERE first_name = 'Ludie'"} {"question": "What is the name of the most recent movie?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE YEAR = (SELECT MAX(YEAR) FROM Movie)"} {"question": "List email address and birthday of customer whose first name as Carole.\nAdditional table information: table: driving_school", "answer": "SELECT email_address, date_of_birth FROM Customers WHERE first_name = 'Carole'"} {"question": "What are the names of storms that did not affect two or more regions?\nAdditional table information: table: storm_record", "answer": "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"} {"question": "What are the faculty id and the number of students each faculty has?\nAdditional table information: table: activity_1", "answer": "SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID"} {"question": "What are the different cities that have more than 100 memberships?\nAdditional table information: table: shop_membership", "answer": "SELECT DISTINCT city FROM branch WHERE membership_amount >= 100"} {"question": "Show the booking status code and the corresponding number of bookings.\nAdditional table information: table: apartment_rentals", "answer": "SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code"} {"question": "What are the first names of students studying in room 107?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT firstname FROM list WHERE classroom = 107"} {"question": "Show the themes of parties and the names of the party hosts.\nAdditional table information: table: party_host", "answer": "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"} {"question": "List the name of all tracks in the playlists of Movies.\nAdditional table information: table: store_1", "answer": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = 'Movies'"} {"question": "How many staff live in state Georgia?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Addresses WHERE state_province_county = 'Georgia'"} {"question": "List the titles of the books in ascending order of issues.\nAdditional table information: table: book_2", "answer": "SELECT Title FROM book ORDER BY Issues ASC NULLS FIRST"} {"question": "Which product has been ordered most number of times?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the title and director of the movie released in the year 2000 or earlier that had the highest worldwide gross.\nAdditional table information: table: culture_company", "answer": "SELECT title, director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1"} {"question": "Show the company name with the number of gas station.\nAdditional table information: table: gas_company", "answer": "SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id"} {"question": "What are the names of enzymes who does not produce 'Heme'?\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name FROM enzyme WHERE product <> 'Heme'"} {"question": "Show ids, customer ids, names for all accounts.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT account_id, customer_id, account_name FROM Accounts"} {"question": "Give the ids for documents that have the budget description 'Government'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = 'Government'"} {"question": "Show the names of customers having an order with shipping method FedEx and order status Paid.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid'"} {"question": "List the number of invoices from the US, grouped by state.\nAdditional table information: table: store_1", "answer": "SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = 'USA' GROUP BY billing_state"} {"question": "What is the average age of students who are living in the dorm with the largest capacity?\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT MAX(student_capacity) FROM dorm)"} {"question": "Who are the customers that had more than 1 policy? List the customer details and id.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 1"} {"question": "Who are the lieutenant governor and comptroller from the democratic party?\nAdditional table information: table: election", "answer": "SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = 'Democratic'"} {"question": "Find the name of amenities of the dorm where the student with last name Smith is living in.\nAdditional table information: table: dorm_1", "answer": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith'"} {"question": "Show all origins and the number of flights from each origin.\nAdditional table information: table: flight_1", "answer": "SELECT origin, COUNT(*) FROM Flight GROUP BY origin"} {"question": "Find the grade taught in classroom 103.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT grade FROM list WHERE classroom = 103"} {"question": "How many male and female assistant professors do we have?\nAdditional table information: table: activity_1", "answer": "SELECT sex, COUNT(*) FROM Faculty WHERE rank = 'AsstProf' GROUP BY sex"} {"question": "Show the faculty id of each faculty member, along with the number of students he or she advises.\nAdditional table information: table: activity_1", "answer": "SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID"} {"question": "For each player, show the team and the location of school they belong to.\nAdditional table information: table: school_player", "answer": "SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID"} {"question": "Who are the different directors of films which had market estimation in 1995?\nAdditional table information: table: film_rank", "answer": "SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995"} {"question": "Return all the apartment numbers sorted by the room count in ascending order.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_number FROM Apartments ORDER BY room_count ASC NULLS FIRST"} {"question": "What are the different names of the colleges involved in the tryout in alphabetical order?\nAdditional table information: table: soccer_2", "answer": "SELECT DISTINCT cName FROM tryout ORDER BY cName NULLS FIRST"} {"question": "What is the last name of the first individual contacted from the organization with the maximum UK Vat number across all organizations?\nAdditional table information: table: e_government", "answer": "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"} {"question": "Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = 'F' AND T2.Election_Cycle = 'Spring'"} {"question": "List the names of counties that do not have any cities.\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM county_public_safety WHERE NOT County_ID IN (SELECT County_ID FROM city)"} {"question": "Find the branch name of the bank that has the most number of customers.\nAdditional table information: table: loan_1", "answer": "SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1"} {"question": "What are the different budget type codes, and how many documents are there for each?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code"} {"question": "How many countries are there in total?\nAdditional table information: table: match_season", "answer": "SELECT COUNT(*) FROM country"} {"question": "What is the sum of total pounds of purchase in year 2018 for all branches in London?\nAdditional table information: table: shop_membership", "answer": "SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018"} {"question": "What are the ids and full names for employees who work in a department that has someone with a first name that contains the letter T?\nAdditional table information: table: hr_1", "answer": "SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')"} {"question": "Display the first name and department name for each employee.\nAdditional table information: table: hr_1", "answer": "SELECT T1.first_name, T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id"} {"question": "Find the names and average salaries of all departments whose average salary is greater than 42000.\nAdditional table information: table: college_2", "answer": "SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000"} {"question": "What is the total number of postseason games that team Boston Red Stockings participated in?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings')"} {"question": "What is the origin and destination for all flights whose price is higher than 300?\nAdditional table information: table: flight_1", "answer": "SELECT origin, destination FROM Flight WHERE price > 300"} {"question": "Return the names and typical buying prices for all products.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_name, typical_buying_price FROM products"} {"question": "How many phones belongs to each accreditation type?\nAdditional table information: table: phone_1", "answer": "SELECT Accreditation_type, COUNT(*) FROM phone GROUP BY Accreditation_type"} {"question": "List the age of all music artists.\nAdditional table information: table: music_4", "answer": "SELECT Age FROM artist"} {"question": "How many games were played in park 'Columbia Park' in 1907?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park'"} {"question": "What is the name of the tallest building?\nAdditional table information: table: protein_institute", "answer": "SELECT name FROM building ORDER BY height_feet DESC LIMIT 1"} {"question": "Tell me the ages of the oldest and youngest students studying major 600.\nAdditional table information: table: voter_2", "answer": "SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600"} {"question": "Find the name and email of the user followed by the least number of people.\nAdditional table information: table: twitter_1", "answer": "SELECT name, email FROM user_profiles ORDER BY followers NULLS FIRST LIMIT 1"} {"question": "Which countries have more than two members?\nAdditional table information: table: decoration_competition", "answer": "SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2"} {"question": "What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?\nAdditional table information: table: mountain_photos", "answer": "SELECT name, height, prominence FROM mountain WHERE range <> 'Aberdare Range'"} {"question": "What is the receipt date of the document with id 3?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT receipt_date FROM Documents WHERE document_id = 3"} {"question": "Report the total number of students for each fourth-grade classroom.\nAdditional table information: table: student_1", "answer": "SELECT classroom, COUNT(*) FROM list WHERE grade = '4' GROUP BY classroom"} {"question": "Give the years and official names of the cities of each competition.\nAdditional table information: table: farm", "answer": "SELECT T2.Year, T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID"} {"question": "Find the distinct first names of the students who have class senator votes.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE"} {"question": "What are the names of the aircraft that the least people are certified to fly?\nAdditional table information: table: flight_1", "answer": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the number of ships?\nAdditional table information: table: ship_mission", "answer": "SELECT COUNT(*) FROM ship"} {"question": "What are the name and typical buying and selling prices of the products that have color described as 'yellow'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.product_name, t1.typical_buying_price, t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = 'yellow'"} {"question": "Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types.\nAdditional table information: table: phone_1", "answer": "SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Full'"} {"question": "Count the number of documents.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Documents"} {"question": "Show names for all employees who have certificate of Boeing 737-800.\nAdditional table information: table: flight_1", "answer": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = 'Boeing 737-800'"} {"question": "Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT AVG(balance) FROM savings)"} {"question": "Show the document name and the document date for all documents on project with details 'Graph Database project'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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'"} {"question": "What are the names of the workshop groups that have bookings with status code 'stop'?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = 'stop'"} {"question": "What are the theme and year for all exhibitions that have a ticket price under 15?\nAdditional table information: table: theme_gallery", "answer": "SELECT theme, YEAR FROM exhibition WHERE ticket_price < 15"} {"question": "find the highest support percentage, lowest consider rate and oppose rate of all candidates.\nAdditional table information: table: candidate_poll", "answer": "SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate"} {"question": "Which course authors teach two or more courses? Give me their addresses and author IDs.\nAdditional table information: table: e_learning", "answer": "SELECT T1.address_line_1, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2"} {"question": "What are the full names of customers with the account name 900?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.customer_first_name, T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = '900'"} {"question": "How many students exist?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM student"} {"question": "Find the name of the club that has the most female students.\nAdditional table information: table: club_1", "answer": "SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = 'F' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "How many trips stated from a station in Mountain View and ended at one in Palo Alto?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(*) FROM station AS T1, trip AS T2, station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = 'Mountain View' AND T3.city = 'Palo Alto'"} {"question": "Which city does staff with first name as Janessa and last name as Sawayn live?\nAdditional table information: table: driving_school", "answer": "SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'"} {"question": "Count the number of different last names actors have.\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(DISTINCT last_name) FROM actor"} {"question": "List the distinct names of the instructors, ordered by name.\nAdditional table information: table: college_2", "answer": "SELECT DISTINCT name FROM instructor ORDER BY name NULLS FIRST"} {"question": "What are the employee ids for employees who make more than the average?\nAdditional table information: table: hr_1", "answer": "SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)"} {"question": "Show the names of companies and of employees.\nAdditional table information: table: company_employee", "answer": "SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID"} {"question": "What are the type and nationality of ships?\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE, Nationality FROM ship"} {"question": "What are the start and end dates for incidents with incident type code 'NOISE'?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = 'NOISE'"} {"question": "Find the names of all artists that have 'a' in their names.\nAdditional table information: table: chinook_1", "answer": "SELECT Name FROM ARTIST WHERE Name LIKE '%a%'"} {"question": "Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE NOT department_id IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200)"} {"question": "Return the name of the artist who has the latest join year.\nAdditional table information: table: theme_gallery", "answer": "SELECT name FROM artist ORDER BY year_join DESC LIMIT 1"} {"question": "What are the names of the artists who released a song that has the word love in its title, and where are the artists from?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE '%love%'"} {"question": "For each user, find their name and the number of reviews written by them.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.name, COUNT(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id"} {"question": "What are the state and country of all the cities that have post codes starting with 4.\\\nAdditional table information: table: customers_and_addresses", "answer": "SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE '4%'"} {"question": "Show the ids of the investors who have at least two transactions.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2"} {"question": "List the hosts of performances in ascending order of attendance.\nAdditional table information: table: performance_attendance", "answer": "SELECT HOST FROM performance ORDER BY Attendance ASC NULLS FIRST"} {"question": "Which committees have delegates from the Democratic party?\nAdditional table information: table: election", "answer": "SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = 'Democratic'"} {"question": "Return the average, minimum, maximum, and total transaction amounts.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT AVG(transaction_amount), MIN(transaction_amount), MAX(transaction_amount), SUM(transaction_amount) FROM Financial_transactions"} {"question": "How many entrepreneurs are there?\nAdditional table information: table: entrepreneur", "answer": "SELECT COUNT(*) FROM entrepreneur"} {"question": "For each year, return the year and the number of times the team Boston Red Stockings won in the postseasons.\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*), T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year"} {"question": "How many accounts does the customer with first name Art and last name Turcotte have?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Art' AND T2.customer_last_name = 'Turcotte'"} {"question": "Show the name, role code, and date of birth for the employee with name 'Armani'.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'"} {"question": "What are the names of students who have taken Statistics courses?\nAdditional table information: table: college_2", "answer": "SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'"} {"question": "How many students received a yes from tryouts?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM tryout WHERE decision = 'yes'"} {"question": "list the card number of all members whose hometown address includes word 'Kentucky'.\nAdditional table information: table: shop_membership", "answer": "SELECT card_number FROM member WHERE Hometown LIKE '%Kentucky%'"} {"question": "What are the first and last names of people who payed more than the rooms' base prices?\nAdditional table information: table: inn_1", "answer": "SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0"} {"question": "List the status shared by more than two roller coaster.\nAdditional table information: table: roller_coaster", "answer": "SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2"} {"question": "What is the id of the bike that traveled the most in 94002?\nAdditional table information: table: bike_1", "answer": "SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the name of the players who received a card in descending order of the hours of training?\nAdditional table information: table: soccer_2", "answer": "SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC"} {"question": "How many customers did not have any event?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_events)"} {"question": "Show different publishers together with the number of publications they have.\nAdditional table information: table: book_2", "answer": "SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher"} {"question": "What is department name and office for the professor whose last name is Heffington?\nAdditional table information: table: college_1", "answer": "SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'"} {"question": "What is the maximum number that a certain service is provided? List the service id, details and number.\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT T1.service_id, T1.service_details, COUNT(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "When was the order placed whose shipment tracking number is 3452? Give me the date.\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452"} {"question": "Please give me a list of cities whose regional population is over 10000000.\nAdditional table information: table: city_record", "answer": "SELECT city FROM city WHERE regional_population > 10000000"} {"question": "Which catalog contents have length below 3 or above 5? Find the catalog entry names.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5"} {"question": "List the names and buildings of all departments sorted by the budget from large to small.\nAdditional table information: table: college_2", "answer": "SELECT dept_name, building FROM department ORDER BY budget DESC"} {"question": "Find the building that has the largest number of faculty members.\nAdditional table information: table: activity_1", "answer": "SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of all airports in Cuba or Argentina?\nAdditional table information: table: flight_4", "answer": "SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'"} {"question": "What are the first names and ids for customers who have two or more accounts?\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2"} {"question": "What are the names of students and their respective departments, ordered by number of credits from least to greatest?\nAdditional table information: table: college_2", "answer": "SELECT name, dept_name FROM student ORDER BY tot_cred NULLS FIRST"} {"question": "what is the full name and id of the college with the largest number of baseball players?\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the rank, first name, and last name for all the faculty.\nAdditional table information: table: activity_1", "answer": "SELECT rank, Fname, Lname FROM Faculty"} {"question": "What are the numbers of wines for different grapes?\nAdditional table information: table: wine_1", "answer": "SELECT COUNT(*), Grape FROM WINE GROUP BY Grape"} {"question": "What are the names and players of all the clubs?\nAdditional table information: table: sports_competition", "answer": "SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID"} {"question": "How many professors who has a either Ph.D. or MA degree?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'"} {"question": "What is the name of the project with the most hours?\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM projects ORDER BY hours DESC LIMIT 1"} {"question": "Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders.\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name, COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10"} {"question": "For each grade 0 classroom, report the total number of students.\nAdditional table information: table: student_1", "answer": "SELECT classroom, COUNT(*) FROM list WHERE grade = '0' GROUP BY classroom"} {"question": "What are the names of all the songs whose album is under the label of 'Universal Music Group'?\nAdditional table information: table: music_2", "answer": "SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = 'Universal Music Group'"} {"question": "Which authors have written a paper with title containing the word 'Monadic'? Return their last names.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE '%Monadic%'"} {"question": "Find the captain rank that has some captains in both Cutter and Armed schooner classes.\nAdditional table information: table: ship_1", "answer": "SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'"} {"question": "What are the denominations used by both schools founded before 1890 and schools founded after 1900?\nAdditional table information: table: school_player", "answer": "SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900"} {"question": "Show the name and country for all people whose age is smaller than the average.\nAdditional table information: table: wedding", "answer": "SELECT name, country FROM people WHERE age < (SELECT AVG(age) FROM people)"} {"question": "Show the product type and name for the products with price higher than 1000 or lower than 500.\nAdditional table information: table: customers_and_products_contacts", "answer": "SELECT product_type_code, product_name FROM products WHERE product_price > 1000 OR product_price < 500"} {"question": "What is the first name and last name employee helps the customer with first name Leonie?\nAdditional table information: table: chinook_1", "answer": "SELECT T2.FirstName, T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = 'Leonie'"} {"question": "Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'.\nAdditional table information: table: medicine_enzyme_interaction", "answer": "SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'"} {"question": "How many degrees were conferred at San Jose State University in 2000?\nAdditional table information: table: csu_1", "answer": "SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND t2.year = 2000"} {"question": "What are all the calendar dates and day Numbers?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT calendar_date, day_Number FROM Ref_calendar"} {"question": "Give the name of the wine with the highest score.\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE ORDER BY Score NULLS FIRST LIMIT 1"} {"question": "Find the names of the buildings in 'on-hold' status, and sort them in ascending order of building stories.\nAdditional table information: table: company_office", "answer": "SELECT name FROM buildings WHERE Status = 'on-hold' ORDER BY Stories ASC NULLS FIRST"} {"question": "What is the maximum total amount paid by a customer? List the customer id and amount.\nAdditional table information: table: products_for_hire", "answer": "SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1"} {"question": "Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.\nAdditional table information: table: shop_membership", "answer": "SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram , Georgia'"} {"question": "How many different positions of players are there?\nAdditional table information: table: school_player", "answer": "SELECT COUNT(DISTINCT POSITION) FROM player"} {"question": "What are the first names of all the students?\nAdditional table information: table: club_1", "answer": "SELECT DISTINCT fname FROM student"} {"question": "Find the description and credit for the course QM-261?\nAdditional table information: table: college_1", "answer": "SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261'"} {"question": "Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> 'COVIN' AND T2.lastname <> 'JEROME'"} {"question": "What is the id and salary of the employee named Mark Young?\nAdditional table information: table: flight_1", "answer": "SELECT eid, salary FROM Employee WHERE name = 'Mark Young'"} {"question": "What is the joined year of the pilot of the highest rank?\nAdditional table information: table: pilot_record", "answer": "SELECT Join_Year FROM pilot ORDER BY Rank ASC NULLS FIRST LIMIT 1"} {"question": "What is the id of the most recent order?\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1"} {"question": "List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name NULLS FIRST"} {"question": "What is the name of the customer who has the largest number of orders?\nAdditional table information: table: tracking_orders", "answer": "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "display the department id and the total salary for those departments which contains at least two employees.\nAdditional table information: table: hr_1", "answer": "SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2"} {"question": "What document type codes do we have?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT document_type_code FROM Ref_Document_Types"} {"question": "How many team franchises are active, with active value 'Y'?\nAdditional table information: table: baseball_1", "answer": "SELECT COUNT(*) FROM team_franchise WHERE active = 'Y'"} {"question": "Which programs are never broadcasted in the morning? Give me the names of the programs.\nAdditional table information: table: program_share", "answer": "SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = 'Morning'"} {"question": "How many drivers are there?\nAdditional table information: table: school_bus", "answer": "SELECT COUNT(*) FROM driver"} {"question": "What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?\nAdditional table information: table: formula_1", "answer": "SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'"} {"question": "What are the name, role code, and date of birth of the employee named 'Armani'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'"} {"question": "List the names of all distinct wines that have scores higher than 90.\nAdditional table information: table: wine_1", "answer": "SELECT Name FROM WINE WHERE score > 90"} {"question": "What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time?\nAdditional table information: table: network_2", "answer": "SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice')"} {"question": "Give me a list of all the last names of authors sorted in alphabetical order\nAdditional table information: table: icfp_1", "answer": "SELECT lname FROM authors ORDER BY lname NULLS FIRST"} {"question": "Find the name and id of the good with the highest average rank.\nAdditional table information: table: epinions_1", "answer": "SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rank) DESC LIMIT 1"} {"question": "Find the name of the department that offers the largest number of credits of all classes.\nAdditional table information: table: college_1", "answer": "SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY SUM(T1.crs_credit) DESC LIMIT 1"} {"question": "Which grade is studying in room 105?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT grade FROM list WHERE classroom = 105"} {"question": "What are the ids of the movies that are not reviewed by Brittany Harris.\nAdditional table information: table: movie_1", "answer": "SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = 'Brittany Harris'"} {"question": "What is the id of the trip that started from the station with the highest dock count?\nAdditional table information: table: bike_1", "answer": "SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1"} {"question": "Return the name of each physician and the number of patients he or she treats.\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name, COUNT(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid"} {"question": "For each bed type, find the average room price.\nAdditional table information: table: inn_1", "answer": "SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType"} {"question": "show the titles, and authors or editors for all books made after the year 1989.\nAdditional table information: table: culture_company", "answer": "SELECT book_title, author_or_editor FROM book_club WHERE YEAR > 1989"} {"question": "How many unique classes are offered?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT class_code) FROM CLASS"} {"question": "What is the total number of purchases for members with level 6?\nAdditional table information: table: shop_membership", "answer": "SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6"} {"question": "What are the three countries that the least players are from?\nAdditional table information: table: baseball_1", "answer": "SELECT birth_country FROM player GROUP BY birth_country ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 3"} {"question": "Show the average amount of transactions for different investors.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT investor_id, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id"} {"question": "What is the highest, lowest, and average student GPA for every department?\nAdditional table information: table: college_1", "answer": "SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code"} {"question": "Find the name of customers who do not have an saving account.\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'"} {"question": "Report all majors that have less than 3 students.\nAdditional table information: table: voter_2", "answer": "SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3"} {"question": "Show the nominees that have nominated musicals for both 'Tony Award' and 'Drama Desk Award'.\nAdditional table information: table: musical", "answer": "SELECT Nominee FROM musical WHERE Award = 'Tony Award' INTERSECT SELECT Nominee FROM musical WHERE Award = 'Drama Desk Award'"} {"question": "How many distinct locations have the things with service detail 'Unsatisfied' been located in?\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT COUNT(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied'"} {"question": "Which cities have regional population above 10000000?\nAdditional table information: table: city_record", "answer": "SELECT city FROM city WHERE regional_population > 10000000"} {"question": "What are the titles of all movies that were not reviewed by Chris Jackson?\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson'"} {"question": "Which vocal type has the band mate with first name 'Marianne' played the most?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = 'Marianne' GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the complete description of the job of a researcher?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'"} {"question": "Show other account details for account with name 338.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT other_account_details FROM Accounts WHERE account_name = '338'"} {"question": "Which papers have 'Stephanie Weirich' as an author?\nAdditional table information: table: icfp_1", "answer": "SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = 'Stephanie' AND t1.lname = 'Weirich'"} {"question": "Show the most common builder of railways.\nAdditional table information: table: railway", "answer": "SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the ids for all the faculty members who have at least 2 students.\nAdditional table information: table: activity_1", "answer": "SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2"} {"question": "Please show the most common status of roller coasters.\nAdditional table information: table: roller_coaster", "answer": "SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.\nAdditional table information: table: decoration_competition", "answer": "SELECT T2.Name, T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name ASC NULLS FIRST"} {"question": "What are the themes of competitions that have corresponding host cities with more than 1000 residents?\nAdditional table information: table: farm", "answer": "SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000"} {"question": "What are the names of the all-female dorms?\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm WHERE gender = 'F'"} {"question": "Find the full name and id of the college that has the most baseball players.\nAdditional table information: table: baseball_1", "answer": "SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the average and minimum price (in Euro) of all products?\nAdditional table information: table: product_catalog", "answer": "SELECT AVG(price_in_euros), MIN(price_in_euros) FROM catalog_contents"} {"question": "What are the names and hours spent practicing of every student who received a yes at tryouts?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.pName, T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'"} {"question": "What are the first and last name of all biology professors?\nAdditional table information: table: college_1", "answer": "SELECT T3.EMP_FNAME, T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = 'Biology'"} {"question": "What are the names and locations of all tracks?\nAdditional table information: table: race_track", "answer": "SELECT name, LOCATION FROM track"} {"question": "find the event names that have more than 2 records.\nAdditional table information: table: party_people", "answer": "SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2"} {"question": "Show the names of roller coasters and names of country they are in.\nAdditional table information: table: roller_coaster", "answer": "SELECT T2.Name, T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID"} {"question": "Show all document type codes, document type names, document type descriptions.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types"} {"question": "What is the id and last name of the driver who participated in the most races after 2010?\nAdditional table information: table: formula_1", "answer": "SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the crime rates of counties sorted by number of offices ascending?\nAdditional table information: table: county_public_safety", "answer": "SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers ASC NULLS FIRST"} {"question": "Show all student IDs who have at least two allergies.\nAdditional table information: table: allergy_1", "answer": "SELECT StuID FROM Has_allergy GROUP BY StuID HAVING COUNT(*) >= 2"} {"question": "What is the country that has the most perpetrators?\nAdditional table information: table: perpetrator", "answer": "SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the details of all the markets that are accessible by walk or bus.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk' OR T2.How_to_Get_There = 'bus'"} {"question": "What are the vocal types used in song 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'"} {"question": "Find the name and salary of instructors who are advisors of the students from the Math department.\nAdditional table information: table: college_2", "answer": "SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'"} {"question": "What is the document type description for document type named Film?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_type_description FROM Ref_document_types WHERE document_type_name = 'Film'"} {"question": "What is the genre name of the film HUNGER ROOF?\nAdditional table information: table: sakila_1", "answer": "SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'"} {"question": "Find the names of the users whose number of followers is greater than that of the user named 'Tyler Swift'.\nAdditional table information: table: twitter_1", "answer": "SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING COUNT(*) > (SELECT COUNT(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 WHERE T1.name = 'Tyler Swift')"} {"question": "What are the birth places that are shared by at least two people?\nAdditional table information: table: body_builder", "answer": "SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2"} {"question": "Give me the the first and last name of the faculty who advises the most students.\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the first name and GPA of every student that has a GPA lower than average?\nAdditional table information: table: college_1", "answer": "SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT AVG(stu_gpa) FROM student)"} {"question": "What are the average access counts of documents that have the functional area description 'Acknowledgement'?\nAdditional table information: table: document_management", "answer": "SELECT AVG(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = 'Acknowledgement'"} {"question": "How many employees have salary between 100000 and 200000?\nAdditional table information: table: flight_1", "answer": "SELECT COUNT(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000"} {"question": "What is the first and last name of all students who are younger than average?\nAdditional table information: table: dorm_1", "answer": "SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student)"} {"question": "How many students does KAWA GORDON teaches?\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'KAWA' AND T2.lastname = 'GORDON'"} {"question": "Return the color code and description for the product with the name 'chervil'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t1.color_code, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = 'chervil'"} {"question": "What is the average cost of procedures that physician John Wen was trained in?\nAdditional table information: table: hospital_1", "answer": "SELECT AVG(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen'"} {"question": "Show the names of climbers and the heights of mountains they climb.\nAdditional table information: table: climbing", "answer": "SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID"} {"question": "What are all the location codes and location names?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code, location_name FROM Ref_locations"} {"question": "Find the maximum age of all the students.\nAdditional table information: table: voter_2", "answer": "SELECT MAX(Age) FROM STUDENT"} {"question": "Return all the information for all employees without any department number.\nAdditional table information: table: hr_1", "answer": "SELECT * FROM employees WHERE department_id = 'null'"} {"question": "Find the enrollment date for all the tests that have 'Pass' result.\nAdditional table information: table: e_learning", "answer": "SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = 'Pass'"} {"question": "What is the last name of the staff who has handled the first ever complaint?\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised NULLS FIRST LIMIT 1"} {"question": "What are the id of each employee and the number of document destroyed by that employee?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID"} {"question": "What are the first names, office locations of all lecturers who have taught some course?\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num"} {"question": "Find the total and average amount paid in claim headers.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT SUM(amount_piad), AVG(amount_piad) FROM claim_headers"} {"question": "How many submissions are there?\nAdditional table information: table: workshop_paper", "answer": "SELECT COUNT(*) FROM submission"} {"question": "What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?\nAdditional table information: table: browser_web", "answer": "SELECT name, operating_system FROM web_client_accelerator WHERE CONNECTION <> 'Broadband'"} {"question": "Find the name and hours of the students whose tryout decision is yes.\nAdditional table information: table: soccer_2", "answer": "SELECT T1.pName, T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'"} {"question": "find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.\nAdditional table information: table: aircraft", "answer": "SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the number of different ranks of captain.\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(DISTINCT rank) FROM captain"} {"question": "Find the titles of the papers that contain the word 'ML'.\nAdditional table information: table: icfp_1", "answer": "SELECT title FROM papers WHERE title LIKE '%ML%'"} {"question": "Count the number of customers who have an account.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT COUNT(DISTINCT customer_id) FROM Accounts"} {"question": "Select the name of each manufacturer along with the name and price of its most expensive product.\nAdditional table information: table: manufactory_1", "answer": "SELECT T1.Name, MAX(T1.Price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name"} {"question": "List all information about courses sorted by credits in the ascending order.\nAdditional table information: table: college_3", "answer": "SELECT * FROM COURSE ORDER BY Credits NULLS FIRST"} {"question": "Which apartments have type code 'Flat'? Give me their apartment numbers.\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_number FROM Apartments WHERE apt_type_code = 'Flat'"} {"question": "Give the dates of creation for documents that have both budget type codes 'GV' and 'SF'.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'"} {"question": "Find the organisation type description of the organisation detailed as 'quo'.\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'"} {"question": "Find the name of airline which runs the most number of routes.\nAdditional table information: table: flight_4", "answer": "SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which apartment type code is the most common among apartments with more than one bathroom?\nAdditional table information: table: apartment_rentals", "answer": "SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show all different home cities.\nAdditional table information: table: school_bus", "answer": "SELECT DISTINCT home_city FROM driver"} {"question": "What is the nickname of staff with first name as Janessa and last name as Sawayn?\nAdditional table information: table: driving_school", "answer": "SELECT nickname FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'"} {"question": "What are all the distinct premise types?\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT DISTINCT premises_type FROM premises"} {"question": "What are the names of musicals with nominee 'Bob Fosse'?\nAdditional table information: table: musical", "answer": "SELECT Name FROM musical WHERE Nominee = 'Bob Fosse'"} {"question": "Find the order id and customer id associated with the oldest order.\nAdditional table information: table: tracking_orders", "answer": "SELECT order_id, customer_id FROM orders ORDER BY date_order_placed NULLS FIRST LIMIT 1"} {"question": "List the description, code and the number of services for each service type.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Service_Type_Description, T2.Service_Type_Code, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code"} {"question": "Find the name and active date of the customer that use email as the contact channel.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'"} {"question": "How many drivers were in the Australian Grand Prix held in 2009?\nAdditional table information: table: formula_1", "answer": "SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = 'Australian Grand Prix' AND YEAR = 2009"} {"question": "Show all product colors.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT DISTINCT product_color FROM Products"} {"question": "Show all locations which don't have a train station with at least 15 platforms.\nAdditional table information: table: train_station", "answer": "SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15"} {"question": "What are the appelations for wines produced after 2008 but not in the Central Coast area?\nAdditional table information: table: wine_1", "answer": "SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = 'Central Coast'"} {"question": "What are the names of all the documents, as well as the access counts of each, ordered alphabetically?\nAdditional table information: table: document_management", "answer": "SELECT document_name, access_count FROM documents ORDER BY document_name NULLS FIRST"} {"question": "How many climbers are from each country?\nAdditional table information: table: climbing", "answer": "SELECT Country, COUNT(*) FROM climber GROUP BY Country"} {"question": "What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type?\nAdditional table information: table: department_store", "answer": "SELECT MAX(product_price), MIN(product_price), product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code NULLS FIRST"} {"question": "How many body builders are there?\nAdditional table information: table: body_builder", "answer": "SELECT COUNT(*) FROM body_builder"} {"question": "List the names of perpetrators in descending order of the year.\nAdditional table information: table: perpetrator", "answer": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC"} {"question": "What are the names and descriptions of aircrafts associated with an airport that has more total passengers than 10000000?\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft, T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000"} {"question": "List the industry shared by the most companies.\nAdditional table information: table: company_office", "answer": "SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of students who have the word 'son' in their personal names.\nAdditional table information: table: e_learning", "answer": "SELECT COUNT(*) FROM Students WHERE personal_name LIKE '%son%'"} {"question": "For each nomination, show the name of the artwork and name of the festival where it is nominated.\nAdditional table information: table: entertainment_awards", "answer": "SELECT T2.Name, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID"} {"question": "Show cinema name, film title, date, and price for each record in schedule.\nAdditional table information: table: cinema", "answer": "SELECT T3.name, T2.title, T1.date, T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id"} {"question": "Which college has any student who is a goalie and succeeded in the tryout.\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'"} {"question": "What is the average unit price of rock tracks?\nAdditional table information: table: chinook_1", "answer": "SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Rock'"} {"question": "Find the titles of albums that contain tracks of both the Reggae and Rock genres.\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Reggae' INTERSECT SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId JOIN Genre AS T3 ON T2.GenreID = T3.GenreID WHERE T3.Name = 'Rock'"} {"question": "What are the names of the stations that are located in Palo Alto but have never been the ending point of the trips\nAdditional table information: table: bike_1", "answer": "SELECT name FROM station WHERE city = 'Palo Alto' EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING COUNT(*) > 100"} {"question": "What are all the policy types of the customer named 'Dayana Robel'?\nAdditional table information: table: insurance_fnol", "answer": "SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = 'Dayana Robel'"} {"question": "What are the customer name and date of the orders whose status is 'Delivered'.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = 'Delivered'"} {"question": "Show all member names and registered branch names sorted by register year.\nAdditional table information: table: shop_membership", "answer": "SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year NULLS FIRST"} {"question": "What is the average base price of rooms, for each bed type?\nAdditional table information: table: inn_1", "answer": "SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType"} {"question": "List title of albums have the number of tracks greater than 10.\nAdditional table information: table: store_1", "answer": "SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING COUNT(T1.id) > 10"} {"question": "How many assets can each parts be used in? List the part name and the number.\nAdditional table information: table: assets_maintenance", "answer": "SELECT T1.part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name"} {"question": "Find the name of all the cities and states.\nAdditional table information: table: e_government", "answer": "SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses"} {"question": "Find products with max page size as 'A4' or pages per minute color smaller than 5.\nAdditional table information: table: store_product", "answer": "SELECT product FROM product WHERE max_page_size = 'A4' OR pages_per_minute_color < 5"} {"question": "How many professors attained either Ph.D. or Masters degrees?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'"} {"question": "Show company name and main industry without a gas station.\nAdditional table information: table: gas_company", "answer": "SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company)"} {"question": "List the cities which have more than one airport and number of airports.\nAdditional table information: table: flight_4", "answer": "SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1"} {"question": "List all countries of markets in ascending alphabetical order.\nAdditional table information: table: film_rank", "answer": "SELECT Country FROM market ORDER BY Country ASC NULLS FIRST"} {"question": "Return the names of the gymnasts.\nAdditional table information: table: gymnast", "answer": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID"} {"question": "Find the name and revenue of the company that earns the highest revenue in each city.\nAdditional table information: table: manufactory_1", "answer": "SELECT name, MAX(revenue), Headquarter FROM manufacturers GROUP BY Headquarter"} {"question": "Show the names and ids of tourist attractions that are visited at least two times.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING COUNT(*) >= 2"} {"question": "Show all game ids and the number of hours played.\nAdditional table information: table: game_1", "answer": "SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid"} {"question": "What are the different stage positions for all musicians whose first name is 'Solveig'?\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = 'Solveig'"} {"question": "What is the id and name of the department store that has both marketing and managing department?\nAdditional table information: table: department_store", "answer": "SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = 'marketing' INTERSECT SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = 'managing'"} {"question": "Show all the locations where no cinema has capacity over 800.\nAdditional table information: table: cinema", "answer": "SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800"} {"question": "List the customers first and last name of 10 least expensive invoices.\nAdditional table information: table: store_1", "answer": "SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total NULLS FIRST LIMIT 10"} {"question": "How many budget record has a budget amount smaller than the invested amount?\nAdditional table information: table: school_finance", "answer": "SELECT COUNT(*) FROM budget WHERE budgeted < invested"} {"question": "How many activities does Mark Giuliano participate in?\nAdditional table information: table: activity_1", "answer": "SELECT COUNT(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = 'Mark' AND T1.lname = 'Giuliano'"} {"question": "Count the number of different official languages corresponding to countries that players who play Defender are from.\nAdditional table information: table: match_season", "answer": "SELECT COUNT(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Defender'"} {"question": "Count the number of captains younger than 50 of each rank.\nAdditional table information: table: ship_1", "answer": "SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank"} {"question": "Who is the advisor of student with ID 1004?\nAdditional table information: table: allergy_1", "answer": "SELECT Advisor FROM Student WHERE StuID = 1004"} {"question": "How many teachers does the student named CHRISSY NABOZNY have?\nAdditional table information: table: student_1", "answer": "SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'CHRISSY' AND T1.lastname = 'NABOZNY'"} {"question": "What is the name of the claim processing stage that most of the claims are on?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which people severed as governor most frequently?\nAdditional table information: table: election", "answer": "SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the most popular payment method?\nAdditional table information: table: insurance_policies", "answer": "SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the amenities in the dorm that a student who has the last name of Smith lives in?\nAdditional table information: table: dorm_1", "answer": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith'"} {"question": "List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.\nAdditional table information: table: game_injury", "answer": "SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Thiago Motta'"} {"question": "List players' first name and last name who have weight greater than 220 or height shorter than 75.\nAdditional table information: table: baseball_1", "answer": "SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75"} {"question": "What are the names of climbers and the corresponding heights of the mountains that they climb?\nAdditional table information: table: climbing", "answer": "SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID"} {"question": "show the train name and station name for each train.\nAdditional table information: table: train_station", "answer": "SELECT T2.name, T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id"} {"question": "What are the names of people in ascending order of height?\nAdditional table information: table: perpetrator", "answer": "SELECT Name FROM People ORDER BY Height ASC NULLS FIRST"} {"question": "How many companies operates airlines in each airport?\nAdditional table information: table: flight_company", "answer": "SELECT T3.id, COUNT(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id"} {"question": "Give me all the phone numbers and email addresses of the workshop groups where services are performed.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID"} {"question": "What is the name of the department with the fewest members?\nAdditional table information: table: college_3", "answer": "SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "How many appelations are in Napa Country?\nAdditional table information: table: wine_1", "answer": "SELECT COUNT(*) FROM APPELLATIONS WHERE County = 'Napa'"} {"question": "Show all the information about election.\nAdditional table information: table: election", "answer": "SELECT * FROM election"} {"question": "What is the document type name for the document with name 'How to read a book'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = 'How to read a book'"} {"question": "What are the details for statements with the details 'Private Project', and what are the names of the corresponding documents?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "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'"} {"question": "What are the customer id and name corresponding to accounts with a checking balance less than the largest checking balance?\nAdditional table information: table: small_bank_1", "answer": "SELECT T1.custid, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT MAX(balance) FROM checking)"} {"question": "What is the mean longitude for all stations that have never had more than 10 bikes available?\nAdditional table information: table: bike_1", "answer": "SELECT AVG(long) FROM station WHERE NOT id IN (SELECT station_id FROM status GROUP BY station_id HAVING MAX(bikes_available) > 10)"} {"question": "Return reviewer name, movie title, stars, and ratingDate. And sort the data first by reviewer name, then by movie title, and lastly by number of stars.\nAdditional table information: table: movie_1", "answer": "SELECT T3.name, T2.title, T1.stars, T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name NULLS FIRST, T2.title NULLS FIRST, T1.stars NULLS FIRST"} {"question": "What are the names of all the aircrafts associated with London Gatwick airport?\nAdditional table information: table: aircraft", "answer": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick'"} {"question": "How many different genders are there in the dorms?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(DISTINCT gender) FROM dorm"} {"question": "Who are the players from Indonesia?\nAdditional table information: table: match_season", "answer": "SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = 'Indonesia'"} {"question": "How many games are free of injury accidents?\nAdditional table information: table: game_injury", "answer": "SELECT COUNT(*) FROM game WHERE NOT id IN (SELECT game_id FROM injury_accident)"} {"question": "Show the id and name of the aircraft with the maximum distance.\nAdditional table information: table: flight_1", "answer": "SELECT aid, name FROM Aircraft ORDER BY distance DESC LIMIT 1"} {"question": "Show all customer ids and the number of accounts for each customer.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id"} {"question": "Return the first names and last names of employees who earn more than 30000 in salary.\nAdditional table information: table: company_1", "answer": "SELECT fname, lname FROM employee WHERE salary > 30000"} {"question": "What is the 3 most common cloud cover rates in the region of zip code 94107?\nAdditional table information: table: bike_1", "answer": "SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "How many products are there?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(*) FROM products"} {"question": "What are the first and last names of the employee with the earliest date of birth?\nAdditional table information: table: college_1", "answer": "SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob NULLS FIRST LIMIT 1"} {"question": "What is the name, type, and flag of the ship that was built in the most recent year?\nAdditional table information: table: ship_1", "answer": "SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1"} {"question": "How many students have had at least one 'B' grade?\nAdditional table information: table: college_3", "answer": "SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = 'B'"} {"question": "Give the hometowns from which two or more gymnasts are from.\nAdditional table information: table: gymnast", "answer": "SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2"} {"question": "List all of the player ids with a height of at least 180cm and an overall rating higher than 85.\nAdditional table information: table: soccer_1", "answer": "SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85"} {"question": "Which locations contains both shops that opened after the year 2012 and shops that opened before 2008?\nAdditional table information: table: device", "answer": "SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008"} {"question": "How many type of jobs do they have?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(DISTINCT job) FROM Person"} {"question": "What is the role of the employee named Koby?\nAdditional table information: table: cre_Doc_Control_Systems", "answer": "SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = 'Koby'"} {"question": "Advisor 1121 has how many students?\nAdditional table information: table: restaurant_1", "answer": "SELECT COUNT(*) FROM Student WHERE Advisor = 1121"} {"question": "find the name of all departments that do actually have one or more employees assigned to them.\nAdditional table information: table: hr_1", "answer": "SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id"} {"question": "How many followers does each user have?\nAdditional table information: table: twitter_1", "answer": "SELECT COUNT(*) FROM follows"} {"question": "Show the ids of all the faculty members who participate in an activity and advise a student.\nAdditional table information: table: activity_1", "answer": "SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student"} {"question": "What is the velocity of the pilot named 'Thompson'?\nAdditional table information: table: flight_company", "answer": "SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson'"} {"question": "What are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director?\nAdditional table information: table: movie_1", "answer": "SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name"} {"question": "At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total.\nAdditional table information: table: restaurant_1", "answer": "SELECT Restaurant.ResName, SUM(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY SUM(Visits_Restaurant.Spent) ASC NULLS FIRST LIMIT 1"} {"question": "Find the names of the trains that do not pass any station located in London.\nAdditional table information: table: train_station", "answer": "SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE NOT T1.station_id IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = 'London')"} {"question": "What is the name of the youngest captain?\nAdditional table information: table: ship_1", "answer": "SELECT name FROM captain ORDER BY age NULLS FIRST LIMIT 1"} {"question": "Show the names of all the activities Mark Giuliano participates in.\nAdditional table information: table: activity_1", "answer": "SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = 'Mark' AND T1.lname = 'Giuliano'"} {"question": "Find the first name and office of the professor who is in the history department and has a Ph.D. degree.\nAdditional table information: table: college_1", "answer": "SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'"} {"question": "What are the names of the airports in the city of Goroka?\nAdditional table information: table: flight_4", "answer": "SELECT name FROM airports WHERE city = 'Goroka'"} {"question": "Find the name, address, number of students in the departments that have the top 3 highest number of students.\nAdditional table information: table: college_1", "answer": "SELECT T2.dept_name, T2.dept_address, COUNT(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "What is the id of the appointment that started most recently?\nAdditional table information: table: hospital_1", "answer": "SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1"} {"question": "List the first names of all the students in room 107.\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT firstname FROM list WHERE classroom = 107"} {"question": "Show all the distinct president votes made on 08/30/2015.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = '08/30/2015'"} {"question": "Find the name of the product that has the smallest capacity.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC NULLS FIRST LIMIT 1"} {"question": "What are the descriptions and names of the courses that have student enrollment bigger than 2?\nAdditional table information: table: e_learning", "answer": "SELECT T1.course_description, T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2"} {"question": "List the authors who do not have submission to any workshop.\nAdditional table information: table: workshop_paper", "answer": "SELECT Author FROM submission WHERE NOT Submission_ID IN (SELECT Submission_ID FROM acceptance)"} {"question": "Find the total population of the districts where the area is bigger than the average city area.\nAdditional table information: table: store_product", "answer": "SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district)"} {"question": "What is the average age for each city and what are those cities?\nAdditional table information: table: dorm_1", "answer": "SELECT AVG(age), city_code FROM student GROUP BY city_code"} {"question": "What is the total and maximum duration for all trips with the bike id 636?\nAdditional table information: table: bike_1", "answer": "SELECT SUM(duration), MAX(duration) FROM trip WHERE bike_id = 636"} {"question": "What is the name and description for document type code RV?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = 'RV'"} {"question": "What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009?\nAdditional table information: table: hr_1", "answer": "SELECT job_id, hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'"} {"question": "Find the number of rooms with a king bed.\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(*) FROM Rooms WHERE bedType = 'King'"} {"question": "List every album ordered by album title in ascending order.\nAdditional table information: table: store_1", "answer": "SELECT title FROM albums ORDER BY title NULLS FIRST"} {"question": "For each distinct test result, find the number of students who got the result.\nAdditional table information: table: e_learning", "answer": "SELECT test_result, COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC"} {"question": "What are the names of the physician who prescribed the highest dose?\nAdditional table information: table: hospital_1", "answer": "SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1"} {"question": "What is the number of faculty at Long Beach State University in 2002?\nAdditional table information: table: csu_1", "answer": "SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = 'Long Beach State University'"} {"question": "For each phone, show its names and total number of stocks.\nAdditional table information: table: phone_market", "answer": "SELECT T2.Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name"} {"question": "What is the first name and the last name of the customer who made the earliest rental?\nAdditional table information: table: sakila_1", "answer": "SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date ASC NULLS FIRST LIMIT 1"} {"question": "How many drama workshop groups are there in each city? Return both the city and the count.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town"} {"question": "Find the names of stadiums which have never had any event.\nAdditional table information: table: swimming", "answer": "SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event)"} {"question": "What are the names of the scientists, and how many projects are each of them working on?\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name"} {"question": "Sort all the industries in descending order of the count of companies in each industry\nAdditional table information: table: company_office", "answer": "SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC"} {"question": "How many customer cards are there?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers_cards"} {"question": "Find the number of students who is older than 20 in each dorm.\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name"} {"question": "How many allergies have type animal?\nAdditional table information: table: allergy_1", "answer": "SELECT COUNT(*) FROM Allergy_type WHERE allergytype = 'animal'"} {"question": "What campuses opened between 1935 and 1939?\nAdditional table information: table: csu_1", "answer": "SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939"} {"question": "What is the location shared by most counties?\nAdditional table information: table: county_public_safety", "answer": "SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "For each city, list their names in decreasing order by their highest station latitude.\nAdditional table information: table: bike_1", "answer": "SELECT city FROM station GROUP BY city ORDER BY MAX(lat) DESC"} {"question": "Show the name, home city, and age for all drivers.\nAdditional table information: table: school_bus", "answer": "SELECT name, home_city, age FROM driver"} {"question": "What is the total enrollment number of all colleges?\nAdditional table information: table: soccer_2", "answer": "SELECT SUM(enr) FROM College"} {"question": "Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.\nAdditional table information: table: manufactory_1", "answer": "SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC"} {"question": "What are the ids and first names of customers who do not hold a credit card?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT customer_id, customer_first_name FROM Customers EXCEPT SELECT T1.customer_id, T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE card_type_code = 'Credit'"} {"question": "What is the title and credits of the course that is taught in the largest classroom (with the highest capacity)?\nAdditional table information: table: college_2", "answer": "SELECT T3.title, T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT MAX(capacity) FROM classroom)"} {"question": "How many different payment methods are there?\nAdditional table information: table: customer_deliveries", "answer": "SELECT COUNT(DISTINCT payment_method) FROM customers"} {"question": "Show the id, the date of account opened, the account name, and other account detail for all accounts.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT account_id, date_account_opened, account_name, other_account_details FROM Accounts"} {"question": "Show the name of colleges that have at least two players.\nAdditional table information: table: match_season", "answer": "SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2"} {"question": "Which city does the student whose last name is 'Kim' live in?\nAdditional table information: table: allergy_1", "answer": "SELECT city_code FROM Student WHERE LName = 'Kim'"} {"question": "Find the name and partition id for users who tweeted less than twice.\nAdditional table information: table: twitter_1", "answer": "SELECT T1.name, T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING COUNT(*) < 2"} {"question": "What are the teams of the players, sorted in ascending alphabetical order?\nAdditional table information: table: school_player", "answer": "SELECT Team FROM player ORDER BY Team ASC NULLS FIRST"} {"question": "List the race class with at least two races.\nAdditional table information: table: race_track", "answer": "SELECT CLASS FROM race GROUP BY CLASS HAVING COUNT(*) >= 2"} {"question": "Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.\nAdditional table information: table: insurance_policies", "answer": "SELECT Date_Claim_Made, Date_Claim_Settled FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims)"} {"question": "How many acting statuses are there?\nAdditional table information: table: department_management", "answer": "SELECT COUNT(DISTINCT temporary_acting) FROM management"} {"question": "What are the average rating and resolution of songs that are in Bangla?\nAdditional table information: table: music_1", "answer": "SELECT AVG(rating), AVG(resolution) FROM song WHERE languages = 'bangla'"} {"question": "Find names of all students who took some course and the course description.\nAdditional table information: table: college_1", "answer": "SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code"} {"question": "List all the names of schools with an endowment amount smaller than or equal to 10.\nAdditional table information: table: school_finance", "answer": "SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10"} {"question": "Find the phone number and email address of customer 'Harold'.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Customer_Phone, Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = 'Harold'"} {"question": "What is the customer id, first and last name with most number of accounts.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which game type has least number of games?\nAdditional table information: table: game_1", "answer": "SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "What is the number of colleges with a student population greater than 15000?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM College WHERE enr > 15000"} {"question": "Show the players and the years played.\nAdditional table information: table: match_season", "answer": "SELECT Player, Years_Played FROM player"} {"question": "Show the titles of books in descending order of publication price.\nAdditional table information: table: book_2", "answer": "SELECT T1.Title FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID ORDER BY T2.Price DESC"} {"question": "Which department has the largest number of employees?\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) DESC LIMIT 1"} {"question": "How many students play sports?\nAdditional table information: table: game_1", "answer": "SELECT COUNT(DISTINCT StuID) FROM Sportsinfo"} {"question": "How many girl students who are younger than 25?\nAdditional table information: table: dorm_1", "answer": "SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25"} {"question": "What are the total account balances for each customer from Utah or Texas?\nAdditional table information: table: loan_1", "answer": "SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'"} {"question": "Which origin has most number of flights?\nAdditional table information: table: flight_1", "answer": "SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the names of the directors who created a movie with a 5 star rating, and what was the name of those movies?\nAdditional table information: table: movie_1", "answer": "SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5"} {"question": "What are the names of the dorm with the largest capacity?\nAdditional table information: table: dorm_1", "answer": "SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1"} {"question": "Show the ids and details of the investors who have at least two transactions with type code 'SALE'.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = 'SALE' GROUP BY T2.investor_id HAVING COUNT(*) >= 2"} {"question": "What are all the distinct last names of all the engineers?\nAdditional table information: table: assets_maintenance", "answer": "SELECT DISTINCT last_name FROM Maintenance_Engineers"} {"question": "Show the station name and number of trains in each station.\nAdditional table information: table: train_station", "answer": "SELECT T2.name, COUNT(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id"} {"question": "Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id.\nAdditional table information: table: sakila_1", "answer": "SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(amount) ASC NULLS FIRST LIMIT 1"} {"question": "Show the name of colleges that have at least two players in descending alphabetical order.\nAdditional table information: table: match_season", "answer": "SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 ORDER BY College DESC"} {"question": "Show the names of customers who have the most mailshots.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average rating and resolution of all bangla songs?\nAdditional table information: table: music_1", "answer": "SELECT AVG(rating), AVG(resolution) FROM song WHERE languages = 'bangla'"} {"question": "Who directed Avatar?\nAdditional table information: table: movie_1", "answer": "SELECT director FROM Movie WHERE title = 'Avatar'"} {"question": "What are the names of all cities with more than one airport and how many airports do they have?\nAdditional table information: table: flight_4", "answer": "SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1"} {"question": "What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = '660 Shea Crescent' OR T2.How_to_Get_There = 'walk'"} {"question": "What is the number of aircraft?\nAdditional table information: table: aircraft", "answer": "SELECT COUNT(*) FROM aircraft"} {"question": "Find the names of all the catalog entries.\nAdditional table information: table: product_catalog", "answer": "SELECT DISTINCT (catalog_entry_name) FROM catalog_contents"} {"question": "Find the average unit price for a track.\nAdditional table information: table: chinook_1", "answer": "SELECT AVG(UnitPrice) FROM TRACK"} {"question": "Show all branch names with the number of members in each branch registered after 2015.\nAdditional table information: table: shop_membership", "answer": "SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id"} {"question": "What are the different software platforms for devices, and how many devices have each?\nAdditional table information: table: device", "answer": "SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform"} {"question": "What are the names of the tourist attractions Vincent and Marcelle visit?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Vincent' INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Marcelle'"} {"question": "Return the name and max speed of the storm that affected the most regions.\nAdditional table information: table: storm_record", "answer": "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"} {"question": "Return the issue date of the volume that has spent the fewest weeks on top.\nAdditional table information: table: music_4", "answer": "SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC NULLS FIRST LIMIT 1"} {"question": "Report the distinct registration date and the election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD"} {"question": "List three countries which are the origins of the least players.\nAdditional table information: table: baseball_1", "answer": "SELECT birth_country FROM player GROUP BY birth_country ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 3"} {"question": "How many games are played for all football games by students on scholarship?\nAdditional table information: table: game_1", "answer": "SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = 'Football' AND onscholarship = 'Y'"} {"question": "From which hometowns did both people older than 23 and younger than 20 come from?\nAdditional table information: table: gymnast", "answer": "SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20"} {"question": "Show the number of locations.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT COUNT(*) FROM Ref_locations"} {"question": "Find the name of the artist who made the album 'Balls to the Wall'.\nAdditional table information: table: chinook_1", "answer": "SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = 'Balls to the Wall'"} {"question": "list all the names of programs, ordering by launch time.\nAdditional table information: table: program_share", "answer": "SELECT name FROM program ORDER BY launch NULLS FIRST"} {"question": "What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant?\nAdditional table information: table: ship_1", "answer": "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'"} {"question": "What are the names and ids of documents that have the type code BK?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_name, document_id FROM Documents WHERE document_type_code = 'BK'"} {"question": "What are the names of the chairs of festivals, sorted in ascending order of the year held?\nAdditional table information: table: entertainment_awards", "answer": "SELECT Chair_Name FROM festival_detail ORDER BY YEAR ASC NULLS FIRST"} {"question": "List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages.\nAdditional table information: table: dorm_1", "answer": "SELECT fname, lname FROM student WHERE city_code <> 'HKG' ORDER BY age NULLS FIRST"} {"question": "Find the average rating star for each movie that are not reviewed by Brittany Harris.\nAdditional table information: table: movie_1", "answer": "SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = 'Brittany Harris') GROUP BY mID"} {"question": "How many parties do we have?\nAdditional table information: table: party_people", "answer": "SELECT COUNT(DISTINCT party_name) FROM party"} {"question": "Return the dates of ceremony and the results of all music festivals\nAdditional table information: table: music_4", "answer": "SELECT Date_of_ceremony, RESULT FROM music_festival"} {"question": "What are the names of all schools that have students trying out for the position of goal and 'mid'-field.\nAdditional table information: table: soccer_2", "answer": "SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'"} {"question": "What are the phone and email for customer Harold?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Customer_Phone, Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = 'Harold'"} {"question": "Which themes have had corresponding exhibitions that have had attendance both below 100 and above 500?\nAdditional table information: table: theme_gallery", "answer": "SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500"} {"question": "Show different locations of railways along with the corresponding number of railways at each location.\nAdditional table information: table: railway", "answer": "SELECT LOCATION, COUNT(*) FROM railway GROUP BY LOCATION"} {"question": "What is the average latitude and longitude in San Jose?\nAdditional table information: table: bike_1", "answer": "SELECT AVG(lat), AVG(long) FROM station WHERE city = 'San Jose'"} {"question": "List all the characteristic names and data types of product 'cumin'.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'cumin'"} {"question": "Please show the most common type of ships.\nAdditional table information: table: ship_mission", "answer": "SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number and time of the train that goes from Chennai to Guruvayur.\nAdditional table information: table: station_weather", "answer": "SELECT train_number, TIME FROM train WHERE origin = 'Chennai' AND destination = 'Guruvayur'"} {"question": "What is the name of the movie produced after 2000 and directed by James Cameron?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000"} {"question": "How many services has each resident requested? List the resident id, details, and the count in descending order of the count.\nAdditional table information: table: local_govt_and_lot", "answer": "SELECT T1.resident_id, T1.other_details, COUNT(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY COUNT(*) DESC"} {"question": "Show the name, location, and number of platforms for all stations.\nAdditional table information: table: train_station", "answer": "SELECT name, LOCATION, number_of_platforms FROM station"} {"question": "How many students are enrolled in the class taught by some professor from the accounting department?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'"} {"question": "Who are the friends of Bob?\nAdditional table information: table: network_2", "answer": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'"} {"question": "Find the club which has the largest number of members majoring in '600'.\nAdditional table information: table: club_1", "answer": "SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = '600' GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the average share count of transactions for different investors.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id"} {"question": "What is the average duration of songs that have mp3 format and resolution below 800?\nAdditional table information: table: music_1", "answer": "SELECT AVG(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = 'mp3' AND T2.resolution < 800"} {"question": "What is the first name of the band mate who perfomed in the most songs?\nAdditional table information: table: music_2", "answer": "SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the names of nurses who are nursing an undergoing treatment.\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID"} {"question": "Give the names of tracks that do not have a race in the class 'GT'.\nAdditional table information: table: race_track", "answer": "SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id WHERE T1.class = 'GT'"} {"question": "List the all the assets make, model, details by the disposed date ascendingly.\nAdditional table information: table: assets_maintenance", "answer": "SELECT asset_make, asset_model, asset_details FROM Assets ORDER BY asset_disposed_date ASC NULLS FIRST"} {"question": "How many members have the black membership card?\nAdditional table information: table: coffee_shop", "answer": "SELECT COUNT(*) FROM member WHERE Membership_card = 'Black'"} {"question": "List the name of all projects that are operated longer than the average working hours of all projects.\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects)"} {"question": "Find the id and last name of the teacher that has the most detentions with detention type code 'AFTER'?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT T1.teacher_id, T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = 'AFTER' GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the titles of films that include 'Deleted Scenes' in their special feature section.\nAdditional table information: table: sakila_1", "answer": "SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'"} {"question": "What are the names and number of works for all artists who have sung at least one song in English?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'english' GROUP BY T2.artist_name HAVING COUNT(*) >= 1"} {"question": "What is the location and name of the winning aircraft?\nAdditional table information: table: aircraft", "answer": "SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft"} {"question": "What are the names of all movies that were created after the most recent Steven Spielberg film?\nAdditional table information: table: movie_1", "answer": "SELECT title FROM Movie WHERE YEAR > (SELECT MAX(YEAR) FROM Movie WHERE director = 'Steven Spielberg')"} {"question": "Report the distinct advisors who have more than 2 students.\nAdditional table information: table: voter_2", "answer": "SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2"} {"question": "What are the titles and ids for albums containing tracks with unit price greater than 1?\nAdditional table information: table: chinook_1", "answer": "SELECT T1.Title, T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID"} {"question": "What is all the customer information for customers in NY state?\nAdditional table information: table: chinook_1", "answer": "SELECT * FROM CUSTOMER WHERE State = 'NY'"} {"question": "Show all allergy types.\nAdditional table information: table: allergy_1", "answer": "SELECT DISTINCT allergytype FROM Allergy_type"} {"question": "What is the id of the problem log that is created most recently?\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1"} {"question": "Show the prices of the products named 'Dining' or 'Trading Policy'.\nAdditional table information: table: solvency_ii", "answer": "SELECT Product_Price FROM Products WHERE Product_Name = 'Dining' OR Product_Name = 'Trading Policy'"} {"question": "Which cities served as a host city after 2010?\nAdditional table information: table: city_record", "answer": "SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010"} {"question": "What are the wines that have prices lower than 50 and have appelations in Monterey county?\nAdditional table information: table: wine_1", "answer": "SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Monterey' AND T2.price < 50"} {"question": "Find the number of distinct bed types available in this inn.\nAdditional table information: table: inn_1", "answer": "SELECT COUNT(DISTINCT bedType) FROM Rooms"} {"question": "What is the first name, last name, and phone of the customer with card 4560596484842.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = '4560596484842'"} {"question": "Which film has the most number of actors or actresses? List the film name, film id and description.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.title, T2.film_id, T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the average price for each type of product?\nAdditional table information: table: department_store", "answer": "SELECT product_type_code, AVG(product_price) FROM products GROUP BY product_type_code"} {"question": "What are the different types of transactions?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT DISTINCT transaction_type FROM Financial_Transactions"} {"question": "Find the SSN and name of scientists who are assigned to the project with the longest hours.\nAdditional table information: table: scientist_1", "answer": "SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)"} {"question": "how many airports are there in each country?\nAdditional table information: table: flight_company", "answer": "SELECT COUNT(*), country FROM airport GROUP BY country"} {"question": "How many schools do not participate in the basketball match?\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match)"} {"question": "What are the types of every competition and in which countries are they located?\nAdditional table information: table: sports_competition", "answer": "SELECT Competition_type, Country FROM competition"} {"question": "For each country and airline name, how many routes are there?\nAdditional table information: table: flight_4", "answer": "SELECT T1.country, T1.name, COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name"} {"question": "List the teams of the players with the top 5 largest ages.\nAdditional table information: table: school_player", "answer": "SELECT Team FROM player ORDER BY Age DESC LIMIT 5"} {"question": "list the names of the companies with more than 200 sales in the descending order of sales and profits.\nAdditional table information: table: company_employee", "answer": "SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion NULLS FIRST, Profits_in_Billion DESC"} {"question": "What are the ids and names of all start stations that were the beginning of at least 200 trips?\nAdditional table information: table: bike_1", "answer": "SELECT start_station_id, start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200"} {"question": "List the description of all the colors.\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT color_description FROM ref_colors"} {"question": "What are the first names of all professors who teach more than one class?\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING COUNT(*) > 1"} {"question": "What is the name of the room that can accommodate the most people?\nAdditional table information: table: inn_1", "answer": "SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1"} {"question": "How many council taxes are collected for renting arrears ?\nAdditional table information: table: local_govt_mdm", "answer": "SELECT COUNT(*) FROM rent_arrears"} {"question": "Show name and salary for all employees sorted by salary.\nAdditional table information: table: flight_1", "answer": "SELECT name, salary FROM Employee ORDER BY salary NULLS FIRST"} {"question": "Find the building, room number, semester and year of all courses offered by Psychology department sorted by course titles.\nAdditional table information: table: college_2", "answer": "SELECT T2.building, T2.room_number, T2.semester, T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title NULLS FIRST"} {"question": "What are the different card type codes?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT DISTINCT card_type_code FROM Customers_Cards"} {"question": "Show all dates of transactions whose type code is 'SALE'.\nAdditional table information: table: tracking_share_transactions", "answer": "SELECT date_of_transaction FROM TRANSACTIONS WHERE transaction_type_code = 'SALE'"} {"question": "Find the name, headquarter and founder of the manufacturer that has the highest revenue.\nAdditional table information: table: manufactory_1", "answer": "SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1"} {"question": "Which industries have both companies with headquarter in 'USA' and companies with headquarter in 'China'?\nAdditional table information: table: company_office", "answer": "SELECT Industry FROM Companies WHERE Headquarters = 'USA' INTERSECT SELECT Industry FROM Companies WHERE Headquarters = 'China'"} {"question": "Find the number of albums.\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM ALBUM"} {"question": "Show the name, location, open year for all tracks with a seating higher than the average.\nAdditional table information: table: race_track", "answer": "SELECT name, LOCATION, year_opened FROM track WHERE seating > (SELECT AVG(seating) FROM track)"} {"question": "Find the ids of reviewers who didn't only give 4 star.\nAdditional table information: table: movie_1", "answer": "SELECT rID FROM Rating WHERE stars <> 4"} {"question": "Find the common personal name of course authors and students.\nAdditional table information: table: e_learning", "answer": "SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students"} {"question": "What are the highest cost, lowest cost and average cost of procedures?\nAdditional table information: table: hospital_1", "answer": "SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures"} {"question": "List names of all pilot in descending order of age.\nAdditional table information: table: aircraft", "answer": "SELECT Name FROM pilot ORDER BY Age DESC"} {"question": "Show all the buildings that have at least 10 professors.\nAdditional table information: table: activity_1", "answer": "SELECT building FROM Faculty WHERE rank = 'Professor' GROUP BY building HAVING COUNT(*) >= 10"} {"question": "Find the addresses of the course authors who teach the course with name 'operating system' or 'data structure'.\nAdditional table information: table: e_learning", "answer": "SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = 'operating system' OR T2.course_name = 'data structure'"} {"question": "Tell me the the claim date and settlement date for each settlement case.\nAdditional table information: table: insurance_policies", "answer": "SELECT Date_Claim_Made, Date_Claim_Settled FROM Settlements"} {"question": "For each tourist attraction, return its name and the date when the tourists named Vincent or Vivian visited there.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T3.Visit_Date FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Vincent' OR T2.Tourist_Details = 'Vivian'"} {"question": "What are the department names, cities, and state provinces for each department?\nAdditional table information: table: hr_1", "answer": "SELECT T1.department_name, T2.city, T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id"} {"question": "Find the name of department has the highest amount of students?\nAdditional table information: table: college_2", "answer": "SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find all the product whose name contains the word 'Scanner'.\nAdditional table information: table: store_product", "answer": "SELECT product FROM product WHERE product LIKE '%Scanner%'"} {"question": "Show the game name that has most number of hours played.\nAdditional table information: table: game_1", "answer": "SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1"} {"question": "List all the username and passwords of users with the most popular role.\nAdditional table information: table: document_management", "answer": "SELECT user_name, password FROM users GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the names of 5 users followed by the largest number of other users.\nAdditional table information: table: twitter_1", "answer": "SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5"} {"question": "Show teams that have suffered more than three eliminations.\nAdditional table information: table: wrestler", "answer": "SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3"} {"question": "What are all the instruments used by the musician with the last name 'Heilo'?\nAdditional table information: table: music_2", "answer": "SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = 'Heilo'"} {"question": "How many instruments does the song 'Le Pop' use?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'"} {"question": "Which nurses are in charge of patients undergoing treatments?\nAdditional table information: table: hospital_1", "answer": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID"} {"question": "What are the distinct secretary votes in the fall election cycle?\nAdditional table information: table: voter_2", "answer": "SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = 'Fall'"} {"question": "What are the names of patients who are not taking the medication of Procrastin-X.\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient = T1.SSN JOIN Medication AS T3 ON T2.Medication = T3.Code WHERE T3.name = 'Procrastin-X'"} {"question": "What are the names of projects that have taken longer than the average number of hours for all projects?\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects)"} {"question": "Find the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh'.\nAdditional table information: table: e_learning", "answer": "SELECT date_of_latest_logon FROM Students WHERE family_name = 'Jaskolski' OR family_name = 'Langosh'"} {"question": "Find all the cities that have 2 to 4 parks.\nAdditional table information: table: baseball_1", "answer": "SELECT city FROM park GROUP BY city HAVING COUNT(*) BETWEEN 2 AND 4"} {"question": "Find the id and name of the most expensive base price room.\nAdditional table information: table: inn_1", "answer": "SELECT RoomId, roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1"} {"question": "How much salary did the top 3 well-paid players get in 2001?\nAdditional table information: table: baseball_1", "answer": "SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3"} {"question": "List the name of all customers sorted by their account balance in ascending order.\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer ORDER BY acc_bal NULLS FIRST"} {"question": "How many customers do we have?\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(*) FROM Customers"} {"question": "How many tracks belong to rock genre?\nAdditional table information: table: chinook_1", "answer": "SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = 'Rock'"} {"question": "Retrieve all the first and last names of authors in the alphabetical order of last names.\nAdditional table information: table: icfp_1", "answer": "SELECT fname, lname FROM authors ORDER BY lname NULLS FIRST"} {"question": "What are the different names of all the races in reverse alphabetical order?\nAdditional table information: table: formula_1", "answer": "SELECT DISTINCT name FROM races ORDER BY name DESC"} {"question": "Return the name of the category to which the film 'HUNGER ROOF' belongs.\nAdditional table information: table: sakila_1", "answer": "SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'"} {"question": "Find the forename and surname of drivers whose nationality is German?\nAdditional table information: table: formula_1", "answer": "SELECT forename, surname FROM drivers WHERE nationality = 'German'"} {"question": "What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people.\nAdditional table information: table: inn_1", "answer": "SELECT roomName, RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2"} {"question": "Return the address and email of the customer with the first name Linda.\nAdditional table information: table: sakila_1", "answer": "SELECT T2.address, T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA'"} {"question": "How many lessons were taught by a staff member whose first name has the letter 'a' in it?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE '%a%'"} {"question": "What is the theme and artist name for the exhibition with a ticket price higher than the average?\nAdditional table information: table: theme_gallery", "answer": "SELECT T1.theme, T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT AVG(ticket_price) FROM exhibition)"} {"question": "What are the names of the technicians that are assigned to repair machines with more point values than 70?\nAdditional table information: table: machine_repair", "answer": "SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70"} {"question": "Count the number of courses in the Physics department.\nAdditional table information: table: college_2", "answer": "SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'"} {"question": "Show the ids of the students who don't participate in any activity.\nAdditional table information: table: activity_1", "answer": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in"} {"question": "How many schools are in the basketball match?\nAdditional table information: table: university_basketball", "answer": "SELECT COUNT(DISTINCT school_id) FROM basketball_match"} {"question": "What is the theme, date, and attendance for the exhibition in year 2004?\nAdditional table information: table: theme_gallery", "answer": "SELECT T2.theme, T1.date, T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T2.year = 2004"} {"question": "What are the ids of all reviewers who have not given 4 stars at least once?\nAdditional table information: table: movie_1", "answer": "SELECT rID FROM Rating WHERE stars <> 4"} {"question": "Find all the albums in 2012.\nAdditional table information: table: music_2", "answer": "SELECT * FROM Albums WHERE YEAR = 2012"} {"question": "What are the rooms for members of the faculty who are professors and who live in building NEB?\nAdditional table information: table: college_3", "answer": "SELECT Room FROM FACULTY WHERE Rank = 'Professor' AND Building = 'NEB'"} {"question": "What is maximum and minimum RAM size of phone produced by company named 'Nokia Corporation'?\nAdditional table information: table: phone_1", "answer": "SELECT MAX(T1.RAM_MiB), MIN(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = 'Nokia Corporation'"} {"question": "List the names of people that have not been on the affirmative side of debates.\nAdditional table information: table: debate", "answer": "SELECT Name FROM people WHERE NOT People_id IN (SELECT Affirmative FROM debate_people)"} {"question": "find the total percentage share of all channels owned by CCTV.\nAdditional table information: table: program_share", "answer": "SELECT SUM(Share_in_percent) FROM channel WHERE OWNER = 'CCTV'"} {"question": "What are the names of students who have taken the prerequisite for the course International Finance?\nAdditional table information: table: college_2", "answer": "SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')"} {"question": "What are the party emails associated with parties that used the party form that is the most common?\nAdditional table information: table: e_government", "answer": "SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "How many medications are prescribed for each brand?\nAdditional table information: table: hospital_1", "answer": "SELECT COUNT(*), T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand"} {"question": "What are the names, classes, and dates for all races?\nAdditional table information: table: race_track", "answer": "SELECT name, CLASS, date FROM race"} {"question": "Find the city that hosted the most events.\nAdditional table information: table: city_record", "answer": "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"} {"question": "How many vehicles exist?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Vehicles"} {"question": "Which catalog contents have a product stock number that starts from '2'? Show the catalog entry names.\nAdditional table information: table: product_catalog", "answer": "SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE '2%'"} {"question": "What is the aircraft name for the flight with number 99\nAdditional table information: table: flight_1", "answer": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99"} {"question": "What are the names and locations of festivals?\nAdditional table information: table: entertainment_awards", "answer": "SELECT Festival_Name, LOCATION FROM festival_detail"} {"question": "On what dates did the student with family name 'Zieme' and personal name 'Bernie' enroll in and complete the courses?\nAdditional table information: table: e_learning", "answer": "SELECT T1.date_of_enrolment, T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = 'Zieme' AND T2.personal_name = 'Bernie'"} {"question": "What are the gas station ids, locations, and manager names for the gas stations ordered by opening year?\nAdditional table information: table: gas_company", "answer": "SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year NULLS FIRST"} {"question": "List all the event names by year from the most recent to the oldest.\nAdditional table information: table: swimming", "answer": "SELECT name FROM event ORDER BY YEAR DESC"} {"question": "What are the names and countries of members?\nAdditional table information: table: decoration_competition", "answer": "SELECT Name, Country FROM member"} {"question": "List the actual delivery date for all the orders with quantity 1\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1"} {"question": "What are the names of races that were held after 2017 and the circuits were in the country of Spain?\nAdditional table information: table: formula_1", "answer": "SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = 'Spain' AND T1.year > 2017"} {"question": "Show the name of cities in the county that has the largest number of police officers.\nAdditional table information: table: county_public_safety", "answer": "SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1)"} {"question": "Find the buildings which have rooms with capacity more than 50.\nAdditional table information: table: college_2", "answer": "SELECT DISTINCT building FROM classroom WHERE capacity > 50"} {"question": "Find the name of the customer who made an order most recently.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1"} {"question": "What is the average price of products with manufacturer codes equal to 2?\nAdditional table information: table: manufactory_1", "answer": "SELECT AVG(price) FROM products WHERE manufacturer = 2"} {"question": "Find the average age and experience working length of journalists working on different role type.\nAdditional table information: table: news_report", "answer": "SELECT AVG(t1.age), AVG(Years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type"} {"question": "Which Advisor has most of students? List advisor and the number of students.\nAdditional table information: table: restaurant_1", "answer": "SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor ORDER BY COUNT(Advisor) DESC LIMIT 1"} {"question": "Find the names of all the tracks that contain the word 'you'.\nAdditional table information: table: chinook_1", "answer": "SELECT Name FROM TRACK WHERE Name LIKE '%you%'"} {"question": "What are the names of all instructors who advise students in the math depart sorted by total credits of the student.\nAdditional table information: table: college_2", "answer": "SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred NULLS FIRST"} {"question": "Find the average access count across all documents?\nAdditional table information: table: document_management", "answer": "SELECT AVG(access_count) FROM documents"} {"question": "Which industry has the most companies?\nAdditional table information: table: company_office", "answer": "SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Return the most common first name among all actors.\nAdditional table information: table: sakila_1", "answer": "SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the type codes of the policies used by the customer 'Dayana Robel'?\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = 'Dayana Robel'"} {"question": "What are the names of all the tracks that are in both the Movies and music playlists?\nAdditional table information: table: store_1", "answer": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'"} {"question": "Show the delegates and the names of the party they belong to.\nAdditional table information: table: election", "answer": "SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID"} {"question": "display the full name (first and last name), and salary of those employees who working in any department located in London.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'"} {"question": "Compute the total salary that the player with first name Len and last name Barker received between 1985 to 1990.\nAdditional table information: table: baseball_1", "answer": "SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990"} {"question": "What are the name, id and the corresponding number of visits for each tourist attraction?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT T1.Name, T2.Tourist_Attraction_ID, COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID"} {"question": "What are the method, date and amount of each payment? Sort the list in ascending order of date.\nAdditional table information: table: insurance_policies", "answer": "SELECT Payment_Method_Code, Date_Payment_Made, Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC NULLS FIRST"} {"question": "List the first name and last name of all customers.\nAdditional table information: table: driving_school", "answer": "SELECT first_name, last_name FROM Customers"} {"question": "Show the name and location for all tracks.\nAdditional table information: table: race_track", "answer": "SELECT name, LOCATION FROM track"} {"question": "List the name, born state and age of the heads of departments ordered by age.\nAdditional table information: table: department_management", "answer": "SELECT name, born_state, age FROM head ORDER BY age NULLS FIRST"} {"question": "Find the title, credit, and department name of courses that have more than one prerequisites?\nAdditional table information: table: college_2", "answer": "SELECT T1.title, T1.credits, T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) > 1"} {"question": "How many airports are there per city in the US ordered from most to least?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC"} {"question": "Show all role codes and the number of employees in each role.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code"} {"question": "What is the id and detail of the vehicle used in lessons for most of the times?\nAdditional table information: table: driving_school", "answer": "SELECT T1.vehicle_id, T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "List the dates and vote percents of elections.\nAdditional table information: table: election_representative", "answer": "SELECT Date, Vote_Percent FROM election"} {"question": "List the names of mountains that do not have any climber.\nAdditional table information: table: climbing", "answer": "SELECT Name FROM mountain WHERE NOT Mountain_ID IN (SELECT Mountain_ID FROM climber)"} {"question": "What is the average total number of passengers of airports that are associated with aircraft 'Robinson R-22'?\nAdditional table information: table: aircraft", "answer": "SELECT AVG(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = 'Robinson R-22'"} {"question": "Find the name of instructors who didn't teach any courses?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches)"} {"question": "How many distinct official languages are there among countries of players whose positions are defenders.\nAdditional table information: table: match_season", "answer": "SELECT COUNT(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Defender'"} {"question": "Retrieve the country that has published the most papers.\nAdditional table information: table: icfp_1", "answer": "SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What destination has the fewest number of flights?\nAdditional table information: table: flight_1", "answer": "SELECT destination FROM Flight GROUP BY destination ORDER BY COUNT(*) NULLS FIRST LIMIT 1"} {"question": "Return the channel code and contact number of the customer contact channel whose active duration was the longest.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)"} {"question": "What is the average high temperature for each day of week?\nAdditional table information: table: station_weather", "answer": "SELECT AVG(high_temperature), day_of_week FROM weekly_weather GROUP BY day_of_week"} {"question": "How many distinct publication dates are there in our record?\nAdditional table information: table: book_2", "answer": "SELECT COUNT(DISTINCT Publication_Date) FROM publication"} {"question": "What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?\nAdditional table information: table: sakila_1", "answer": "SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa'"} {"question": "What is the average number of stars that each reviewer awards for a movie?\nAdditional table information: table: movie_1", "answer": "SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name"} {"question": "Please list the years of film market estimations when the market is in country 'Japan' in descending order.\nAdditional table information: table: film_rank", "answer": "SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = 'Japan' ORDER BY T1.Year DESC"} {"question": "Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.\nAdditional table information: table: voter_2", "answer": "SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = 'NYC' AND T2.Election_Cycle = 'Spring'"} {"question": "What are all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT address_content FROM addresses WHERE city = 'East Julianaside' AND state_province_county = 'Texas' UNION SELECT address_content FROM addresses WHERE city = 'Gleasonmouth' AND state_province_county = 'Arizona'"} {"question": "What are the first and last names of the instructors who teach the top 3 number of courses?\nAdditional table information: table: college_3", "answer": "SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "Return the ids of all products that were ordered more than three times or supplied more than 80000.\nAdditional table information: table: department_store", "answer": "SELECT product_id FROM Order_Items GROUP BY product_id HAVING COUNT(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING SUM(total_amount_purchased) > 80000"} {"question": "What is the salaray and name of the employee with the most certificates to fly planes more than 5000?\nAdditional table information: table: flight_1", "answer": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Which campus has the most faculties in year 2003?\nAdditional table information: table: csu_1", "answer": "SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1"} {"question": "Which is the email of the party that has used the services the most number of times?\nAdditional table information: table: e_government", "answer": "SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Show the distinct fate of missions that involve ships with nationality 'United States'\nAdditional table information: table: ship_mission", "answer": "SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = 'United States'"} {"question": "How many hours do the students spend studying in each department?\nAdditional table information: table: college_1", "answer": "SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code"} {"question": "Return the age of the person with the greatest height.\nAdditional table information: table: gymnast", "answer": "SELECT Age FROM people ORDER BY Height DESC LIMIT 1"} {"question": "Find the name and account balance of the customers who have loans with a total amount of more than 5000.\nAdditional table information: table: loan_1", "answer": "SELECT T1.cust_name, T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING SUM(T2.amount) > 5000"} {"question": "How many rooms whose capacity is less than 50 does the Lamberton building have?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50"} {"question": "Show ids for all students who live in CHI.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student WHERE city_code = 'CHI'"} {"question": "Find the last names of students with major 50.\nAdditional table information: table: voter_2", "answer": "SELECT LName FROM STUDENT WHERE Major = 50"} {"question": "What is the unit of measurement of product named 'cumin'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'cumin'"} {"question": "Find the component amounts and names of all furnitures that have more than 10 components.\nAdditional table information: table: manufacturer", "answer": "SELECT Num_of_Component, name FROM furniture WHERE Num_of_Component > 10"} {"question": "What are the details of the project with no outcomes?\nAdditional table information: table: tracking_grants_for_research", "answer": "SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes)"} {"question": "display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = 'Clara')"} {"question": "Which of the mill names contains the french word 'Moulin'?\nAdditional table information: table: architecture", "answer": "SELECT name FROM mill WHERE name LIKE '%Moulin%'"} {"question": "What are the first names of all students in Smith Hall?\nAdditional table information: table: dorm_1", "answer": "SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall'"} {"question": "List the types of competition that have at most five competitions of that type.\nAdditional table information: table: sports_competition", "answer": "SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5"} {"question": "list names of all departments ordered by their names.\nAdditional table information: table: college_1", "answer": "SELECT dept_name FROM department ORDER BY dept_name NULLS FIRST"} {"question": "Please show the employee first names and ids of employees who serve at least 10 customers.\nAdditional table information: table: chinook_1", "answer": "SELECT T1.FirstName, T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10"} {"question": "What are the names of the districts that have both mall and village store style shops?\nAdditional table information: table: store_product", "answer": "SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = 'City Mall' INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = 'Village Store'"} {"question": "List the open date of open year of the shop named 'Apple'.\nAdditional table information: table: device", "answer": "SELECT Open_Date, Open_Year FROM shop WHERE Shop_Name = 'Apple'"} {"question": "Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25.\nAdditional table information: table: tracking_orders", "answer": "SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < '1989-09-03' OR invoice_date > '2007-12-25'"} {"question": "Find the names of users who did not leave any review.\nAdditional table information: table: epinions_1", "answer": "SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review)"} {"question": "Provide the full names of employees earning more than the employee with id 163.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163)"} {"question": "Return the text of tweets about the topic 'intern'.\nAdditional table information: table: twitter_1", "answer": "SELECT text FROM tweets WHERE text LIKE '%intern%'"} {"question": "Find the name of customers who are living in Colorado?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'Colorado'"} {"question": "Return the result that is most frequent at music festivals.\nAdditional table information: table: music_4", "answer": "SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of songs in all the studio albums.\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = 'Studio'"} {"question": "What are the names and salaries for instructors who earn less than the average salary of instructors in the Physics department?\nAdditional table information: table: college_2", "answer": "SELECT name, salary FROM instructor WHERE salary < (SELECT AVG(salary) FROM instructor WHERE dept_name = 'Physics')"} {"question": "What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?\nAdditional table information: table: sakila_1", "answer": "SELECT DISTINCT T1.first_name, T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'"} {"question": "List the name of all products along with the number of complaints that they have received.\nAdditional table information: table: customer_complaints", "answer": "SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name"} {"question": "Return the prices of wines produced before 2010.\nAdditional table information: table: wine_1", "answer": "SELECT Price FROM WINE WHERE YEAR < 2010"} {"question": "Show different carriers of phones together with the number of phones with each carrier.\nAdditional table information: table: phone_market", "answer": "SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier"} {"question": "Which customers use 'Cash' for payment method? Return the customer names.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT customer_name FROM customers WHERE payment_method = 'Cash'"} {"question": "Find the number of scientists who are not assigned to any project.\nAdditional table information: table: scientist_1", "answer": "SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)"} {"question": "Find the names and number of works of all artists who have at least one English songs.\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'english' GROUP BY T2.artist_name HAVING COUNT(*) >= 1"} {"question": "What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top?\nAdditional table information: table: music_4", "answer": "SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2"} {"question": "What is the total balance of savings accounts not belonging to someone with the name Brown?\nAdditional table information: table: small_bank_1", "answer": "SELECT SUM(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name <> 'Brown'"} {"question": "Find the types of documents with more than 4 documents.\nAdditional table information: table: document_management", "answer": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4"} {"question": "Find the first names of all the authors ordered in alphabetical order.\nAdditional table information: table: icfp_1", "answer": "SELECT fname FROM authors ORDER BY fname NULLS FIRST"} {"question": "How many people whose age is greater 30 and job is engineer?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer'"} {"question": "What is the description of the product category with the code 'Spices'?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT product_category_description FROM ref_product_categories WHERE product_category_code = 'Spices'"} {"question": "What are the names of every person who has a friend over 40 and under 30?\nAdditional table information: table: network_2", "answer": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)"} {"question": "What is the total amount of payment?\nAdditional table information: table: insurance_policies", "answer": "SELECT SUM(Amount_Payment) FROM Payments"} {"question": "What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER?\nAdditional table information: table: student_1", "answer": "SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'"} {"question": "Find the name of dorms which have both TV Lounge and Study Room as amenities.\nAdditional table information: table: dorm_1", "answer": "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'"} {"question": "How many different last names do the actors and actresses have?\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(DISTINCT last_name) FROM actor"} {"question": "Show the first name and last name for the customer with account name 900.\nAdditional table information: table: customers_and_invoices", "answer": "SELECT T2.customer_first_name, T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = '900'"} {"question": "For each station, find its latitude and the minimum duration of trips that ended at the station.\nAdditional table information: table: bike_1", "answer": "SELECT T1.name, T1.lat, MIN(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id"} {"question": "Return the number of customers who have at least one order with 'Cancelled' status.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = 'Cancelled'"} {"question": "What are the names of the directors who made exactly one movie?\nAdditional table information: table: movie_1", "answer": "SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1"} {"question": "What are the names of the singers who sang the top 3 most highly rated songs and what countries do they hail from?\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3"} {"question": "Find the number of employees whose title is IT Staff from each city?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*), city FROM employees WHERE title = 'IT Staff' GROUP BY city"} {"question": "What are the average prices of hotels grouped by their pet policy.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn"} {"question": "Find the salary and manager number for those employees who is working under a manager.\nAdditional table information: table: hr_1", "answer": "SELECT salary, manager_id FROM employees WHERE manager_id <> 'null'"} {"question": "What are the three most costly procedures?\nAdditional table information: table: hospital_1", "answer": "SELECT name FROM procedures ORDER BY cost NULLS FIRST LIMIT 3"} {"question": "Find the the grape whose white color grapes are used to produce wines with scores higher than 90.\nAdditional table information: table: wine_1", "answer": "SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White' AND T2.score > 90"} {"question": "How many donors have endowment for school named 'Glenn'?\nAdditional table information: table: school_finance", "answer": "SELECT COUNT(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'"} {"question": "What are the open and close dates of all the policies used by the customer who have 'Diana' in part of their names?\nAdditional table information: table: insurance_fnol", "answer": "SELECT t2.date_opened, t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE '%Diana%'"} {"question": "Count the number of budget codes.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT COUNT(*) FROM Ref_budget_codes"} {"question": "List all document type codes and document type names.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT document_type_code, document_type_name FROM Ref_document_types"} {"question": "What are the names of all the scientists in alphabetical order?\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM scientists ORDER BY name NULLS FIRST"} {"question": "Find all types of store and number of them.\nAdditional table information: table: store_product", "answer": "SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE"} {"question": "what are the name of players who get more than the average points.\nAdditional table information: table: sports_competition", "answer": "SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player)"} {"question": "How many milliseconds long is Fast As a Shark?\nAdditional table information: table: store_1", "answer": "SELECT milliseconds FROM tracks WHERE name = 'Fast As a Shark'"} {"question": "Find the names of rooms that have been reserved for more than 60 times.\nAdditional table information: table: inn_1", "answer": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING COUNT(*) > 60"} {"question": "Give the title and credits for the course that is taught in the classroom with the greatest capacity.\nAdditional table information: table: college_2", "answer": "SELECT T3.title, T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT MAX(capacity) FROM classroom)"} {"question": "What is the id of the patient who stayed in room 111 most recently?\nAdditional table information: table: hospital_1", "answer": "SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1"} {"question": "How many addresses are in the district of California?\nAdditional table information: table: sakila_1", "answer": "SELECT COUNT(*) FROM address WHERE district = 'California'"} {"question": "Show the ids and names of all documents.\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT document_id, document_name FROM Documents"} {"question": "Which artist has the most albums?\nAdditional table information: table: chinook_1", "answer": "SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the title, phone and hire date of Nancy Edwards?\nAdditional table information: table: store_1", "answer": "SELECT title, phone, hire_date FROM employees WHERE first_name = 'Nancy' AND last_name = 'Edwards'"} {"question": "What is the average weight of all players?\nAdditional table information: table: soccer_1", "answer": "SELECT AVG(weight) FROM Player"} {"question": "What is the marketing region code that has the most drama workshop groups?\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the delegate and committee information for each election record?\nAdditional table information: table: election", "answer": "SELECT Delegate, Committee FROM election"} {"question": "What are the prices of products that have never gotten a complaint?\nAdditional table information: table: customer_complaints", "answer": "SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints)"} {"question": "Return the detail of the location named 'UK Gallery'.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Other_Details FROM LOCATIONS WHERE Location_Name = 'UK Gallery'"} {"question": "Give the country id and corresponding count of cities in each country.\nAdditional table information: table: hr_1", "answer": "SELECT country_id, COUNT(*) FROM locations GROUP BY country_id"} {"question": "Find the average checking balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT AVG(balance) FROM checking"} {"question": "Show the station name with greatest number of trains.\nAdditional table information: table: train_station", "answer": "SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the course names, ordered by credits?\nAdditional table information: table: college_3", "answer": "SELECT CName FROM COURSE ORDER BY Credits NULLS FIRST"} {"question": "Find the name of the person who has friends with age above 40 and under age 30?\nAdditional table information: table: network_2", "answer": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)"} {"question": "Find the name of the ships that have more than one captain.\nAdditional table information: table: ship_1", "answer": "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"} {"question": "Count the total number of policies used by the customer named 'Dayana Robel'.\nAdditional table information: table: insurance_fnol", "answer": "SELECT COUNT(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Dayana Robel'"} {"question": "Find the number of airports whose name contain the word 'International'.\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airports WHERE name LIKE '%International%'"} {"question": "Find the name of instructors who are advising more than one student.\nAdditional table information: table: college_2", "answer": "SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING COUNT(*) > 1"} {"question": "For each payment method, return how many customers use it.\nAdditional table information: table: department_store", "answer": "SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code"} {"question": "List all the contact channel codes that were used less than 5 times.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5"} {"question": "What are the number of international and domestic passengers of the airport named London 'Heathrow'?\nAdditional table information: table: aircraft", "answer": "SELECT International_Passengers, Domestic_Passengers FROM airport WHERE Airport_Name = 'London Heathrow'"} {"question": "What is the first and last name of the employee who reports to Nancy Edwards?\nAdditional table information: table: store_1", "answer": "SELECT T2.first_name, T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = 'Nancy' AND T1.last_name = 'Edwards'"} {"question": "How many different users wrote some reviews?\nAdditional table information: table: epinions_1", "answer": "SELECT COUNT(DISTINCT u_id) FROM review"} {"question": "What are the member names and hometowns of those who registered at a branch in 2016?\nAdditional table information: table: shop_membership", "answer": "SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016"} {"question": "Find all the zip codes in which the max dew point have never reached 70.\nAdditional table information: table: bike_1", "answer": "SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70"} {"question": "What are the the songs in volumes, listed in ascending order?\nAdditional table information: table: music_4", "answer": "SELECT Song FROM volume ORDER BY Song NULLS FIRST"} {"question": "Find the claims that led to more than two settlements or have the maximum claim value. For each of them, return the date the claim was made and the id of the claim.\nAdditional table information: table: insurance_policies", "answer": "SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING COUNT(*) > 2 UNION SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = (SELECT MAX(Amount_Claimed) FROM Claims)"} {"question": "Give id of the instructor who advises students in the History department.\nAdditional table information: table: college_2", "answer": "SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'"} {"question": "What are the names of all reviewers that have given 3 or 4 stars for reviews?\nAdditional table information: table: movie_1", "answer": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4"} {"question": "List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\nAdditional table information: table: department_management", "answer": "SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T1.name = 'Treasury' INTERSECT SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T1.name = 'Homeland Security'"} {"question": "Find all the songs that do not have a lead vocal.\nAdditional table information: table: music_2", "answer": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = 'lead'"} {"question": "What is the customer first, last name and id with least number of accounts.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT T2.customer_first_name, T2.customer_last_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "Count the number of wines produced at Robert Biale winery.\nAdditional table information: table: wine_1", "answer": "SELECT COUNT(*) FROM WINE WHERE Winery = 'Robert Biale'"} {"question": "Show the location code, the starting date and ending data in that location for all the documents.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code, date_in_location_from, date_in_locaton_to FROM Document_locations"} {"question": "Find the first names of professors who are not playing Canoeing or Kayaking.\nAdditional table information: table: activity_1", "answer": "SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'"} {"question": "What is the date of birth of every customer whose status code is 'Good Customer'?\nAdditional table information: table: driving_school", "answer": "SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'"} {"question": "What is the average song duration for the songs that are in mp3 format and whose resolution below 800?\nAdditional table information: table: music_1", "answer": "SELECT AVG(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = 'mp3' AND T2.resolution < 800"} {"question": "What are the songs in album 'A Kiss Before You Go: Live in Hamburg'?\nAdditional table information: table: music_2", "answer": "SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = 'A Kiss Before You Go: Live in Hamburg'"} {"question": "What are the names and urls of images, sorted alphabetically?\nAdditional table information: table: document_management", "answer": "SELECT image_name, image_url FROM images ORDER BY image_name NULLS FIRST"} {"question": "How many different jobs are listed?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(DISTINCT job) FROM Person"} {"question": "Find the 'date became customers' of the customers whose ID is between 10 and 20.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20"} {"question": "Find the code of the role that have the most employees.\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the main indstries and total market value for each industry?\nAdditional table information: table: gas_company", "answer": "SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry"} {"question": "List the first name of all employees with job code PROF ordered by their date of birth.\nAdditional table information: table: college_1", "answer": "SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob NULLS FIRST"} {"question": "How many students are in each department?\nAdditional table information: table: college_2", "answer": "SELECT COUNT(*), dept_name FROM student GROUP BY dept_name"} {"question": "what is the name of the instructor who is in Statistics department and earns the lowest salary?\nAdditional table information: table: college_2", "answer": "SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary NULLS FIRST LIMIT 1"} {"question": "What is the first and last name of the faculty participating in the most activities?\nAdditional table information: table: activity_1", "answer": "SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the number of papers published by authors from the institution 'Tokohu University'.\nAdditional table information: table: icfp_1", "answer": "SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = 'Tokohu University'"} {"question": "Find the saving balance of the account with the highest checking balance.\nAdditional table information: table: small_bank_1", "answer": "SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1"} {"question": "What is the title of the course that was offered at building Chandler during the fall semester in the year of 2010?\nAdditional table information: table: college_2", "answer": "SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010"} {"question": "How many different instruments are used in the song 'Le Pop'?\nAdditional table information: table: music_2", "answer": "SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'"} {"question": "What are the names of projects that require between 100 and 300 hours?\nAdditional table information: table: scientist_1", "answer": "SELECT name FROM projects WHERE hours BETWEEN 100 AND 300"} {"question": "Show all card type codes and the number of customers holding cards in each type.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT card_type_code, COUNT(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code"} {"question": "Which months have more than 2 happy hours?\nAdditional table information: table: coffee_shop", "answer": "SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING COUNT(*) > 2"} {"question": "Show the outcome code of mailshots along with the number of mailshots in each outcome code.\nAdditional table information: table: customers_campaigns_ecommerce", "answer": "SELECT outcome_code, COUNT(*) FROM mailshot_customers GROUP BY outcome_code"} {"question": "What is the average rating of songs for each language?\nAdditional table information: table: music_1", "answer": "SELECT AVG(rating), languages FROM song GROUP BY languages"} {"question": "Show student ids who don't have any sports.\nAdditional table information: table: game_1", "answer": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo"} {"question": "Take the average of the school enrollment.\nAdditional table information: table: school_player", "answer": "SELECT AVG(Enrollment) FROM school"} {"question": "What are the names of musicals who have at 3 or more actors?\nAdditional table information: table: musical", "answer": "SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*) >= 3"} {"question": "How many players have more than 1000 hours of training?\nAdditional table information: table: soccer_2", "answer": "SELECT COUNT(*) FROM Player WHERE HS > 1000"} {"question": "What are the names and ids of stations that had more than 14 bikes available on average or were installed in December?\nAdditional table information: table: bike_1", "answer": "SELECT T1.name, T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING AVG(T2.bikes_available) > 14 UNION SELECT name, id FROM station WHERE installation_date LIKE '12/%'"} {"question": "What are the name and description for role code 'MG'?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT role_name, role_description FROM ROLES WHERE role_code = 'MG'"} {"question": "Show details of all visitors.\nAdditional table information: table: cre_Theme_park", "answer": "SELECT Tourist_Details FROM VISITORS"} {"question": "How many lessons did the customer Ryan Goodwin complete?\nAdditional table information: table: driving_school", "answer": "SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Rylan' AND T2.last_name = 'Goodwin' AND T1.lesson_status_code = 'Completed'"} {"question": "Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.\nAdditional table information: table: ship_1", "answer": "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'"} {"question": "Show gas station id, location, and manager_name for all gas stations ordered by open year.\nAdditional table information: table: gas_company", "answer": "SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year NULLS FIRST"} {"question": "How many roller coasters are there?\nAdditional table information: table: roller_coaster", "answer": "SELECT COUNT(*) FROM roller_coaster"} {"question": "Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)"} {"question": "What is the average and largest salary of all employees?\nAdditional table information: table: flight_1", "answer": "SELECT AVG(salary), MAX(salary) FROM Employee"} {"question": "What are all the policy types of the customer that has the most policies listed?\nAdditional table information: table: insurance_fnol", "answer": "SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC LIMIT 1)"} {"question": "What is the average sales of the journals that have an editor whose work type is 'Photo'?\nAdditional table information: table: journal_committee", "answer": "SELECT AVG(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo'"} {"question": "Find the names of customers who have used both the service 'Close a policy' and the service 'New policy application'.\nAdditional table information: table: insurance_fnol", "answer": "SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = 'Close a policy' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = 'New policy application'"} {"question": "list the local authorities and services provided by all stations.\nAdditional table information: table: station_weather", "answer": "SELECT local_authority, services FROM station"} {"question": "Find the payment method that is used most frequently.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are full names and salaries of employees working in the city of London?\nAdditional table information: table: hr_1", "answer": "SELECT first_name, last_name, salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'"} {"question": "What is the maximum and minimum market value of companies?\nAdditional table information: table: company_employee", "answer": "SELECT MAX(Market_Value_in_Billion), MIN(Market_Value_in_Billion) FROM company"} {"question": "Find all the ids and dates of the logs for the problem whose id is 10.\nAdditional table information: table: tracking_software_problems", "answer": "SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10"} {"question": "What are the themes of farm competitions sorted by year in ascending order?\nAdditional table information: table: farm", "answer": "SELECT Theme FROM farm_competition ORDER BY YEAR ASC NULLS FIRST"} {"question": "What are the names of teams from universities that have a below average enrollment?\nAdditional table information: table: university_basketball", "answer": "SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT AVG(enrollment) FROM university)"} {"question": "Which rank has the smallest number of faculty members?\nAdditional table information: table: activity_1", "answer": "SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1"} {"question": "What is the name of the county with the greatest population?\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1"} {"question": "What are the distinct location names?\nAdditional table information: table: cre_Theme_park", "answer": "SELECT DISTINCT Location_Name FROM LOCATIONS"} {"question": "For each city, how many branches opened before 2010?\nAdditional table information: table: shop_membership", "answer": "SELECT city, COUNT(*) FROM branch WHERE open_year < 2010 GROUP BY city"} {"question": "What are the names of ships that have more than one captain?\nAdditional table information: table: ship_1", "answer": "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"} {"question": "Find the type code of the most frequently used policy.\nAdditional table information: table: insurance_and_eClaims", "answer": "SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What is the membership level with the most people?\nAdditional table information: table: shop_membership", "answer": "SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the different types of forms?\nAdditional table information: table: e_government", "answer": "SELECT DISTINCT form_type_code FROM forms"} {"question": "Find the number of tweets in record.\nAdditional table information: table: twitter_1", "answer": "SELECT COUNT(*) FROM tweets"} {"question": "What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?\nAdditional table information: table: local_govt_mdm", "answer": "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'"} {"question": "Show each school name, its budgeted amount, and invested amount in year 2002 or after.\nAdditional table information: table: school_finance", "answer": "SELECT T2.school_name, T1.budgeted, T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002"} {"question": "Please show the employee last names that serves no more than 20 customers.\nAdditional table information: table: chinook_1", "answer": "SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20"} {"question": "Show the season, the player, and the name of the team that players belong to.\nAdditional table information: table: match_season", "answer": "SELECT T1.Season, T1.Player, T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id"} {"question": "How many customers live in Prague city?\nAdditional table information: table: store_1", "answer": "SELECT COUNT(*) FROM customers WHERE city = 'Prague'"} {"question": "What is the height of the mountain climbined by the climbing who had the most points?\nAdditional table information: table: climbing", "answer": "SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1"} {"question": "Find the name of companies that do not make DVD drive.\nAdditional table information: table: manufactory_1", "answer": "SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T1.name = 'DVD drive'"} {"question": "What are the names of countries that have both players with position forward and players with position defender?\nAdditional table information: table: match_season", "answer": "SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Forward' INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = 'Defender'"} {"question": "What is the total number of points for all players?\nAdditional table information: table: sports_competition", "answer": "SELECT SUM(Points) FROM player"} {"question": "Find the names and number of works of the three artists who have produced the most songs.\nAdditional table information: table: music_1", "answer": "SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3"} {"question": "For each company, return the company name and the name of the building its office is located in.\nAdditional table information: table: company_office", "answer": "SELECT T3.name, T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id"} {"question": "What is the name of the customer with the worst credit score?\nAdditional table information: table: loan_1", "answer": "SELECT cust_name FROM customer ORDER BY credit_score NULLS FIRST LIMIT 1"} {"question": "How many addresses have zip code 197?\nAdditional table information: table: behavior_monitoring", "answer": "SELECT COUNT(*) FROM ADDRESSES WHERE zip_postcode = '197'"} {"question": "List the order dates of all the bookings.\nAdditional table information: table: cre_Drama_Workshop_Groups", "answer": "SELECT Order_Date FROM BOOKINGS"} {"question": "How many distinct hometowns did these people have?\nAdditional table information: table: gymnast", "answer": "SELECT COUNT(DISTINCT Hometown) FROM people"} {"question": "What are the names of all females who are friends with Zach?\nAdditional table information: table: network_2", "answer": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'"} {"question": "For each delegate, find the names of the party they are part of.\nAdditional table information: table: election", "answer": "SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID"} {"question": "Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.\nAdditional table information: table: cinema", "answer": "SELECT AVG(capacity), MIN(capacity), MAX(capacity) FROM cinema WHERE openning_year >= 2011"} {"question": "What is the id of every employee who has at least a salary of 100000?\nAdditional table information: table: flight_1", "answer": "SELECT eid FROM Employee WHERE salary > 100000"} {"question": "Count the number of distinct delegates who are from counties with population above 50000.\nAdditional table information: table: election", "answer": "SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000"} {"question": "How many churches have a wedding in year 2016?\nAdditional table information: table: wedding", "answer": "SELECT COUNT(DISTINCT church_id) FROM wedding WHERE YEAR = 2016"} {"question": "Which countries has the most number of airlines?\nAdditional table information: table: flight_4", "answer": "SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Count the number of accounts.\nAdditional table information: table: small_bank_1", "answer": "SELECT COUNT(*) FROM accounts"} {"question": "Give me the payment Id, the date and the amount for all the payments processed with Visa.\nAdditional table information: table: insurance_policies", "answer": "SELECT Payment_ID, Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'"} {"question": "What is the average credit score for customers who have taken a loan?\nAdditional table information: table: loan_1", "answer": "SELECT AVG(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)"} {"question": "What is the address content of the customer named 'Maudie Kertzmann'?\nAdditional table information: table: customers_and_addresses", "answer": "SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = 'Maudie Kertzmann'"} {"question": "What are the names of musicals who have no actors?\nAdditional table information: table: musical", "answer": "SELECT Name FROM musical WHERE NOT Musical_ID IN (SELECT Musical_ID FROM actor)"} {"question": "How many professors teach a class with the code ACCT-211?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = 'ACCT-211'"} {"question": "How many females are in the network?\nAdditional table information: table: network_2", "answer": "SELECT COUNT(*) FROM Person WHERE gender = 'female'"} {"question": "What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.\nAdditional table information: table: mountain_photos", "answer": "SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*) NULLS FIRST"} {"question": "What is the starting year of the oldest technicians?\nAdditional table information: table: machine_repair", "answer": "SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1"} {"question": "What is the code of the school where the accounting department belongs to?\nAdditional table information: table: college_1", "answer": "SELECT school_code FROM department WHERE dept_name = 'Accounting'"} {"question": "How many distinct characteristic names does the product 'cumin' have?\nAdditional table information: table: products_gen_characteristics", "answer": "SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'sesame'"} {"question": "What is the number of distinct teams that suffer elimination?\nAdditional table information: table: wrestler", "answer": "SELECT COUNT(DISTINCT team) FROM elimination"} {"question": "What are the codes of the locations with at least three documents?\nAdditional table information: table: cre_Doc_Tracking_DB", "answer": "SELECT location_code FROM Document_locations GROUP BY location_code HAVING COUNT(*) >= 3"} {"question": "Which building has most faculty members?\nAdditional table information: table: activity_1", "answer": "SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the first names of professors who are teaching more than one class.\nAdditional table information: table: college_1", "answer": "SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING COUNT(*) > 1"} {"question": "Show party names and the number of events for each party.\nAdditional table information: table: party_people", "answer": "SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id"} {"question": "Count the number of different account types.\nAdditional table information: table: loan_1", "answer": "SELECT COUNT(DISTINCT acc_type) FROM customer"} {"question": "How many days had both mean humidity above 50 and mean visibility above 8?\nAdditional table information: table: bike_1", "answer": "SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8"} {"question": "What are the type codes and descriptions of each budget type?\nAdditional table information: table: cre_Docs_and_Epenses", "answer": "SELECT budget_type_code, budget_type_description FROM Ref_budget_codes"} {"question": "What is the name of the youngest male?\nAdditional table information: table: network_2", "answer": "SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male')"} {"question": "Find the minimum salary for the departments whose average salary is above the average payment of all instructors.\nAdditional table information: table: college_2", "answer": "SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor)"} {"question": "Return the hosts of competitions for which the theme is not Aliens?\nAdditional table information: table: farm", "answer": "SELECT Hosts FROM farm_competition WHERE Theme <> 'Aliens'"} {"question": "What is the location of the perpetrator with the largest kills.\nAdditional table information: table: perpetrator", "answer": "SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1"} {"question": "when is the hire date for those employees whose first name does not containing the letter M?\nAdditional table information: table: hr_1", "answer": "SELECT hire_date FROM employees WHERE NOT first_name LIKE '%M%'"} {"question": "Find all the players' first name and last name who have empty death record.\nAdditional table information: table: baseball_1", "answer": "SELECT name_first, name_last FROM player WHERE death_year = ''"} {"question": "What is the average number of working horses of farms with more than 5000 total number of horses?\nAdditional table information: table: farm", "answer": "SELECT AVG(Working_Horses) FROM farm WHERE Total_Horses > 5000"} {"question": "Show the names of members and the dates of performances they attended in descending order of attendance of the performances.\nAdditional table information: table: performance_attendance", "answer": "SELECT T2.Name, T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T3.Attendance DESC"} {"question": "What are the maximum price and score of wines for each year?\nAdditional table information: table: wine_1", "answer": "SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR"} {"question": "Show the number of card types.\nAdditional table information: table: customers_card_transactions", "answer": "SELECT COUNT(DISTINCT card_type_code) FROM Customers_Cards"} {"question": "How many airports' names have the word Interanation in them?\nAdditional table information: table: flight_4", "answer": "SELECT COUNT(*) FROM airports WHERE name LIKE '%International%'"} {"question": "What is the average and maximum damage in millions for storms that had a max speed over 1000?\nAdditional table information: table: storm_record", "answer": "SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000"} {"question": "Find the average order quantity per order.\nAdditional table information: table: customers_and_addresses", "answer": "SELECT AVG(order_quantity) FROM order_items"} {"question": "Return the names of cities, ordered alphabetically.\nAdditional table information: table: county_public_safety", "answer": "SELECT Name FROM city ORDER BY Name ASC NULLS FIRST"} {"question": "List the distinct positions of pilots older than 30.\nAdditional table information: table: pilot_record", "answer": "SELECT DISTINCT POSITION FROM pilot WHERE Age > 30"} {"question": "Find the personal name, family name, and author ID of the course author that teaches the most courses.\nAdditional table information: table: e_learning", "answer": "SELECT T1.personal_name, T1.family_name, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "Find the average access counts of documents with functional area 'Acknowledgement'.\nAdditional table information: table: document_management", "answer": "SELECT AVG(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = 'Acknowledgement'"} {"question": "Which patients made more than one appointment? Tell me the name and phone number of these patients.\nAdditional table information: table: hospital_1", "answer": "SELECT name, phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING COUNT(*) > 1"} {"question": "How many departments are in each school?\nAdditional table information: table: college_1", "answer": "SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code"} {"question": "How old is the doctor named Zach?\nAdditional table information: table: network_2", "answer": "SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'"} {"question": "Give the names and locations of all wrestlers.\nAdditional table information: table: wrestler", "answer": "SELECT Name, LOCATION FROM wrestler"} {"question": "What is the total revenue of companies started by founder?\nAdditional table information: table: manufactory_1", "answer": "SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder"} {"question": "What is the average enrollment of schools?\nAdditional table information: table: school_player", "answer": "SELECT AVG(Enrollment) FROM school"} {"question": "What is the id, name and IATA code of the airport that had most number of flights?\nAdditional table information: table: flight_company", "answer": "SELECT T1.id, T1.name, T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1"} {"question": "What are the subject ID, subject name, and the number of available courses for each subject?\nAdditional table information: table: e_learning", "answer": "SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id"} {"question": "What are the names and addressed of customers who have both New and Pending orders?\nAdditional table information: table: department_store", "answer": "SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'New' INTERSECT SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Pending'"} {"question": "What are all distinct country for artists?\nAdditional table information: table: theme_gallery", "answer": "SELECT DISTINCT country FROM artist"} {"question": "What are the names of all the players who received a yes during tryouts, and also what are the names of their colleges?\nAdditional table information: table: soccer_2", "answer": "SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'"} {"question": "How many courses does the student with id 171 actually attend?\nAdditional table information: table: student_assessment", "answer": "SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171"} {"question": "What are the publishers who have published a book in both 1989 and 1990?\nAdditional table information: table: culture_company", "answer": "SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990"} {"question": "What nurses are on call with block floor 1 and block code 1? Tell me their names.\nAdditional table information: table: hospital_1", "answer": "SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1"}