niryuu/sni-each-converted huggingface dataset:
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of bathroom_count in the results of step 1 whose apt_number equals Columbus Square and building_short_name contains Normandie Court
Output: SELECT Sum ( T2.bathroom_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.apt_number = "Columbus Square" AND T1.building_short_name LIKE "Normandie Court"
find the number of rows in faculty table whose Year equals 2004
Output: SELECT Count ( * ) FROM faculty WHERE Year = 2004
find the average CampusFee in csu_fees table
Output: SELECT Avg ( CampusFee ) FROM csu_fees
Step 1: For each row in screen_mode table, find the corresponding rows in phone table.
Step 2: find Hardware_Model_name of the results of step 1 whose screen_mode equals Graphics and Type equals Nokia Corporation
Output: SELECT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.screen_mode = "Graphics" AND T1.Type = "Nokia Corporation"
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find name of the results of step 1 whose stars equals 2.
Step 3: For each row in Movie table, find the corresponding rows in Rating table.
Step 4: find director of the results of step 3 whose stars equals 5.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T1.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = 2 INTERSECT SELECT T3.director FROM Movie AS T3 JOIN Rating AS T2 ON T3.mID = T2.mID WHERE T2.stars = 5
Step 1: find the number of rows of each value of teacher_id in Teachers table.
Step 2: find teacher_id, first_name of Teachers table ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT teacher_id , first_name FROM Teachers GROUP BY teacher_id ORDER BY Count ( * ) Desc LIMIT 3
find the nickname of Staff table for which first_name equals Janessa
Output: SELECT nickname FROM Staff WHERE first_name = "Janessa"
Step 1: find the Rating's mID of Rating table for which stars equals 2.
Step 2: find the title of Movie table whose Movie's mID not one of the results of step 1
Output: SELECT T1.title FROM Movie AS T1 WHERE T1.mID NOT IN ( SELECT T2.mID FROM Rating AS T2 WHERE T2.stars = 2 )
find the number of rows in faculty table whose Year equals 2002 and Year equals 2002
Output: SELECT Count ( * ) FROM faculty WHERE Year = 2002 AND Year = 2002
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of bathroom_count in the results of step 1 whose building_full_name contains Columbus Square
Output: SELECT Sum ( T2.bathroom_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_full_name LIKE "Columbus Square"
find the average monthly_rental and the average monthly_rental in Student_Addresses table
Output: SELECT Avg ( monthly_rental ) , Avg ( monthly_rental ) FROM Student_Addresses
find the number of different Birth_Date in people table
Output: SELECT Count ( DISTINCT Birth_Date ) FROM people
Step 1: For each row in Orders table, find the corresponding rows in Invoices table.
Step 2: find date_order_placed, Invoices's order_id, order_details of the results of step 1
Output: SELECT T1.date_order_placed , T2.order_id , T1.order_details FROM Orders AS T1 JOIN Invoices AS T2 ON T1.order_id = T2.order_id
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the summation of bathroom_count in the results of step 1 whose building_manager equals Columbus Square and building_short_name equals Normandie Court
Output: SELECT Sum ( T2.bathroom_count ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Columbus Square" AND T1.building_short_name = "Normandie Court"
Step 1: find the customer_id of Lessons table.
Step 2: find the number of rows in Customers table whose Customers's customer_id not one of the results of step 1
Output: SELECT Count ( * ) FROM Customers AS T1 WHERE T1.customer_id NOT IN ( SELECT T2.customer_id FROM Lessons AS T2 )
Step 1: For each row in Campuses table, find the corresponding rows in csu_fees table.
Step 2: find CampusFee of the results of step 1 whose Campuses's Campus equals San Francisco State University and csu_fees's Year equals 2000 and csu_fees's Year equals 1996
Output: SELECT T2.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 AND T2.Year = 2000
Step 1: For each row in Product_Categories table, find the corresponding rows in Products table.
Step 2: find each value of parent_product_id in the results of step 1 along with the summation of vat_rating of the corresponding rows to each value
Output: SELECT T2.parent_product_id , Sum ( T1.vat_rating ) FROM Product_Categories AS T1 JOIN Products AS T2 ON T1.production_type_code = T2.production_type_code GROUP BY T2.parent_product_id
find the summation of room_count in Apartments table whose apt_number contains Columbus Square
Output: SELECT Sum ( room_count ) FROM Apartments WHERE apt_number LIKE "Columbus Square"
Step 1: find the number of rows of each value of director in Movie table.
Step 2: find title, title in Movie table whose corresponding value in step 1 is greater than 1
Output: SELECT title , title FROM Movie GROUP BY director HAVING Count ( * ) > 1
Step 1: For each row in Campuses table, find the corresponding rows in faculty table.
Step 2: find Campuses's Campus of the results of step 1 whose County equals Los Angeles and faculty's Year less than 1950 and faculty's Year greater than 2002
Output: SELECT T1.Campus FROM Campuses AS T1 JOIN faculty AS T2 ON T1.Id = T2.Campus WHERE T1.County = "Los Angeles" AND T2.Year < 2002 AND T2.Year > 1950
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find name of the results of step 1 whose stars equals 2.
Step 3: find name, stars of the results of step 1 whose stars equals 5.
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 Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = 2 INTERSECT SELECT T1.name , T2.stars FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = 5
find the District_name of district table for which Headquartered_City equals Khanewal District
Output: SELECT District_name FROM district WHERE Headquartered_City = "Khanewal District"
find the number of rows in Apartment_Buildings table whose building_full_name equals Columbus Square and building_short_name equals Normandie Court
Output: SELECT Count ( * ) FROM Apartment_Buildings WHERE building_full_name = "Columbus Square" AND building_short_name = "Normandie Court"
Step 1: For each row in Apartment_Buildings table, find the corresponding rows in Apartments table.
Step 2: find the number of rows in the results of step 1 whose apt_number equals Columbus Square and building_short_name equals Normandie Court
Output: SELECT Count ( * ) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.apt_number = "Columbus Square" AND T1.building_short_name = "Normandie Court"
Step 1: for each value of apt_type_code in Apartments table, calculate number of rows.
Step 2: show each value of apt_type_code in Apartments table along with the corresponding summation of bathroom_count with largest value in the results of step 1
Output: SELECT apt_type_code , Sum ( bathroom_count ) FROM Apartments GROUP BY apt_type_code ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find name of the results of step 1 with smallest value of stars
Output: SELECT T1.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID ORDER BY T2.stars Asc LIMIT 1
Step 1: For each row in Reviewer table, find the corresponding rows in Rating table.
Step 2: find name of the results of step 1 whose stars equals 5
Output: SELECT T1.name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE T2.stars = 5
find the Headquartered_City of district table with smallest value of City_Area
Output: SELECT Headquartered_City FROM district ORDER BY City_Area Asc LIMIT 1
find the number of rows in Breeds table
Output: SELECT Count ( * ) FROM Breeds
Step 1: find the number of rows of each value of grade in Highschooler table.
Step 2: find name of Highschooler table with largest value in the results of step 1
Output: SELECT name FROM Highschooler GROUP BY grade ORDER BY Count ( * ) Desc LIMIT 1
find the Name, Country of singer table for which Name contains Hey
Output: SELECT Name , Country FROM singer WHERE Name LIKE "Hey"
find the Name, Population, Continent of country table with largest value of SurfaceArea
Output: SELECT Name , Population , Continent FROM country ORDER BY SurfaceArea Desc LIMIT 1
find the number of rows in Ref_Template_Types table
Output: SELECT Count ( * ) FROM Ref_Template_Types
find Title of Cartoon table whose Written_by equals Ben Jones and Directed_by equals Ben Jones
Output: SELECT Title FROM Cartoon WHERE Written_by = "Ben Jones" AND Directed_by = "Ben Jones"
find the Type of performance table ordered descending by Share
Output: SELECT Type FROM performance ORDER BY Share Desc
Step 1: find the Continent of country table.
Step 2: For each row in country table, find the corresponding rows in countrylanguage table.
Step 3: find Continent of the results of step 2 whose Language equals English.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.Continent FROM country AS T1 EXCEPT SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English"
Step 1: For each row in airports table, find the corresponding rows in flights table.
Step 2: find FlightNo of the results of step 1 whose AirportName equals APG
Output: SELECT T2.FlightNo FROM airports AS T1 JOIN flights AS T2 ON T1.AirportCode = T2.SourceAirport WHERE T1.AirportName = "APG"
Step 1: find the number of rows of each value of department_id in Departments table.
Step 2: find department_name, department_id of Departments table with largest value in the results of step 1
Output: SELECT department_name , department_id FROM Departments GROUP BY department_id ORDER BY Count ( * ) Desc LIMIT 1
find the number of rows in airports table whose City equals Aberdeen
Output: SELECT Count ( * ) FROM airports WHERE City = "Aberdeen"
Step 1: For each row in Charges table, find the corresponding rows in Treatment_Types table.
Step 2: find treatment_type_code, charge_amount of the results of step 1
Output: SELECT T2.treatment_type_code , T1.charge_amount FROM Charges AS T1 JOIN Treatment_Types AS T2
find the Maker of car_makers table
Output: SELECT Maker FROM car_makers
Step 1: For each row in players table, find the corresponding rows in matches table.
Step 2: find winner_name, last_name of the results of step 1 with smallest value of winner_name
Output: SELECT T2.winner_name , T1.last_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.loser_id ORDER BY T2.winner_name Asc LIMIT 1
Step 1: For each row in TV_Channel table, find the corresponding rows in Cartoon table.
Step 2: find Country of the results of step 1 whose Written_by equals Todd Casey and Directed_by equals Ben Jones
Output: SELECT T1.Country FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Written_by = "Todd Casey" AND T2.Directed_by = "Ben Jones"
find the number of rows in Cartoon table whose Written_by equals Joseph Kuhr and Directed_by equals Ben Jones
Output: SELECT Count ( * ) FROM Cartoon WHERE Written_by = "Joseph Kuhr" AND Directed_by = "Ben Jones"
find the number of rows in course table
Output: SELECT Count ( * ) FROM course
Step 1: find the number of rows of each value of Channel in Cartoon table.
Step 2: find Title, Channel of Cartoon table with largest value in the results of step 1
Output: SELECT Title , Channel FROM Cartoon GROUP BY Channel ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the number of rows of each value of Airline in airlines table.
Step 2: find Airline in airlines table whose corresponding value in step 1 is greater than or equals 200
Output: SELECT Airline FROM airlines GROUP BY Airline HAVING Count ( * ) > = 200
find Continent of country table whose LocalName equals Dutch or LocalName equals T
Output: SELECT Continent FROM country WHERE LocalName = "T" OR LocalName = "Dutch"
Step 1: find the Citizenship of singer table for which Birth_Year greater than 1945.
Step 2: find the Citizenship of singer table for which Birth_Year less than 1955.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Citizenship FROM singer WHERE Birth_Year > 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year < 1955
find the number of rows in continents table
Output: SELECT Count ( * ) FROM continents
find the Document_ID, Template_ID of Documents table for which Document_Name equals Welcome to NY
Output: SELECT Document_ID , Template_ID FROM Documents WHERE Document_Name = "Welcome to NY"
find the Population, GNPOld of country table for which Continent equals Brazil
Output: SELECT Population , GNPOld FROM country WHERE Continent = "Brazil"
Step 1: find the number of rows of each value of Code2 in country table.
Step 2: find Code2 of country table with largest value in the results of step 1
Output: SELECT Code2 FROM country GROUP BY Code2 ORDER BY Count ( * ) Desc LIMIT 1
find the number of rows in Dogs table whose weight equals 7.57
Output: SELECT Count ( * ) FROM Dogs WHERE weight = 7.57
Step 1: For each row in ship table, find corresponding rows in battle table and in death table.
Step 2: find note of the results of step 1 whose date contains East
Output: SELECT T3.note FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle JOIN death AS T3 ON T2.id = T3.caused_by_ship_id WHERE T1.date LIKE "East"
Step 1: find the Name of employee table.
Step 2: find the Name of employee 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 employee EXCEPT SELECT Name FROM employee
Step 1: For each row in Owners table, find the corresponding rows in Dogs table.
Step 2: find first_name of the results of step 1 whose name equals Kacey.
Step 3: find the first_name of Owners table.
Step 4: show the rows that are in the results of step 2 but not in the results of step 3
Output: SELECT T1.first_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.name = "Kacey" EXCEPT SELECT T1.first_name FROM Owners AS T1
Step 1: find the ID of Highschooler table.
Step 2: find the liked_id of Likes table.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT T1.ID FROM Highschooler AS T1 INTERSECT SELECT T2.liked_id FROM Likes AS T2
find the tourney_name, loser_entry of matches table with largest value of minutes
Output: SELECT tourney_name , loser_entry FROM matches ORDER BY minutes Desc LIMIT 1
Step 1: find the number of rows of each value of owner_id in Owners table.
Step 2: find owner_id, first_name, last_name of Owners table with largest value in the results of step 1
Output: SELECT owner_id , first_name , last_name FROM Owners GROUP BY owner_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Owners table, find the corresponding rows in Dogs table.
Step 2: find the number of rows of each value of Dogs's owner_id in the results of step 1.
Step 3: find Dogs's owner_id, zip_code of step 1 results with largest value in the results of step 2
Output: SELECT T2.owner_id , T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id GROUP BY T2.owner_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Charges table, find corresponding rows in Treatment_Types table and in Treatments table.
Step 2: find the average charge_amount of each value of Treatments's treatment_type_code in the results of step 1.
Step 3: find treatment_type_description of the results of step 1 with smallest value in the results of step 2
Output: SELECT T2.treatment_type_description FROM Charges AS T1 JOIN Treatment_Types AS T2 JOIN Treatments AS T3 GROUP BY T3.treatment_type_code ORDER BY Avg ( T1.charge_amount ) Asc LIMIT 1
find each value of student_id in Friend table along with the number of the corresponding rows to each value
Output: SELECT student_id , Count ( * ) FROM Friend GROUP BY student_id
find the first_name, country_code of players table with largest value of birth_date
Output: SELECT first_name , country_code FROM players ORDER BY birth_date Desc LIMIT 1
find the Name, Population, Capital of country table for which Continent equals Asia with largest value of SurfaceArea
Output: SELECT Name , Population , Capital FROM country WHERE Continent = "Asia" ORDER BY SurfaceArea Desc LIMIT 1
find Region of country table whose Name equals English or Name equals Dutch
Output: SELECT Region FROM country WHERE Name = "Dutch" OR Name = "English"
Step 1: find the number of rows of each value of Country in airlines table.
Step 2: find Abbreviation, Country of airlines table with smallest value in the results of step 1
Output: SELECT Abbreviation , Country FROM airlines GROUP BY Country ORDER BY Count ( * ) Asc LIMIT 1
Step 1: find the number of rows of each value of permanent_address_id in Students table.
Step 2: find current_address_id, email_address of Students table with largest value in the results of step 1
Output: SELECT current_address_id , email_address FROM Students GROUP BY permanent_address_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the DestAirport of flights table.
Step 2: find the AirportName of airports table whose AirportCode not one of the results of step 1
Output: SELECT T1.AirportName FROM airports AS T1 WHERE T1.AirportCode NOT IN ( SELECT T2.DestAirport FROM flights AS T2 )
find the LifeExpectancy, Name, LocalName of country table with largest value of SurfaceArea
Output: SELECT LifeExpectancy , Name , LocalName FROM country ORDER BY SurfaceArea Desc LIMIT 1
find each value of Template_Type_Code in Templates table along with the number of the corresponding rows to each value
Output: SELECT Template_Type_Code , Count ( * ) FROM Templates GROUP BY Template_Type_Code
Step 1: find the number of rows of each value of City in airports table.
Step 2: find City of airports table with largest value in the results of step 1
Output: SELECT City FROM airports GROUP BY City ORDER BY Count ( * ) Desc LIMIT 1
find the Air_Date, Episode of TV_series table for which Episode equals A Love of a Lifetime
Output: SELECT Air_Date , Episode FROM TV_series WHERE Episode = "A Love of a Lifetime"
Step 1: For each row in car_names table, find corresponding rows in model_list table and in cars_data table.
Step 2: find the maximum Horsepower in the results of step 1 whose model_list's Model equals amc or Year less than 1
Output: SELECT Max ( T3.Horsepower ) FROM model_list AS T1 JOIN car_names AS T2 ON T1.Model = T2.Model JOIN cars_data AS T3 ON T2.MakeId = T3.Id WHERE T1.Model = "amc" OR T3.Year < 1
Step 1: For each row in players table, find the corresponding rows in matches table.
Step 2: find the number of rows of each value of loser_id in the results of step 1.
Step 3: find first_name, country_code of step 1 results with largest value in the results of step 2
Output: SELECT T1.first_name , T1.country_code FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.loser_id GROUP BY T2.loser_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the number of rows of each value of DestAirport in flights table.
Step 2: find DestAirport of flights table with smallest value in the results of step 1
Output: SELECT DestAirport FROM flights GROUP BY DestAirport ORDER BY Count ( * ) Asc LIMIT 1
Step 1: find the number of rows of each value of Continent in country table.
Step 2: find Name, Continent of country table ordered ascending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT Name , Continent FROM country GROUP BY Continent ORDER BY Count ( * ) Asc LIMIT 3
find Title of Cartoon table whose Written_by equals Ben Jones or Directed_by equals Brandon Vietti
Output: SELECT Title FROM Cartoon WHERE Written_by = "Ben Jones" OR Directed_by = "Brandon Vietti"
Step 1: find the rows in country table whose Continent equals Asia.
Step 2: find each value of Code2 in the results of step 1 ordered descending by number of rows that correspond of each value.
Step 3: only show the first row of the results
Output: SELECT Code2 FROM country WHERE Continent = "Asia" GROUP BY Code2 ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the Airline of airlines table for which Abbreviation equals CVO.
Step 2: For each row in airlines table, find the corresponding rows in airports table.
Step 3: find Airline of the results of step 2 whose AirportName equals APG.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.Airline FROM airlines AS T1 WHERE T1.Abbreviation = "CVO" EXCEPT SELECT T1.Airline FROM airlines AS T1 JOIN airports AS T2 WHERE T2.AirportName = "APG"
find the name, date_of_birth of Dogs table with largest value of age
Output: SELECT name , date_of_birth FROM Dogs ORDER BY age Desc LIMIT 1
Step 1: find the tourney_name of matches table for which year equals 2013.
Step 2: find the tourney_name of matches table for which year equals 2016.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT tourney_name FROM matches WHERE year = 2013 INTERSECT SELECT tourney_name FROM matches WHERE year = 2016
find the date_departed, date_of_birth of Dogs table for which gender equals 1
Output: SELECT date_departed , date_of_birth FROM Dogs WHERE gender = 1
find the number of different department_name in Departments table
Output: SELECT Count ( DISTINCT department_name ) FROM Departments
Step 1: For each row in players table, find the corresponding rows in matches table.
Step 2: find each value of loser_id in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT T1.hand , Count ( * ) FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.loser_id GROUP BY T2.loser_id
find the number of rows in Pets table whose PetType equals F and pet_age equals 3
Output: SELECT Count ( * ) FROM Pets WHERE PetType = "F" AND pet_age = 3
Step 1: find the StuID of Student table.
Step 2: find the StuID of Has_Pet 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.StuID FROM Student AS T1 EXCEPT SELECT T2.StuID FROM Has_Pet AS T2
Step 1: find the name of Highschooler table for which grade greater than 2.
Step 2: find the name of Highschooler table for which grade less than 5.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT name FROM Highschooler WHERE grade > 2 INTERSECT SELECT name FROM Highschooler WHERE grade < 5
find the number of rows in airlines table
Output: SELECT Count ( * ) FROM airlines
Step 1: For each row in TV_Channel table, find the corresponding rows in Cartoon table.
Step 2: find series_name, Country of the results of step 1 whose Written_by equals Ben Jones and Directed_by equals Michael Chang
Output: SELECT T1.series_name , T1.Country FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Written_by = "Ben Jones" AND T2.Directed_by = "Michael Chang"
Step 1: For each row in country table, find the corresponding rows in city table.
Step 2: find District of the results of step 1 whose Continent equals T and LocalName equals Chinese
Output: SELECT T1.District FROM city AS T1 JOIN country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Continent = "T" AND T2.LocalName = "Chinese"
Step 1: find the number of rows of each value of grade, grade in Highschooler table.
Step 2: find name in Highschooler table whose corresponding value in step 1 is greater than or equals 3
Output: SELECT name FROM Highschooler GROUP BY grade , grade HAVING Count ( * ) > = 3
find the number of rows in airports table whose Country equals ATO
Output: SELECT Count ( * ) FROM airports WHERE Country = "ATO"
Step 1: find the number of rows of each value of winner_entry in matches table.
Step 2: find tourney_name, loser_rank of matches table with largest value in the results of step 1
Output: SELECT tourney_name , loser_rank FROM matches GROUP BY winner_entry ORDER BY Count ( * ) Desc LIMIT 1
find the number of different Code2 in country table whose IndepYear less than 1930
Output: SELECT Count ( DISTINCT Code2 ) FROM country WHERE IndepYear < 1930
find the summation of SurfaceArea in country table whose Continent equals Asia and Continent equals Europe
Output: SELECT Sum ( SurfaceArea ) FROM country WHERE Continent = "Europe" AND Continent = "Asia"
Step 1: For each row in players table, find the corresponding rows in matches table.
Step 2: find first_name, country_code, loser_age of the results of step 1 with largest value of winner_rank
Output: SELECT T1.first_name , T1.country_code , T2.loser_age FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.loser_id ORDER BY T2.winner_rank Desc LIMIT 1
Step 1: find the number of rows of each value of Template_Type_Code in Templates table.
Step 2: find Template_Type_Code of Templates table with largest value in the results of step 1
Output: SELECT Template_Type_Code FROM Templates GROUP BY Template_Type_Code ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in car_names table, find corresponding rows in model_list table and in cars_data table.
Step 2: find the average Maker in the results of step 1 whose Year less than 1980
Output: SELECT Avg ( T1.Maker ) FROM model_list AS T1 JOIN car_names AS T2 ON T1.Model = T2.Model JOIN cars_data AS T3 ON T2.MakeId = T3.Id WHERE T3.Year < 1980
find Continent of country table whose Continent equals English or LocalName equals Dutch
Output: SELECT Continent FROM country WHERE Continent = "English" OR LocalName = "Dutch"
find the property_type_description of Ref_Property_Types table
Output: SELECT property_type_description FROM Ref_Property_Types
find the number of rows in airlines table whose Airline equals Ashley and Airline equals Aberdeen
Output: SELECT Count ( * ) FROM airlines WHERE Airline = "Aberdeen" AND Airline = "Ashley"
find each value of Continent in continents table along with the number of the corresponding rows to each value
Output: SELECT Continent , Count ( * ) FROM continents GROUP BY Continent
find the number of rows in Templates table whose Template_Type_Code equals PPT
Output: SELECT Count ( * ) FROM Templates WHERE Template_Type_Code = "PPT"
Step 1: find the first_name of Students table.
Step 2: find the first_name of Students table.
Step 3: show the rows that are in any of the results of step 1 or the results of step 2
Output: SELECT first_name FROM Students UNION SELECT first_name FROM Students
find each value of winner_rank in matches table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , winner_rank FROM matches GROUP BY winner_rank
find the name of Highschooler table for which grade equals Kyle
Output: SELECT name FROM Highschooler WHERE grade = "Kyle"
find the number of rows in country table whose LocalName equals Spanish
Output: SELECT Count ( * ) FROM country WHERE LocalName = "Spanish"
find the Cylinders of cars_data table with smallest value of Accelerate
Output: SELECT Cylinders FROM cars_data ORDER BY Accelerate Asc LIMIT 1
Step 1: find the Content of TV_Channel table.
Step 2: For each row in TV_Channel table, find the corresponding rows in Cartoon table.
Step 3: find Content of the results of step 2 whose Written_by equals Ben Jones.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.Content FROM TV_Channel AS T1 EXCEPT SELECT T1.Content FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Written_by = "Ben Jones"
find the maximum Population and the minimum GNP in country table
Output: SELECT Max ( Population ) , Min ( GNP ) FROM country
Step 1: find the Template_Type_Code of Templates table.
Step 2: find the Template_Type_Code of Templates table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Template_Type_Code FROM Templates EXCEPT SELECT Template_Type_Code FROM Templates
Step 1: For each row in airlines table, find the corresponding rows in airports table.
Step 2: find the number of rows in the results of step 1 whose airports's Country equals United Airlines and Airline equals ASY
Output: SELECT Count ( * ) FROM airlines AS T1 JOIN airports AS T2 WHERE T2.Country = "United Airlines" AND T1.Airline = "ASY"
Step 1: For each row in conductor table, find the corresponding rows in orchestra table.
Step 2: find Name, Year_of_Founded of the results of step 1
Output: SELECT T1.Name , T2.Year_of_Founded FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID
Step 1: For each row in Charges table, find the corresponding rows in Owners table.
Step 2: find the summation of charge_amount of each value of owner_id in the results of step 1.
Step 3: find owner_id, zip_code of step 1 results with largest value in the results of step 2
Output: SELECT T2.owner_id , T2.zip_code FROM Charges AS T1 JOIN Owners AS T2 GROUP BY T2.owner_id ORDER BY Sum ( T1.charge_amount ) Desc LIMIT 1
find the Document_Name, Document_ID of Documents table for which Document_Description contains w
Output: SELECT Document_Name , Document_ID FROM Documents WHERE Document_Description LIKE "w"
find the summation of GNP and the summation of Population in country table whose Continent equals US Territory
Output: SELECT Sum ( GNP ) , Sum ( Population ) FROM country WHERE Continent = "US Territory"
Step 1: find the number of rows of each value of course_name in Courses table.
Step 2: find course_name of Courses table with largest value in the results of step 1
Output: SELECT course_name FROM Courses GROUP BY course_name ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in airlines table, find the corresponding rows in airports table.
Step 2: find Airline of the results of step 1 whose AirportName equals AHD
Output: SELECT T1.Airline FROM airlines AS T1 JOIN airports AS T2 WHERE T2.AirportName = "AHD"
find the other_details of Student_Enrolment table ordered descending by other_details
Output: SELECT other_details FROM Student_Enrolment ORDER BY other_details Desc
Step 1: find the Continent of country table for which LocalName equals English.
Step 2: find the average Population in country table whose Continent not one of the results of step 1
Output: SELECT Avg ( Population ) FROM country WHERE Continent NOT IN ( SELECT Continent FROM country WHERE LocalName = "English" )
find each value of course_id in Student_Enrolment_Courses table along with the maximum student_course_id of the corresponding rows to each value
Output: SELECT Max ( student_course_id ) , course_id FROM Student_Enrolment_Courses GROUP BY course_id
Step 1: find the number of rows of each value of Airline in airlines table.
Step 2: find Airline of airlines table with largest value in the results of step 1
Output: SELECT Airline FROM airlines GROUP BY Airline ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in shop table, find the corresponding rows in hiring table.
Step 2: find each value of hiring's Shop_ID in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , T1.Name FROM shop AS T1 JOIN hiring AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T2.Shop_ID
find the Document_ID of Documents table for which Document_Description equals Presentation
Output: SELECT Document_ID FROM Documents WHERE Document_Description = "Presentation"
Step 1: For each row in Highschooler table, find the corresponding rows in Friend table.
Step 2: find the number of rows of each value of student_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 Highschooler AS T1 JOIN Friend AS T2 ON T1.ID = T2.student_id GROUP BY T2.student_id HAVING Count ( * ) > = 2
Step 1: For each row in country table, find the corresponding rows in city table.
Step 2: find the  city's Name in the results of step 1 whose country's Name equals English ordered descending by city's Population.
Step 3: only show the first row of the results
Output: SELECT T1.Name FROM city AS T1 JOIN country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Name = "English" ORDER BY T1.Population Desc LIMIT 1
Step 1: find the CountryCode of countrylanguage table for which Language equals Republic.
Step 2: find the Code of country table whose Continent equals the results of step 1.
Step 3: For each row in country table, find the corresponding rows in countrylanguage table.
Step 4: find Code of the results of step 3 whose Language equals English.
Step 5: show the rows that are in the results of step 2 but not in the results of step 4
Output: SELECT T1.Code FROM country AS T1 WHERE T1.Continent = ( SELECT T2.CountryCode FROM countrylanguage AS T2 WHERE T2.Language = "Republic" ) EXCEPT SELECT T1.Code FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English"
Step 1: find the Name of teacher table.
Step 2: find the Name of teacher 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 teacher EXCEPT SELECT Name FROM teacher
find the rows of Students table ordered descending by date_left
Output: SELECT * FROM Students ORDER BY date_left Desc
find the minimum Weight in cars_data table whose Year equals 1
Output: SELECT Min ( Weight ) FROM cars_data WHERE Year = 1
find the Airline of airlines table for which Abbreviation equals AHD
Output: SELECT Airline FROM airlines WHERE Abbreviation = "AHD"
find the transcript_date, other_details of Transcripts table
Output: SELECT transcript_date , other_details FROM Transcripts
find the rows of Treatments table with smallest value of date_of_treatment
Output: SELECT * FROM Treatments ORDER BY date_of_treatment Asc LIMIT 1
Step 1: find the Template_Type_Code of Ref_Template_Types table.
Step 2: find the Template_Type_Code of Templates 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.Template_Type_Code FROM Ref_Template_Types AS T1 EXCEPT SELECT T2.Template_Type_Code FROM Templates AS T2
Step 1: For each row in country table, find the corresponding rows in city table.
Step 2: find city's Name of the results of step 1 whose Continent equals T.
Step 3: find city's Name of the results of step 1 whose Continent equals Europe.
Step 4: show the rows that are in the results of step 2 but not in the results of step 3
Output: SELECT T1.Name FROM city AS T1 JOIN country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Continent = "T" EXCEPT SELECT T1.Name FROM city AS T1 JOIN country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Continent = "Europe"
Step 1: find the first_name of Students table for which cell_mobile_number contains Haiti.
Step 2: find the first_name of Students table for which cell_mobile_number equals 09700166582.
Step 3: show the rows that are in any of the results of step 1 or the results of step 2
Output: SELECT first_name FROM Students WHERE cell_mobile_number LIKE "Haiti" UNION SELECT first_name FROM Students WHERE cell_mobile_number = 09700166582
find the number of rows in cars_data table whose Cylinders greater than 150
Output: SELECT Count ( * ) FROM cars_data WHERE Cylinders > 150
Step 1: find the Continent of country table for which Code2 equals T.
Step 2: find the Continent of country table for which Code2 equals French.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Continent FROM country WHERE Code2 = "T" INTERSECT SELECT Continent FROM country WHERE Code2 = "French"
Step 1: For each row in singer table, find the corresponding rows in song table.
Step 2: find each value of Singer_ID in the results of step 1 along with the summation of Sales of the corresponding rows to each value
Output: SELECT T1.Name , Sum ( T2.Sales ) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T2.Singer_ID
find the average loser_age and the average loser_age in matches table
Output: SELECT Avg ( loser_age ) , Avg ( loser_age ) FROM matches
find the number of rows in city table
Output: SELECT Count ( * ) FROM city
Step 1: For each row in car_names table, find corresponding rows in model_list table and in cars_data table.
Step 2: find without repetition model_list's Model of the results of step 1 whose Weight greater than 3500.
Step 3: For each row in car_makers table, find the corresponding rows in model_list table.
Step 4: find model_list's Model of the results of step 3 whose car_makers's Maker equals Ford Motor Company.
Step 5: show the rows that are in the results of step 2 but not in the results of step 4
Output: SELECT DISTINCT T1.Model FROM model_list AS T1 JOIN car_names AS T2 ON T1.Model = T2.Model JOIN cars_data AS T3 ON T2.MakeId = T3.Id WHERE T3.Weight > 3500 EXCEPT SELECT T1.Model FROM car_makers AS T4 JOIN model_list AS T1 ON T4.Id = T1.Maker WHERE T4.Maker = "Ford Motor Company"
find the number of rows in car_makers table whose Country equals usa
Output: SELECT Count ( * ) FROM car_makers WHERE Country = "usa"
find the number of rows in Highschooler table whose grade equals Kyle
Output: SELECT Count ( * ) FROM Highschooler WHERE grade = "Kyle"
find the first_name, middle_name, last_name of Students table
Output: SELECT first_name , middle_name , last_name FROM Students
Step 1: For each row in conductor table, find the corresponding rows in orchestra table.
Step 2: find Name of the results of step 1 with largest value of Year_of_Founded
Output: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID ORDER BY T2.Year_of_Founded Desc LIMIT 1
Step 1: For each row in shop table, find the corresponding rows in hiring table.
Step 2: find the number of rows of each value of hiring's Shop_ID in the results of step 1.
Step 3: find Name, District of step 1 results with largest value in the results of step 2
Output: SELECT T1.Name , T1.District FROM shop AS T1 JOIN hiring AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T2.Shop_ID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the number of rows of each value of semester_id in Semesters table.
Step 2: find semester_name, semester_id of Semesters table with largest value in the results of step 1
Output: SELECT semester_name , semester_id FROM Semesters GROUP BY semester_id ORDER BY Count ( * ) Desc LIMIT 1
find the If_first_show of show table ordered ascending by If_first_show
Output: SELECT If_first_show FROM show ORDER BY If_first_show Asc
Step 1: find the line_1 of Addresses table for which line_1 equals 2294 Grant Square Apt. 235.
Step 2: find the line_1 of Addresses table for which line_1 equals 2294 Grant Square Apt. 235.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT line_1 FROM Addresses WHERE line_1 = "2294 Grant Square Apt. 235" INTERSECT SELECT line_1 FROM Addresses WHERE line_1 = "2294 Grant Square Apt. 235"
find the number of rows in Pets table whose pet_age greater than 20
Output: SELECT Count ( * ) FROM Pets WHERE pet_age > 20
Step 1: For each row in car_names table, find corresponding rows in model_list table and in cars_data table.
Step 2: find model_list's Model of the results of step 1 whose Weight greater than 3500.
Step 3: For each row in car_makers table, find the corresponding rows in model_list table.
Step 4: find model_list's Model of the results of step 3 whose car_makers's Maker equals Ford Motor Company.
Step 5: show the rows that are in the results of step 2 but not in the results of step 4
Output: SELECT T1.Model FROM model_list AS T1 JOIN car_names AS T2 ON T1.Model = T2.Model JOIN cars_data AS T3 ON T2.MakeId = T3.Id WHERE T3.Weight > 3500 EXCEPT SELECT T1.Model FROM car_makers AS T4 JOIN model_list AS T1 ON T4.Id = T1.Maker WHERE T4.Maker = "Ford Motor Company"
find Name of singer table whose Citizenship equals 1948 or Citizenship equals 1949
Output: SELECT Name FROM singer WHERE Citizenship = 1949 OR Citizenship = 1948
Step 1: find the number of rows of each value of course_id in Courses table.
Step 2: find course_id, course_description of Courses table with largest value in the results of step 1
Output: SELECT course_id , course_description FROM Courses GROUP BY course_id ORDER BY Count ( * ) Desc LIMIT 1
find the number of rows in Departments table whose department_name equals engineer
Output: SELECT Count ( * ) FROM Departments WHERE department_name = "engineer"
find the Document_ID of Documents table for which Document_Name contains Ireland
Output: SELECT Document_ID FROM Documents WHERE Document_Name LIKE "Ireland"
find the Code of country table for which LocalName equals Spanish
Output: SELECT Code FROM country WHERE LocalName = "Spanish"
find the name, date_of_birth of Dogs table with largest value of weight
Output: SELECT name , date_of_birth FROM Dogs ORDER BY weight Desc LIMIT 1
Step 1: find the Package_Option of TV_Channel table.
Step 2: For each row in TV_Channel table, find the corresponding rows in Cartoon table.
Step 3: find Package_Option of the results of step 2 whose Written_by equals Ben Jones.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.Package_Option FROM TV_Channel AS T1 EXCEPT SELECT T1.Package_Option FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Written_by = "Ben Jones"
find the Template_ID, Version_Number, Template_Type_Code, Template_Type_Code of Templates table
Output: SELECT Template_ID , Version_Number , Template_Type_Code , Template_Type_Code FROM Templates
find the FullName, Maker of car_makers table with smallest value of FullName
Output: SELECT FullName , Maker FROM car_makers ORDER BY FullName Asc LIMIT 1
find the SurfaceArea of country table for which Name equals Caribbean
Output: SELECT SurfaceArea FROM country WHERE Name = "Caribbean"
Step 1: find the Name, SurfaceArea of country table ordered descending by Population.
Step 2: only show the first 5 rows of the results
Output: SELECT Name , SurfaceArea FROM country ORDER BY Population Desc LIMIT 5
Step 1: find the number of rows of each value of Airline in airlines table.
Step 2: find Airline in airlines table whose corresponding value in step 1 is greater than or equals 10
Output: SELECT Airline FROM airlines GROUP BY Airline HAVING Count ( * ) > = 10
Step 1: find the number of rows of each value of winner_name in matches table.
Step 2: find winner_name, loser_rank of matches table with largest value in the results of step 1
Output: SELECT winner_name , loser_rank FROM matches GROUP BY winner_name ORDER BY Count ( * ) Desc LIMIT 1
find the age of Dogs table with smallest value of age
Output: SELECT age FROM Dogs ORDER BY age Asc LIMIT 1
Step 1: find the ID of Highschooler table.
Step 2: find the liked_id of Likes 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.ID FROM Highschooler AS T1 EXCEPT SELECT T2.liked_id FROM Likes AS T2
find the number of rows in cars_data table whose Accelerate equals 1
Output: SELECT Count ( * ) FROM cars_data WHERE Accelerate = 1
Step 1: find the average Average of each value of Stadium_ID in stadium table.
Step 2: find Name, Capacity of stadium table with largest value in the results of step 1
Output: SELECT Name , Capacity FROM stadium GROUP BY Stadium_ID ORDER BY Avg ( Average ) Desc LIMIT 1
Step 1: For each row in Has_Pet table, find corresponding rows in Student table and in Pets table.
Step 2: find Fname of the results of step 1 whose PetType equals cat.
Step 3: For each row in Pets table, find the corresponding rows in Has_Pet table.
Step 4: find Has_Pet's StuID of the results of step 3 whose PetType equals dog.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T1.Fname FROM Student AS T1 JOIN Has_Pet AS T2 ON T1.StuID = T2.StuID JOIN Pets AS T3 ON T2.PetID = T3.PetID WHERE T3.PetType = "cat" INTERSECT SELECT T2.StuID FROM Has_Pet AS T2 JOIN Pets AS T3 ON T2.PetID = T3.PetID WHERE T3.PetType = "dog"
find the country_code of players table for which player_id greater than 50
Output: SELECT country_code FROM players WHERE player_id > 50
Step 1: For each row in model_list table, find corresponding rows in car_makers table and in car_names table.
Step 2: find MakeId, car_makers's Maker of the results of step 1 whose model_list's Model greater than or equals 2.
Step 3: find MakeId, car_makers's Maker of the results of step 1 whose model_list's Model greater than 3.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T3.MakeId , T1.Maker FROM car_makers AS T1 JOIN model_list AS T2 ON T1.Id = T2.Maker AND T1.Id = T2.Maker JOIN car_names AS T3 ON T2.Model = T3.Model WHERE T2.Model > = 2 INTERSECT SELECT T3.MakeId , T1.Maker FROM car_makers AS T1 JOIN model_list AS T2 ON T1.Id = T2.Maker AND T1.Id = T2.Maker JOIN car_names AS T3 ON T2.Model = T3.Model WHERE T2.Model > 3
Step 1: find the CountryName of countries table.
Step 2: find the CountryName of countries table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT CountryName FROM countries EXCEPT SELECT CountryName FROM countries
Step 1: For each row in car_names table, find corresponding rows in model_list table and in cars_data table.
Step 2: find model_list's Model of the results of step 1 with smallest value of Accelerate
Output: SELECT T1.Model FROM model_list AS T1 JOIN car_names AS T2 ON T1.Model = T2.Model JOIN cars_data AS T3 ON T2.MakeId = T3.Id ORDER BY T3.Accelerate Asc LIMIT 1
Step 1: find the number of rows of each value of Country in car_makers table.
Step 2: find Country, Id in car_makers table whose corresponding value in step 1 is greater than or equals 1
Output: SELECT Country , Id FROM car_makers GROUP BY Country HAVING Count ( * ) > = 1
Step 1: For each row in airlines table, find the corresponding rows in airports table.
Step 2: find Airline of the results of step 1 whose airports's Country equals APG.
Step 3: find Airline of the results of step 1 whose airports's Country equals CVO.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.Airline FROM airlines AS T1 JOIN airports AS T2 WHERE T2.Country = "APG" INTERSECT SELECT T1.Airline FROM airlines AS T1 JOIN airports AS T2 WHERE T2.Country = "CVO"
find the Name, Population, Continent of country table
Output: SELECT Name , Population , Continent FROM country
Step 1: For each row in Templates table, find the corresponding rows in Documents table.
Step 2: find Document_ID, Date_Effective_To of the results of step 1 whose Document_Name equals Welcome to NY
Output: SELECT T2.Document_ID , T1.Date_Effective_To FROM Templates AS T1 JOIN Documents AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Document_Name = "Welcome to NY"
find the number of different Code2 in country table whose Continent equals Africa
Output: SELECT Count ( DISTINCT Code2 ) FROM country WHERE Continent = "Africa"
find the number of rows in Highschooler table whose name equals Kyle
Output: SELECT Count ( * ) FROM Highschooler WHERE name = "Kyle"
Step 1: find the number of rows of each value of Channel in TV_series table.
Step 2: find Channel in TV_series table whose corresponding value in step 1 is greater than 2
Output: SELECT Channel FROM TV_series GROUP BY Channel HAVING Count ( * ) > 2
find without repetition the id, name of ship table for which ship_type equals Brig
Output: SELECT DISTINCT id , name FROM ship WHERE ship_type = "Brig"
find each value of Cylinders in cars_data table along with the maximum Cylinders of the corresponding rows to each value
Output: SELECT Max ( Cylinders ) , Accelerate FROM cars_data GROUP BY Cylinders