niryuu/sni-each-converted huggingface dataset:
Step 1: For each row in races table, find corresponding rows in circuits table and in constructorStandings table.
Step 2: find positionText, country of the results of step 1 whose time equals Chinese Grand Prix and country not equals Australian Grand Prix
Output: SELECT T3.positionText , T1.country FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId AND T1.circuitId = T2.circuitId JOIN constructorStandings AS T3 ON T2.raceId = T3.raceId WHERE T2.time = "Chinese Grand Prix" AND T1.country ! = "Australian Grand Prix"
find the name, Location, Product of enzyme table for which name contains inhibitor
Output: SELECT name , Location , Product FROM enzyme WHERE name LIKE "inhibitor"
find the Enrollment, School of university table with largest value of Enrollment
Output: SELECT Enrollment , School FROM university ORDER BY Enrollment Desc LIMIT 1
Step 1: find the name of instructor table.
Step 2: find the name of instructor table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT name FROM instructor EXCEPT SELECT name FROM instructor
Step 1: find the student_id of Student_Course_Attendance table.
Step 2: find the student_details of Students table whose Students's student_id not one of the results of step 1
Output: SELECT T1.student_details FROM Students AS T1 WHERE T1.student_id NOT IN ( SELECT T2.student_id FROM Student_Course_Attendance AS T2 )
find each value of qualifyId in qualifying table along with the number of the corresponding rows to each value
Output: SELECT qualifyId , Count ( * ) FROM qualifying GROUP BY qualifyId
find the country of circuits table for which circuitRef equals or between 2014 and 2017
Output: SELECT country FROM circuits WHERE circuitRef BETWEEN 2017 AND 2014
find each value of driverRef in drivers table along with the number of the corresponding rows to each value
Output: SELECT driverRef , Count ( * ) FROM drivers GROUP BY driverRef
find the country of circuits table with largest value of lat
Output: SELECT country FROM circuits ORDER BY lat Desc LIMIT 1
Step 1: For each row in Student table, find the corresponding rows in Visits_Restaurant table.
Step 2: find the number of rows of each value of ResID in the results of step 1.
Step 3: find Fname, LName of step 1 results with largest value in the results of step 2
Output: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Visits_Restaurant AS T2 ON T1.StuID = T2.StuID GROUP BY T2.ResID ORDER BY Count ( * ) Desc LIMIT 1
find Fname, LName of Student table whose Sex equals F and Age greater than 18
Output: SELECT Fname , LName FROM Student WHERE Sex = "F" AND Age > 18
Step 1: For each row in game table, find the corresponding rows in injury_accident table.
Step 2: find Competition, stadium_id of the results of step 1 whose Injury equals Foot injury or Injury equals Knee problem
Output: SELECT T1.Competition , T1.stadium_id FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.Injury = "Knee problem" OR T2.Injury = "Foot injury"
Step 1: For each row in phone table, find the corresponding rows in phone_market table.
Step 2: find without repetition Carrier of the results of step 1 whose Num_of_stock greater than 32
Output: SELECT DISTINCT T1.Carrier FROM phone AS T1 JOIN phone_market AS T2 ON T1.Phone_ID = T2.Phone_ID WHERE T2.Num_of_stock > 32
find course_id of takes table whose year equals 2010 and semester equals Spring
Output: SELECT course_id FROM takes WHERE year = 2010 AND semester = "Spring"
find the role_code of Employees table for which employee_name equals Koby
Output: SELECT role_code FROM Employees WHERE employee_name = "Koby"
Step 1: find the number of rows of each value of Investor in entrepreneur table.
Step 2: find Entrepreneur_ID of entrepreneur table with largest value in the results of step 1
Output: SELECT Entrepreneur_ID FROM entrepreneur GROUP BY Investor ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in section table, find the corresponding rows in takes table.
Step 2: find section's sec_id of the results of step 1 whose takes's year equals 2009.
Step 3: find the takes's course_id of takes table for which takes's year equals 2010.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.sec_id FROM section AS T1 JOIN takes AS T2 ON T1.year = T2.year WHERE T2.year = 2009 INTERSECT SELECT T2.course_id FROM takes AS T2 WHERE T2.year = 2010
find the number of rows in circuits table whose circuitRef equals Australian Grand Prix and circuitRef equals 2009
Output: SELECT Count ( * ) FROM circuits WHERE circuitRef = 2009 AND circuitRef = "Australian Grand Prix"
Step 1: find the number of rows of each value of Name in storm table.
Step 2: find Name, Max_speed of storm table with largest value in the results of step 1
Output: SELECT Name , Max_speed FROM storm GROUP BY Name ORDER BY Count ( * ) Desc LIMIT 1
find the Party of people table with largest value of Age
Output: SELECT Party FROM people ORDER BY Age Desc LIMIT 1
Step 1: For each row in phone table, find the corresponding rows in phone_market table.
Step 2: find the  Name in the results of step 1 whose Num_of_stock greater than 2000 ordered descending by Name
Output: SELECT T1.Name FROM phone AS T1 JOIN phone_market AS T2 ON T1.Phone_ID = T2.Phone_ID WHERE T2.Num_of_stock > 2000 ORDER BY T1.Name Desc
find Sponsor_name of player table whose Residence equals Brandon or Sponsor_name equals Birtle
Output: SELECT Sponsor_name FROM player WHERE Residence = "Brandon" OR Sponsor_name = "Birtle"
Step 1: find the Name of people table.
Step 2: find the Name of people table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Name FROM people EXCEPT SELECT Name FROM people
find the average transaction_amount in Financial_Transactions table
Output: SELECT Avg ( transaction_amount ) FROM Financial_Transactions
find the name, Client of Web_client_accelerator table for which Connection not equals Broadband
Output: SELECT name , Client FROM Web_client_accelerator WHERE Connection ! = "Broadband"
Step 1: For each row in department table, find the corresponding rows in student table.
Step 2: find the summation of budget of each value of student's dept_name in the results of step 1.
Step 3: find student's dept_name of step 1 results with largest value in the results of step 2
Output: SELECT T2.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name GROUP BY T2.dept_name ORDER BY Sum ( T1.budget ) Desc LIMIT 1
Step 1: For each row in Web_client_accelerator table, find the corresponding rows in accelerator_compatible_browser table.
Step 2: find Connection, name of the results of step 1 ordered descending by compatible_since_year
Output: SELECT T1.Connection , T1.name FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.accelerator_id ORDER BY T2.compatible_since_year Desc
Step 1: find the customer_id of Accounts table.
Step 2: find the number of rows in Customers_Cards table whose Customers_Cards's customer_id not one of the results of step 1
Output: SELECT Count ( * ) FROM Customers_Cards AS T1 WHERE T1.customer_id NOT IN ( SELECT T2.customer_id FROM Accounts AS T2 )
find each value of building in department table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , budget FROM department GROUP BY building
Step 1: find the Address of Customer table for which Country equals Brazil.
Step 2: For each row in Customer table, find the corresponding rows in Invoice table.
Step 3: find Address of the results of step 2 whose BillingCountry equals Germany.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.Address FROM Customer AS T1 WHERE T1.Country = "Brazil" INTERSECT SELECT T1.Address FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.BillingCountry = "Germany"
find the country of circuits table for which circuitRef equals 2017
Output: SELECT country FROM circuits WHERE circuitRef = 2017
Step 1: For each row in accelerator_compatible_browser table, find corresponding rows in Web_client_accelerator table and in browser table.
Step 2: find Web_client_accelerator's name of the results of step 1 ordered descending by market_share
Output: SELECT T1.name FROM Web_client_accelerator AS T1 JOIN browser AS T2 JOIN accelerator_compatible_browser AS T3 ON T1.id = T3.accelerator_id AND T3.browser_id = T2.id ORDER BY T2.market_share Desc
Step 1: find the Company of entrepreneur table for which Money_Requested greater than 140000.
Step 2: find the Company of entrepreneur table for which Money_Requested less than 120000.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Company FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Company FROM entrepreneur WHERE Money_Requested < 120000
Step 1: For each row in Customers table, find the corresponding rows in Customers_Cards table.
Step 2: find Customers's customer_id, customer_first_name of the results of step 1 whose card_number not equals Credit
Output: SELECT T1.customer_id , T1.customer_first_name FROM Customers AS T1 JOIN Customers_Cards AS T2 WHERE T2.card_number ! = "Credit"
Step 1: find the Name of actor table for which Character equals Tony Award.
Step 2: find the Name of actor table for which Character equals Drama Desk Award.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Name FROM actor WHERE Character = "Tony Award" INTERSECT SELECT Name FROM actor WHERE Character = "Drama Desk Award"
find the ID of instructor table
Output: SELECT ID FROM instructor
Step 1: find the number of rows of each value of dept_name in course table.
Step 2: find title, credits, dept_name in course table whose corresponding value in step 1 is greater than 1
Output: SELECT title , credits , dept_name FROM course GROUP BY dept_name HAVING Count ( * ) > 1
Step 1: find the number of rows of each value of Weight in people table.
Step 2: find Weight of people table with smallest value in the results of step 1
Output: SELECT Weight FROM people GROUP BY Weight ORDER BY Count ( * ) Asc LIMIT 1
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_id, customer_first_name, customer_last_name in Customers table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT customer_id , customer_first_name , customer_last_name FROM Customers GROUP BY customer_id HAVING Count ( * ) > = 2
Step 1: For each row in section table, find corresponding rows in course table and in takes table.
Step 2: find title of the results of step 1 whose takes's year equals 2010 and takes's semester equals Chandler
Output: SELECT T1.title FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id JOIN takes AS T3 ON T2.year = T3.year WHERE T3.year = 2010 AND T3.semester = "Chandler"
find each value of dept_name in instructor table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , dept_name FROM instructor GROUP BY dept_name
find the Membership_card of member table for which Membership_card greater than 5
Output: SELECT Membership_card FROM member WHERE Membership_card > 5
Step 1: find the number of rows of each value of name in instructor table.
Step 2: find name in instructor table whose corresponding value in step 1 is greater than 1
Output: SELECT name FROM instructor GROUP BY name HAVING Count ( * ) > 1
Step 1: For each row in Addresses table, find the corresponding rows in Documents_Mailed table.
Step 2: find address_details of the results of step 1 whose document_id equals 7
Output: SELECT T1.address_details FROM Addresses AS T1 JOIN Documents_Mailed AS T2 ON T1.address_id = T2.mailed_to_address_id WHERE T2.document_id = 7
Step 1: For each row in student table, find the corresponding rows in time_slot table.
Step 2: find name of the results of step 1 whose day equals 2010.
Step 3: find name of the results of step 1 whose day equals 2009.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.name FROM student AS T1 JOIN time_slot AS T2 WHERE T2.day = 2010 INTERSECT SELECT T1.name FROM student AS T1 JOIN time_slot AS T2 WHERE T2.day = 2009
Step 1: For each row in Candidates table, find corresponding rows in People table and in Candidate_Assessments table.
Step 2: find cell_mobile_number of the results of step 1 whose qualification equals Fail
Output: SELECT T1.cell_mobile_number FROM People AS T1 JOIN Candidates AS T2 ON T1.person_id = T2.candidate_id JOIN Candidate_Assessments AS T3 ON T2.candidate_id = T3.candidate_id WHERE T3.qualification = "Fail"
Step 1: find the Name of mountain table.
Step 2: find the Name of mountain table for which Prominence equals 5885.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Name FROM mountain EXCEPT SELECT Name FROM mountain WHERE Prominence = 5885
find the title, title, credits of course table ordered ascending by title
Output: SELECT title , title , credits FROM course ORDER BY title Asc
find the number of rows in musical table
Output: SELECT Count ( * ) FROM musical
Step 1: For each row in instructor table, find the corresponding rows in teaches table.
Step 2: find the  name in the results of step 1 whose year equals 2008 ordered ascending by name
Output: SELECT T1.name , T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T2.year = 2008 ORDER BY T1.name Asc
find the number of rows in race table
Output: SELECT Count ( * ) FROM race
find the name of student table
Output: SELECT name FROM student
find the candidate_id of Candidates table for which candidate_details equals stanley.monahan@example.org
Output: SELECT candidate_id FROM Candidates WHERE candidate_details = "stanley.monahan@example.org"
find the id, name, Porphyria of enzyme table ordered descending by name
Output: SELECT id , name , Porphyria FROM enzyme ORDER BY name Desc
find the Name, Date of race table
Output: SELECT Name , Date FROM race
find the name of instructor table
Output: SELECT name FROM instructor
Step 1: For each row in storm table, find the corresponding rows in affected_region table.
Step 2: find the number of rows of each value of affected_region's Storm_ID in the results of step 1.
Step 3: find Name in the results of step 1 whose corresponding value in step 2 is greater than or equals 10
Output: SELECT T1.Name FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T2.Storm_ID HAVING Count ( * ) > = 10
find the Name of actor table ordered descending by age
Output: SELECT Name FROM actor ORDER BY age Desc
find the Primary_conference of university table with smallest value of Enrollment
Output: SELECT Primary_conference FROM university ORDER BY Enrollment Asc LIMIT 1
Step 1: For each row in people table, find the corresponding rows in entrepreneur table.
Step 2: find Company of the results of step 1 with largest value of Weight
Output: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight Desc LIMIT 1
find the source_system_code, master_customer_id of CMI_Cross_References table
Output: SELECT source_system_code , master_customer_id FROM CMI_Cross_References
find the customer_first_name, customer_last_name of Customers table
Output: SELECT customer_first_name , customer_last_name FROM Customers
find the name of instructor table with smallest value of salary
Output: SELECT name FROM instructor ORDER BY salary Asc LIMIT 1
Step 1: For each row in constructorStandings table, find the corresponding rows in results table.
Step 2: find constructorStandings's positionText of the results of step 1 whose constructorStandings's position equals 1 and milliseconds greater than 1
Output: SELECT T1.positionText FROM constructorStandings AS T1 JOIN results AS T2 WHERE T1.position = 1 AND T2.milliseconds > 1
find the title of course table for which dept_name equals International Finance
Output: SELECT title FROM course WHERE dept_name = "International Finance"
Step 1: For each row in Ref_Shipping_Agents table, find the corresponding rows in Documents table.
Step 2: find document_id, document_type_code of the results of step 1 whose shipping_agent_name equals done.
Step 3: find document_id, document_type_code of the results of step 1 whose shipping_agent_name equals USPS.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T2.document_id , T2.document_type_code FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T1.shipping_agent_code = T2.shipping_agent_code WHERE T1.shipping_agent_name = "done" INTERSECT SELECT T2.document_id , T2.document_type_code FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T1.shipping_agent_code = T2.shipping_agent_code WHERE T1.shipping_agent_name = "USPS"
find country of circuits table whose lat greater than 2000 and circuitRef equals Spain
Output: SELECT country FROM circuits WHERE lat > 2000 AND circuitRef = "Spain"
Step 1: find the number of rows of each value of Name in storm table.
Step 2: find Name, Dates_active, Number_Deaths in storm table whose corresponding value in step 1 is greater than or equals 1
Output: SELECT Name , Dates_active , Number_Deaths FROM storm GROUP BY Name HAVING Count ( * ) > = 1
find the number of different source_system_code in CMI_Cross_References table whose source_system_code equals Rent
Output: SELECT Count ( DISTINCT source_system_code ) FROM CMI_Cross_References WHERE source_system_code = "Rent"
Step 1: find the number of rows of each value of year in takes table.
Step 2: find year of takes table with largest value in the results of step 1
Output: SELECT year FROM takes GROUP BY year ORDER BY Count ( * ) Desc LIMIT 1
find each value of name in enzyme table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , name FROM enzyme GROUP BY name
Step 1: For each row in section table, find the corresponding rows in takes table.
Step 2: find the number of rows of each value of takes's semester in the results of step 1.
Step 3: find takes's semester, section's year of step 1 results with smallest value in the results of step 2
Output: SELECT T2.semester , T1.year FROM section AS T1 JOIN takes AS T2 ON T1.year = T2.year GROUP BY T2.semester ORDER BY Count ( * ) Asc LIMIT 1
Step 1: find the average budget in department table.
Step 2: For each row in department table, find the corresponding rows in instructor table.
Step 3: find department's dept_name, instructor's dept_name in the results of step 2 whose budget greater than the results of step 1
Output: SELECT T1.dept_name , T2.dept_name FROM department AS T1 JOIN instructor AS T2 ON T1.dept_name = T2.dept_name WHERE T1.budget > ( SELECT Avg ( T1.budget ) FROM department AS T1 )
Step 1: find the number of rows of each value of stadium_id in game table.
Step 2: find id, Score, Date in game table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT id , Score , Date FROM game GROUP BY stadium_id HAVING Count ( * ) > = 2
Step 1: For each row in university table, find the corresponding rows in basketball_match table.
Step 2: find Team_Name, Founded of the results of step 1 with largest value of Founded
Output: SELECT T1.Team_Name , T2.Founded FROM basketball_match AS T1 JOIN university AS T2 ON T1.School_ID = T2.School_ID ORDER BY T2.Founded Desc LIMIT 1
find the number of rows in classroom table
Output: SELECT Count ( * ) FROM classroom
find course_id of Student_Course_Attendance table whose student_id equals 121 or student_id equals 121
Output: SELECT course_id FROM Student_Course_Attendance WHERE student_id = 121 OR student_id = 121
Step 1: find the number of rows of each value of id in medicine table.
Step 2: find name in medicine table whose corresponding value in step 1 is greater than 2
Output: SELECT name FROM medicine GROUP BY id HAVING Count ( * ) > 2
Step 1: find the number of rows of each value of student_id in Student_Course_Attendance table.
Step 2: find student_id of Student_Course_Attendance table with smallest value in the results of step 1
Output: SELECT student_id FROM Student_Course_Attendance GROUP BY student_id ORDER BY Count ( * ) Asc LIMIT 1
Step 1: find the number of rows of each value of EmployeeId in Employee table.
Step 2: find FirstName, EmployeeId in Employee table whose corresponding value in step 1 is greater than or equals 10
Output: SELECT FirstName , EmployeeId FROM Employee GROUP BY EmployeeId HAVING Count ( * ) > = 10
Step 1: For each row in party_host table, find corresponding rows in party table and in host table.
Step 2: find Party_Theme, Location of the results of step 1 ordered ascending by Age
Output: SELECT T1.Party_Theme , T1.Location FROM party AS T1 JOIN host AS T2 JOIN party_host AS T3 ON T1.Party_ID = T3.Party_ID AND T3.Host_ID = T2.Host_ID ORDER BY T2.Age Asc
Step 1: For each row in races table, find corresponding rows in constructorStandings table and in lapTimes table.
Step 2: find positionText, name of the results of step 1 whose milliseconds less than 93000
Output: SELECT T2.positionText , T1.name FROM races AS T1 JOIN constructorStandings AS T2 ON T1.raceId = T2.raceId JOIN lapTimes AS T3 ON T1.raceId = T3.raceId WHERE T3.milliseconds < 93000
Step 1: For each row in Student_Course_Registrations table, find corresponding rows in Courses table and in Student_Course_Attendance table.
Step 2: find the number of rows of each value of Student_Course_Attendance's course_id in the results of step 1.
Step 3: find course_name of the results of step 1 with largest value in the results of step 2
Output: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Registrations AS T2 ON T1.course_id = T2.course_id JOIN Student_Course_Attendance AS T3 ON T2.course_id = T3.course_id GROUP BY T3.course_id ORDER BY Count ( * ) Desc LIMIT 1
find the account_id, customer_id, account_name, account_name of Accounts table
Output: SELECT account_id , customer_id , account_name , account_name FROM Accounts
find the number of rows in people table
Output: SELECT Count ( * ) FROM people
find the number of rows in game table whose Season greater than 2010
Output: SELECT Count ( * ) FROM game WHERE Season > 2010
find Year_Opened of track table whose Seating greater than 4000 or Seating greater than 5000
Output: SELECT Year_Opened FROM track WHERE Seating > 5000 OR Seating > 4000
find the number of rows in Type_Of_Restaurant table whose ResTypeID equals Sandwich
Output: SELECT Count ( * ) FROM Type_Of_Restaurant WHERE ResTypeID = "Sandwich"
Step 1: For each row in races table, find the corresponding rows in lapTimes table.
Step 2: find url, races's time of the results of step 1 whose milliseconds greater than 100000
Output: SELECT T1.url , T1.time FROM races AS T1 JOIN lapTimes AS T2 ON T1.raceId = T2.raceId WHERE T2.milliseconds > 100000
Step 1: For each row in department table, find corresponding rows in instructor table and in student table.
Step 2: find the summation of tot_cred of each value of instructor's name in the results of step 1.
Step 3: find instructor's name of the results of step 1 with largest value in the results of step 2
Output: SELECT T2.name FROM department AS T1 JOIN instructor AS T2 ON T2.dept_name = T1.dept_name JOIN student AS T3 ON T1.dept_name = T3.dept_name GROUP BY T2.name ORDER BY Sum ( T3.tot_cred ) Desc LIMIT 1
Step 1: For each row in section table, find the corresponding rows in takes table.
Step 2: find section's sec_id of the results of step 1 whose takes's year equals 2010 or takes's semester equals Spring
Output: SELECT T1.sec_id FROM section AS T1 JOIN takes AS T2 ON T1.year = T2.year WHERE T2.year = 2010 OR T2.semester = "Spring"
find without repetition the Name of mountain table for which Country equals West Germany
Output: SELECT DISTINCT Name FROM mountain WHERE Country = "West Germany"
find without repetition the name, Location, Product of enzyme table for which name contains inhibitor
Output: SELECT DISTINCT name , Location , Product FROM enzyme WHERE name LIKE "inhibitor"
find the summation of budget in department table whose dept_name equals Marketing
Output: SELECT Sum ( budget ) FROM department WHERE dept_name = "Marketing"
Step 1: For each row in Student table, find the corresponding rows in Visits_Restaurant table.
Step 2: find Time of the results of step 1 whose Fname equals Linda and LName equals Smith
Output: SELECT T2.Time FROM Student AS T1 JOIN Visits_Restaurant AS T2 ON T1.StuID = T2.StuID WHERE T1.Fname = "Linda" AND T1.LName = "Smith"
find the average UnitPrice in Track table
Output: SELECT Avg ( UnitPrice ) FROM Track
Step 1: find the number of rows of each value of id in medicine table.
Step 2: find id, name in medicine table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT id , name FROM medicine GROUP BY id HAVING Count ( * ) > = 2
find each value of Character in actor table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , Name FROM actor GROUP BY Character
find the Name, Date, Date of race table
Output: SELECT Name , Date , Date FROM race
Step 1: For each row in Courses table, find the corresponding rows in Student_Course_Registrations table.
Step 2: find student_id of the results of step 1 whose course_name greater than or equals statistics
Output: 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"
find the student_id of Student_Course_Registrations table ordered ascending by registration_date
Output: SELECT student_id FROM Student_Course_Registrations ORDER BY registration_date Asc
Step 1: For each row in Student_Course_Registrations table, find the corresponding rows in Student_Course_Attendance table.
Step 2: find Student_Course_Attendance's student_id of the results of step 1 with largest value of registration_date
Output: SELECT T2.student_id FROM Student_Course_Registrations AS T1 JOIN Student_Course_Attendance AS T2 ON T1.course_id = T2.course_id ORDER BY T1.registration_date Desc LIMIT 1
Step 1: For each row in races table, find corresponding rows in circuits table and in pitStops table.
Step 2: find country, lat of the results of step 1 with largest value of milliseconds
Output: SELECT T1.country , T1.lat FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId JOIN pitStops AS T3 ON T2.raceId = T3.raceId ORDER BY T3.milliseconds Desc LIMIT 1
Step 1: For each row in Student table, find the corresponding rows in Visits_Restaurant table.
Step 2: find Fname, LName of the results of step 1 whose Spent equals 600
Output: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Visits_Restaurant AS T2 ON T1.StuID = T2.StuID WHERE T2.Spent = 600
Step 1: For each row in Customers_Cards table, find the corresponding rows in Financial_Transactions table.
Step 2: find the number of rows of each value of transaction_type in the results of step 1.
Step 3: find card_type_code in the results of step 1 whose corresponding value in step 2 is greater than or equals 5
Output: SELECT T1.card_type_code FROM Customers_Cards AS T1 JOIN Financial_Transactions AS T2 ON T1.card_id = T2.card_id GROUP BY T2.transaction_type HAVING Count ( * ) > = 5
find the Location, Location of university table
Output: SELECT Location , Location FROM university
Step 1: find the number of rows of each value of cmi_cross_ref_id in CMI_Cross_References table.
Step 2: find cmi_cross_ref_id, source_system_code in CMI_Cross_References table whose corresponding value in step 1 is greater than or equals 1
Output: SELECT cmi_cross_ref_id , source_system_code FROM CMI_Cross_References GROUP BY cmi_cross_ref_id HAVING Count ( * ) > = 1
Step 1: For each row in section table, find the corresponding rows in takes table.
Step 2: find section's sec_id of the results of step 1 whose takes's year not equals 2010
Output: SELECT T1.sec_id FROM section AS T1 JOIN takes AS T2 ON T1.year = T2.year WHERE T2.year ! = 2010
Step 1: For each row in Products_Booked table, find corresponding rows in Bookings table and in Products_for_Hire table.
Step 2: find booking_start_date, booking_start_date of the results of step 1 whose product_name equals Book collection A
Output: SELECT T1.booking_start_date , T1.booking_start_date FROM Bookings AS T1 JOIN Products_for_Hire AS T2 JOIN Products_Booked AS T3 ON T1.booking_id = T3.booking_id AND T3.product_id = T2.product_id WHERE T2.product_name = "Book collection A"
Step 1: find the Chromosome of enzyme table.
Step 2: find the number of rows in enzyme table whose id not one of the results of step 1
Output: SELECT Count ( * ) FROM enzyme WHERE id NOT IN ( SELECT Chromosome FROM enzyme )
find qualifyId, constructorId of qualifying table whose number equals France or number equals Belgium
Output: SELECT qualifyId , constructorId FROM qualifying WHERE number = "Belgium" OR number = "France"
Step 1: For each row in medicine_enzyme_interaction table, find corresponding rows in medicine table and in enzyme table.
Step 2: find enzyme's name of the results of step 1 whose Porphyria equals Amisulpride and medicine's name contains inhibitor
Output: SELECT T2.name FROM medicine AS T1 JOIN enzyme AS T2 JOIN medicine_enzyme_interaction AS T3 ON T1.id = T3.medicine_id AND T3.enzyme_id = T2.id WHERE T2.Porphyria = "Amisulpride" AND T1.name LIKE "inhibitor"
find the average Max_speed and the maximum Damage_millions_USD in storm table whose Max_speed greater than 1000
Output: SELECT Avg ( Max_speed ) , Max ( Damage_millions_USD ) FROM storm WHERE Max_speed > 1000
Step 1: For each row in department table, find corresponding rows in course table and in student table.
Step 2: find name of the results of step 1 whose course's dept_name equals International Finance
Output: SELECT T3.name FROM department AS T1 JOIN course AS T2 ON T2.dept_name = T1.dept_name JOIN student AS T3 ON T1.dept_name = T3.dept_name WHERE T2.dept_name = "International Finance"
Step 1: find the medicine's id of medicine table for which FDA_approved equals No.
Step 2: find the number of rows in enzyme table whose enzyme's id not one of the results of step 1
Output: SELECT Count ( * ) FROM enzyme AS T1 WHERE T1.id NOT IN ( SELECT T2.id FROM medicine AS T2 WHERE T2.FDA_approved = "No" )
find the name of enzyme table for which Porphyria contains ALA
Output: SELECT name FROM enzyme WHERE Porphyria LIKE "ALA"
Step 1: find the ID of takes table.
Step 2: find the name of student table whose student's ID not one of the results of step 1
Output: SELECT T1.name FROM student AS T1 WHERE T1.ID NOT IN ( SELECT T2.ID FROM takes AS T2 )
Step 1: For each row in Courses table, find the corresponding rows in Student_Course_Registrations table.
Step 2: for each value of Student_Course_Registrations's course_id in the results of step 1, find the number of rows along with Courses's course_id and course_name
Output: SELECT T1.course_id , T1.course_name , Count ( * ) FROM Courses AS T1 JOIN Student_Course_Registrations AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id
find the name of races table ordered ascending by name
Output: SELECT name FROM races ORDER BY name Asc
Step 1: find the Nationality of host table for which Age less than 45.
Step 2: find the Nationality of host table for which Age greater than 35.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Nationality FROM host WHERE Age < 45 INTERSECT SELECT Nationality FROM host WHERE Age > 35
find the dept_name, building of department table ordered ascending by budget
Output: SELECT dept_name , building FROM department ORDER BY budget Asc
Step 1: For each row in section table, find corresponding rows in course table and in takes table.
Step 2: find title of the results of step 1 whose takes's year equals 2010 and building equals Chandler
Output: SELECT T1.title FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id AND T1.course_id = T2.course_id JOIN takes AS T3 ON T2.year = T3.year WHERE T3.year = 2010 AND T2.building = "Chandler"
Step 1: For each row in people table, find the corresponding rows in entrepreneur table.
Step 2: find Date_of_Birth of the results of step 1 whose Company equals Simon Woodroffe or Company equals Peter Jones
Output: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Company = "Peter Jones" OR T1.Company = "Simon Woodroffe"
Step 1: find the rows of circuits table for which circuitRef equals 2009.
Step 2: find the number of rows in circuits table whose rows not one of the results of step 1
Output: SELECT Count ( * ) FROM circuits WHERE * NOT IN ( SELECT * FROM circuits WHERE circuitRef = 2009 )
Step 1: For each row in stadium table, find the corresponding rows in game table.
Step 2: find Season of the results of step 1 whose name equals Walter Samuel
Output: SELECT T2.Season FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id WHERE T1.name = "Walter Samuel"
Step 1: For each row in people table, find the corresponding rows in debate_people table.
Step 2: find each value of Affirmative in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT T1.Name , Count ( * ) FROM people AS T1 JOIN debate_people AS T2 ON T1.People_ID = T2.Affirmative GROUP BY T2.Affirmative
find the Company of entrepreneur table for which Investor not equals Rachel Elnaugh
Output: SELECT Company FROM entrepreneur WHERE Investor ! = "Rachel Elnaugh"
find the Milliseconds, Milliseconds of Track table with smallest value of Milliseconds
Output: SELECT Milliseconds , Milliseconds FROM Track ORDER BY Milliseconds Asc LIMIT 1
Step 1: find the document_id of Documents table for which document_type_code equals done.
Step 2: find the document_id of Documents table for which document_type_code equals USPS.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT document_id FROM Documents WHERE document_type_code = "done" EXCEPT SELECT document_id FROM Documents WHERE document_type_code = "USPS"
Step 1: find the number of rows of each value of Investor in entrepreneur table.
Step 2: find Company in entrepreneur table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT Company FROM entrepreneur GROUP BY Investor HAVING Count ( * ) > = 2
find without repetition the customer_first_name, customer_last_name of Customers table
Output: SELECT DISTINCT customer_first_name , customer_last_name FROM Customers
find the Email of Customer table for which City equals NY
Output: SELECT Email FROM Customer WHERE City = "NY"
Step 1: For each row in technician table, find the corresponding rows in repair_assignment table.
Step 2: find each value of repair_assignment's technician_id in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT T1.Name , Count ( * ) FROM technician AS T1 JOIN repair_assignment AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.technician_id
Step 1: find the number of rows of each value of EmployeeId in Employee table.
Step 2: find FirstName, ReportsTo in Employee table whose corresponding value in step 1 is greater than or equals 10
Output: SELECT FirstName , ReportsTo FROM Employee GROUP BY EmployeeId HAVING Count ( * ) > = 10
find the Milliseconds, TrackId of Track table with smallest value of Milliseconds
Output: SELECT Milliseconds , TrackId FROM Track ORDER BY Milliseconds Asc LIMIT 1
find the Company of entrepreneur table
Output: SELECT Company FROM entrepreneur
Step 1: find the Invoice's CustomerId of Invoice table for which Total less than 20.
Step 2: find the LastName of Customer table whose Customer's CustomerId not one of the results of step 1
Output: SELECT T1.LastName FROM Customer AS T1 WHERE T1.CustomerId NOT IN ( SELECT T2.CustomerId FROM Invoice AS T2 WHERE T2.Total < 20 )
find the number of rows in bank table
Output: SELECT Count ( * ) FROM bank
find the Name, Max_speed of storm table with largest value of Max_speed
Output: SELECT Name , Max_speed FROM storm ORDER BY Max_speed Desc LIMIT 1
Step 1: For each row in game table, find corresponding rows in stadium table and in injury_accident table.
Step 2: find name of the results of step 1 whose Away_team equals Thiago Motta and Player equals Walter Samuel
Output: SELECT T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id AND T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id WHERE T2.Away_team = "Thiago Motta" AND T3.Player = "Walter Samuel"
find the candidate_id of Candidate_Assessments table for which qualification equals Pass
Output: SELECT candidate_id FROM Candidate_Assessments WHERE qualification = "Pass"
find each value of transaction_type in Financial_Transactions table along with the number of the corresponding rows to each value
Output: SELECT transaction_type , Count ( * ) FROM Financial_Transactions GROUP BY transaction_type
Step 1: find the course_id of prereq table.
Step 2: find the sec_id of section table whose section's course_id not one of the results of step 1
Output: SELECT T1.sec_id FROM section AS T1 WHERE T1.course_id NOT IN ( SELECT T2.course_id FROM prereq AS T2 )
Step 1: For each row in storm table, find the corresponding rows in affected_region table.
Step 2: find the number of rows of each value of affected_region's Storm_ID in the results of step 1.
Step 3: find Name in the results of step 1 whose corresponding value in step 2 is greater than or equals 2
Output: SELECT T1.Name FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T2.Storm_ID HAVING Count ( * ) > = 2
Step 1: For each row in department table, find the corresponding rows in student table.
Step 2: find each value of student's dept_name in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , T1.budget FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name GROUP BY T2.dept_name
Step 1: For each row in drivers table, find the corresponding rows in lapTimes table.
Step 2: find without repetition drivers's driverId, driverRef of the results of step 1 whose milliseconds greater than 100000
Output: SELECT DISTINCT T1.driverId , T1.driverRef FROM drivers AS T1 JOIN lapTimes AS T2 ON T1.driverId = T2.driverId WHERE T2.milliseconds > 100000
find the title of course table for which title equals Mobile Computing
Output: SELECT title FROM course WHERE title = "Mobile Computing"
Step 1: find the number of rows of each value of ArtistId in Artist table.
Step 2: find Name, ArtistId in Artist table whose corresponding value in step 1 is greater than or equals 3
Output: SELECT Name , ArtistId FROM Artist GROUP BY ArtistId HAVING Count ( * ) > = 3
Step 1: For each row in medicine_enzyme_interaction table, find corresponding rows in medicine table and in enzyme table.
Step 2: find enzyme's name, Trade_Name of the results of step 1 whose FDA_approved equals Yes
Output: SELECT T2.name , T1.Trade_Name FROM medicine AS T1 JOIN enzyme AS T2 JOIN medicine_enzyme_interaction AS T3 ON T1.id = T3.medicine_id AND T3.enzyme_id = T2.id WHERE T1.FDA_approved = "Yes"
find the Company of entrepreneur table ordered descending by Money_Requested
Output: SELECT Company FROM entrepreneur ORDER BY Money_Requested Desc
find the Starting_Year of technician table with smallest value of Age
Output: SELECT Starting_Year FROM technician ORDER BY Age Asc LIMIT 1
Step 1: find the employee_name of Employees table.
Step 2: find the employee_name of Employees table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT employee_name FROM Employees EXCEPT SELECT employee_name FROM Employees
find each value of Region_code in region table along with the number of the corresponding rows to each value
Output: SELECT Region_code , Count ( * ) FROM region GROUP BY Region_code
Step 1: find the ArtistId of Album table.
Step 2: find the Name of Artist table whose Artist's ArtistId not one of the results of step 1
Output: SELECT T1.Name FROM Artist AS T1 WHERE T1.ArtistId NOT IN ( SELECT T2.ArtistId FROM Album AS T2 )
find the shipping_agent_code of Documents table for which receipt_number equals UPS
Output: SELECT shipping_agent_code FROM Documents WHERE receipt_number = "UPS"
Step 1: find the number of rows of each value of url in races table.
Step 2: find circuitId, name of races table with smallest value in the results of step 1
Output: SELECT circuitId , name FROM races GROUP BY url ORDER BY Count ( * ) Asc LIMIT 1
Step 1: For each row in track table, find the corresponding rows in race table.
Step 2: find track's Name, Location of the results of step 1 whose Class equals 1
Output: SELECT T2.Name , T2.Location FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID WHERE T1.Class = 1
find the Player_name, Sponsor_name of player table for which Occupation not equals Researcher
Output: SELECT Player_name , Sponsor_name FROM player WHERE Occupation ! = "Researcher"
Step 1: find the number of rows of each value of id in stadium table.
Step 2: find id, name of stadium table with largest value in the results of step 1
Output: SELECT id , name FROM stadium GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in CMI_Cross_References table, find corresponding rows in Customer_Master_Index table and in Parking_Fines table.
Step 2: find council_tax_id of the results of step 1 whose cmi_details equals Schmitt-Lang.
Step 3: find council_tax_id of the results of step 1 whose cmi_details equals Schmidt ,  Kertzmann and Lubowitz.
Step 4: show the rows that are in the results of step 2 but not in the results of step 3
Output: SELECT T3.council_tax_id FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id JOIN Parking_Fines AS T3 ON T2.cmi_cross_ref_id = T3.cmi_cross_ref_id WHERE T1.cmi_details = "Schmitt-Lang" EXCEPT SELECT T3.council_tax_id FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id JOIN Parking_Fines AS T3 ON T2.cmi_cross_ref_id = T3.cmi_cross_ref_id WHERE T1.cmi_details = "Schmidt ,  Kertzmann and Lubowitz"
find the Founded of university table with largest value of Enrollment
Output: SELECT Founded FROM university ORDER BY Enrollment Desc LIMIT 1
Step 1: For each row in Roles table, find the corresponding rows in Employees table.
Step 2: for each value of Employees's role_code in the results of step 1, find the number of rows along with role_description and employee_id
Output: SELECT T1.role_description , T2.employee_id , Count ( * ) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
find the Location of perpetrator table with largest value of Injured
Output: SELECT Location FROM perpetrator ORDER BY Injured Desc LIMIT 1
find title of course table whose dept_name equals Psychology and dept_name not equals Statistics
Output: SELECT title FROM course WHERE dept_name = "Statistics" AND dept_name ! = "Psychology"
Step 1: For each row in instructor table, find the corresponding rows in advisor table.
Step 2: find i_ID of the results of step 1 whose dept_name equals History
Output: SELECT T2.i_ID FROM instructor AS T1 JOIN advisor AS T2 ON T1.ID = T2.i_ID WHERE T1.dept_name = "History"
find the Region_name of region table for which Region_code not equals Denmark
Output: SELECT Region_name FROM region WHERE Region_code ! = "Denmark"
Step 1: For each row in party table, find the corresponding rows in party_host table.
Step 2: find the number of rows of each value of party_host's Party_ID in the results of step 1.
Step 3: find Party_Theme in the results of step 1 whose corresponding value in step 2 is greater than 20
Output: SELECT T1.Party_Theme FROM party AS T1 JOIN party_host AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T2.Party_ID HAVING Count ( * ) > 20
find the School, Location of university table
Output: SELECT School , Location FROM university
find the number of rows in Customers table whose customer_first_name equals Blanche and customer_last_name equals Huels
Output: SELECT Count ( * ) FROM Customers WHERE customer_first_name = "Blanche" AND customer_last_name = "Huels"
find the number of different Advisor in Student table
Output: SELECT Count ( DISTINCT Advisor ) FROM Student
Step 1: For each row in people table, find the corresponding rows in perpetrator table.
Step 2: find Height of the results of step 1 ordered descending by Killed
Output: SELECT T2.Height FROM perpetrator AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Killed Desc
Step 1: find the sec_id of section table.
Step 2: find the course_id of takes table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT T1.sec_id FROM section AS T1 EXCEPT SELECT T2.course_id FROM takes AS T2
find the number of rows in university table whose Location equals NY
Output: SELECT Count ( * ) FROM university WHERE Location = "NY"
find the name of instructor table for which dept_name equals Math ordered ascending by salary
Output: SELECT name FROM instructor WHERE dept_name = "Math" ORDER BY salary Asc
find each value of card_type_code in Customers_Cards table along with the number of the corresponding rows to each value
Output: SELECT card_type_code , Count ( * ) FROM Customers_Cards GROUP BY card_type_code
Step 1: For each row in Accounts table, find the corresponding rows in Customers table.
Step 2: find the number of rows of each value of Accounts's customer_id in the results of step 1.
Step 3: find Accounts's customer_id, customer_first_name, customer_last_name of step 1 results with smallest value in the results of step 2
Output: SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 GROUP BY T1.customer_id ORDER BY Count ( * ) Asc LIMIT 1
Step 1: For each row in people table, find the corresponding rows in perpetrator table.
Step 2: find Name of the results of step 1 whose Country equals China or Location equals Japan
Output: SELECT T2.Name FROM perpetrator AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Country = "China" OR T1.Location = "Japan"
find country of circuits table whose lat greater than 2000 and circuitRef greater than Spain
Output: SELECT country FROM circuits WHERE lat > 2000 AND circuitRef > "Spain"
Step 1: find the Name of actor table.
Step 2: find the Name of actor table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Name FROM actor EXCEPT SELECT Name FROM actor
Step 1: For each row in classroom table, find the corresponding rows in time_slot table.
Step 2: find the number of rows in the results of step 1 whose end_hr greater than 50 and building equals Alumni
Output: SELECT Count ( * ) FROM classroom AS T1 JOIN time_slot AS T2 WHERE T2.end_hr > 50 AND T1.building = "Alumni"
Step 1: For each row in enzyme table, find the corresponding rows in medicine_enzyme_interaction table.
Step 2: find Product, Chromosome, interaction_type of the results of step 1 whose Location equals Cytosol
Output: SELECT T1.Product , T1.Chromosome , T2.interaction_type FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T1.Location = "Cytosol"
find the title of course table for which dept_name equals Mobile Computing
Output: SELECT title FROM course WHERE dept_name = "Mobile Computing"
find each value of student_id in Student_Course_Attendance table along with the number of the corresponding rows to each value
Output: SELECT student_id , Count ( * ) FROM Student_Course_Attendance GROUP BY student_id
find the Name of storm table for which Dates_active equals Denmark
Output: SELECT Name FROM storm WHERE Dates_active = "Denmark"
find the source_system_code, cmi_cross_ref_id of CMI_Cross_References table ordered ascending by source_system_code
Output: SELECT source_system_code , cmi_cross_ref_id FROM CMI_Cross_References ORDER BY source_system_code Asc
Step 1: For each row in Customers_Cards table, find the corresponding rows in Financial_Transactions table.
Step 2: find the number of rows of each value of transaction_type in the results of step 1.
Step 3: find card_type_code of step 1 results with largest value in the results of step 2
Output: SELECT T1.card_type_code FROM Customers_Cards AS T1 JOIN Financial_Transactions AS T2 ON T1.card_id = T2.card_id GROUP BY T2.transaction_type ORDER BY Count ( * ) Desc LIMIT 1