niryuu/sni-each-converted huggingface dataset:
find the number of rows in Ref_Characteristic_Types table whose characteristic_type_description equals red
Output: SELECT Count ( * ) FROM Ref_Characteristic_Types WHERE characteristic_type_description = "red"
find the Card_Number, Name, Hometown of member table ordered descending by Card_Number
Output: SELECT Card_Number , Name , Hometown FROM member ORDER BY Card_Number Desc
find each value of city_code in Student table along with the average Age of the corresponding rows to each value
Output: SELECT city_code , Avg ( Age ) FROM Student GROUP BY city_code
find date_became_customer of Customers table whose customer_id equals 10 or customer_id equals 20
Output: SELECT date_became_customer FROM Customers WHERE customer_id = 20 OR customer_id = 10
find the number of rows in member table whose Hometown contains Kentucky
Output: SELECT Count ( * ) FROM member WHERE Hometown LIKE "Kentucky"
Step 1: find the dorm_name of Dorm table.
Step 2: find the dorm_name of Dorm table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT dorm_name FROM Dorm EXCEPT SELECT dorm_name FROM Dorm
Step 1: find the cName of College table.
Step 2: find the cName of Tryout table.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT T1.cName FROM College AS T1 INTERSECT SELECT T2.cName FROM Tryout AS T2
find the Winery of wine table for which Score greater than 90
Output: SELECT Winery FROM wine WHERE Score > 90
Step 1: find the number of rows of each value of name in swimmer table.
Step 2: find name in swimmer table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT name FROM swimmer GROUP BY name HAVING Count ( * ) > = 2
Step 1: find the number of rows of each value of Open_year in branch table.
Step 2: find Name, Open_year of branch table with largest value in the results of step 1
Output: SELECT Name , Open_year FROM branch GROUP BY Open_year ORDER BY Count ( * ) Desc LIMIT 1
find the Fname of Student table for which Age equals or between 20 and 25
Output: SELECT Fname FROM Student WHERE Age BETWEEN 25 AND 20
Step 1: For each row in Customer_Addresses table, find corresponding rows in Addresses table and in Customers table.
Step 2: find address_content of the results of step 1 whose customer_name contains Maudie Kertzmann
Output: SELECT T1.address_content FROM Addresses AS T1 JOIN Customers AS T2 JOIN Customer_Addresses AS T3 ON T1.address_id = T3.address_id AND T3.customer_id = T2.customer_id WHERE T2.customer_name LIKE "Maudie Kertzmann"
find each value of Builder in railway table along with the number of the corresponding rows to each value
Output: SELECT Built , Count ( * ) FROM railway GROUP BY Builder
find each value of City_Town in Addresses table along with the number of the corresponding rows to each value
Output: SELECT City_Town , Count ( * ) FROM Addresses GROUP BY City_Town
Step 1: For each row in station table, find the corresponding rows in train_station table.
Step 2: for each value of train_station's Station_ID in the results of step 1, find the number of rows along with Name and Location
Output: SELECT T1.Name , T1.Location , Count ( * ) FROM station AS T1 JOIN train_station AS T2 ON T1.Station_ID = T2.Station_ID GROUP BY T2.Station_ID
Step 1: For each row in grapes table, find the corresponding rows in wine table.
Step 2: find Winery of the results of step 1 whose Price greater than 50 and Color equals Red
Output: SELECT T2.Winery FROM grapes AS T1 JOIN wine AS T2 ON T1.Grape = T2.Grape WHERE T2.Price > 50 AND T1.Color = "Red"
Step 1: For each row in member table, find the corresponding rows in purchase table.
Step 2: find the summation of Total_pounds in the results of step 1 whose Level equals 6
Output: SELECT Sum ( T2.Total_pounds ) FROM member AS T1 JOIN purchase AS T2 ON T1.Member_ID = T2.Member_ID WHERE T1.Level = 6
Step 1: For each row in Customers table, find the corresponding rows in Customer_Contact_Channels table.
Step 2: find the active_from_date in the results of step 1 whose customer_name equals Tillman Ernser with largest value of active_to_date
Output: SELECT T2.active_from_date FROM Customers AS T1 JOIN Customer_Contact_Channels AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Tillman Ernser" ORDER BY T2.active_to_date Desc LIMIT 1
Step 1: For each row in Ref_Product_Categories table, find the corresponding rows in Products table.
Step 2: find the number of rows in the results of step 1 whose Products's product_category_code equals Spices and product_category_description greater than 1000
Output: SELECT Count ( * ) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_category_code = "Spices" AND T1.product_category_description > 1000
find the number of rows in Products table whose product_name equals laurel
Output: SELECT Count ( * ) FROM Products WHERE product_name = "laurel"
Step 1: find the rows in wine table whose Appelation equals White.
Step 2: find each value of Winery in the results of step 1 ordered descending by number of rows that correspond of each value.
Step 3: only show the first 3 rows of the results
Output: SELECT Winery FROM wine WHERE Appelation = "White" GROUP BY Appelation ORDER BY Count ( * ) Desc LIMIT 3
Step 1: For each row in Customers table, find the corresponding rows in Customer_Contact_Channels table.
Step 2: find the active_from_date in the results of step 1 whose customer_name equals Tillman Ernser with largest value of date_became_customer
Output: SELECT T2.active_from_date FROM Customers AS T1 JOIN Customer_Contact_Channels AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Tillman Ernser" ORDER BY T1.date_became_customer Desc LIMIT 1
find the average Revenue, the minimum Revenue and the maximum Revenue in Manufacturers table
Output: SELECT Avg ( Revenue ) , Min ( Revenue ) , Max ( Revenue ) FROM Manufacturers
find the Other_Product_Service_Details of Products table for which Product_Price greater than 2000
Output: SELECT Other_Product_Service_Details FROM Products WHERE Product_Price > 2000
Step 1: For each row in appellations table, find the corresponding rows in wine table.
Step 2: find Winery of the results of step 1 whose Price less than 50 and appellations's State equals Monterey and County equals Sonoma
Output: SELECT T2.Winery FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Price < 50 AND T1.State = "Monterey" AND T1.County = "Sonoma"
find the customer_name, date_became_customer of Customers table for which customer_name equals Email
Output: SELECT customer_name , date_became_customer FROM Customers WHERE customer_name = "Email"
Step 1: find the Tryout's cName of Tryout table for which pPos equals goalie.
Step 2: find the state of College table whose state not one of the results of step 1
Output: SELECT T1.state FROM College AS T1 WHERE T1.state NOT IN ( SELECT T2.cName FROM Tryout AS T2 WHERE T2.pPos = "goalie" )
Step 1: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 2: find product_name of the results of step 1 whose characteristic_data_type equals Handful.
Step 3: find product_name of the results of step 1 whose characteristic_data_type equals white.
Step 4: show the rows that are in the results of step 2 but not in the results of step 3
Output: SELECT T2.product_name FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T1.characteristic_data_type = "Handful" EXCEPT SELECT T2.product_name FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T1.characteristic_data_type = "white"
Step 1: find the yCard of Player table.
Step 2: find the summation of enr in College table whose state not one of the results of step 1
Output: SELECT Sum ( T1.enr ) FROM College AS T1 WHERE T1.state NOT IN ( SELECT T2.yCard FROM Player AS T2 )
Step 1: find the cName of Tryout table.
Step 2: find the summation of enr in College table whose state not one of the results of step 1
Output: SELECT Sum ( T1.enr ) FROM College AS T1 WHERE T1.state NOT IN ( SELECT T2.cName FROM Tryout AS T2 )
find the summation of Product_Price in Products table whose Product_Name equals photo
Output: SELECT Sum ( Product_Price ) FROM Products WHERE Product_Name = "photo"
Step 1: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table.
Step 2: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics EXCEPT SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics
Step 1: For each row in Student table, find the corresponding rows in Lives_in table.
Step 2: find Fname of the results of step 1 with largest value of room_number
Output: SELECT T1.Fname FROM Student AS T1 JOIN Lives_in AS T2 ON T1.StuID = T2.stuid ORDER BY T2.room_number Desc LIMIT 1
Step 1: find the product_id of Product_Characteristics table.
Step 2: find the number of rows in Products table whose Products's product_id not one of the results of step 1
Output: SELECT Count ( * ) FROM Products AS T1 WHERE T1.product_id NOT IN ( SELECT T2.product_id FROM Product_Characteristics AS T2 )
Step 1: find the City of branch table.
Step 2: For each row in branch table, find the corresponding rows in purchase table.
Step 3: find City of the results of step 2 whose Total_pounds greater than 100.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.City FROM branch AS T1 EXCEPT SELECT T1.City FROM branch AS T1 JOIN purchase AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T2.Total_pounds > 100
Step 1: For each row in College table, find the corresponding rows in Tryout table.
Step 2: find rows in the results of step 1 whose enr greater than FL.
Step 3: find the number of rows of each value of Tryout's cName in step 1 rsults.
Step 4: find College's cName in the results of step 1 whose corresponding value in step 2 is greater than or equals 1
Output: SELECT T1.cName FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T1.enr > "FL" GROUP BY T2.cName HAVING Count ( * ) > = 1
find the average Price in wine table whose State equals Sonoma
Output: SELECT Avg ( Price ) FROM wine WHERE State = "Sonoma"
Step 1: For each row in stadium table, find the corresponding rows in event table.
Step 2: find Name of the results of step 1 with largest value of Opening_year
Output: SELECT T2.Name FROM stadium AS T1 JOIN event AS T2 ON T1.ID = T2.Stadium_ID ORDER BY T1.Opening_year Desc LIMIT 1
find the Name of station table with largest value of Number_of_Platforms
Output: SELECT Name FROM station ORDER BY Number_of_Platforms Desc LIMIT 1
find the cName of Tryout table for which pPos equals yes
Output: SELECT cName FROM Tryout WHERE pPos = "yes"
Step 1: find the number of rows of each value of Marketing_Region_Code in Marketing_Regions table.
Step 2: find Marketing_Region_Name of Marketing_Regions table with largest value in the results of step 1
Output: SELECT Marketing_Region_Name FROM Marketing_Regions GROUP BY Marketing_Region_Code ORDER BY Count ( * ) Desc LIMIT 1
find the customer_details of Customers table for which customer_details contains Miss
Output: SELECT customer_details FROM Customers WHERE customer_details LIKE "Miss"
find the number of rows in Ref_Payment_Methods table
Output: SELECT Count ( * ) FROM Ref_Payment_Methods
find the average active_from_date in Customer_Contact_Channels table
Output: SELECT Avg ( active_from_date ) FROM Customer_Contact_Channels
find the number of different Headquarter in Manufacturers table
Output: SELECT Count ( DISTINCT Headquarter ) FROM Manufacturers
find the name, Nationality of swimmer table for which meter_100 greater than 1
Output: SELECT name , Nationality FROM swimmer WHERE meter_100 > 1
find the summation of Revenue in Manufacturers table whose Headquarter equals Austin
Output: SELECT Sum ( Revenue ) FROM Manufacturers WHERE Headquarter = "Austin"
Step 1: For each row in Lives_in table, find corresponding rows in Student table and in Dorm table.
Step 2: find the number of rows in the results of step 1 whose Sex equals Smith Hall and gender equals F
Output: SELECT Count ( * ) FROM Student AS T1 JOIN Dorm AS T2 JOIN Lives_in AS T3 ON T1.StuID = T3.stuid AND T3.dormid = T2.dormid WHERE T1.Sex = "Smith Hall" AND T2.gender = "F"
find LName of Student table whose city_code equals M or Age less than 20
Output: SELECT LName FROM Student WHERE city_code = "M" OR Age < 20
Step 1: For each row in Manufacturers table, find the corresponding rows in Products table.
Step 2: find each value of Founder in the results of step 1 along with the average Price of the corresponding rows to each value
Output: SELECT Avg ( T2.Price ) , T1.Founder FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer GROUP BY T1.Founder
find the summation of Revenue in Manufacturers table whose Founder equals Andy
Output: SELECT Sum ( Revenue ) FROM Manufacturers WHERE Founder = "Andy"
Step 1: find the average enr in College table.
Step 2: find the state of College table whose enr less than the results of step 1
Output: SELECT state FROM College WHERE enr < ( SELECT Avg ( enr ) FROM College )
find address_content of Addresses table whose country equals Gleasonmouth and state_province_county equals Arizona
Output: SELECT address_content FROM Addresses WHERE country = "Gleasonmouth" AND state_province_county = "Arizona"
find the number of rows in Characteristics table whose characteristic_name equals white or characteristic_name equals hot
Output: SELECT Count ( * ) FROM Characteristics WHERE characteristic_name = "hot" OR characteristic_name = "white"
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_name of Customers table with largest value in the results of step 1
Output: SELECT customer_name FROM Customers GROUP BY customer_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the number of rows of each value of Railway_ID in railway table.
Step 2: find Railway_ID, Builder of railway table with largest value in the results of step 1
Output: SELECT Railway_ID , Builder FROM railway GROUP BY Railway_ID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Addresses table, find the corresponding rows in Clients table.
Step 2: find the number of rows of each value of Clients's Address_ID in the results of step 1.
Step 3: find City_Town in the results of step 1 whose corresponding value in step 2 is less than or equals 1
Output: SELECT T1.City_Town FROM Addresses AS T1 JOIN Clients AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T2.Address_ID HAVING Count ( * ) < = 1
find the average product_price in Products table
Output: SELECT Avg ( product_price ) FROM Products
Step 1: find the Tryout's cName of Tryout table for which pPos equals goalie.
Step 2: find the number of different state in College table whose state not one of the results of step 1
Output: SELECT Count ( DISTINCT T1.state ) FROM College AS T1 WHERE T1.state NOT IN ( SELECT T2.cName FROM Tryout AS T2 WHERE T2.pPos = "goalie" )
Step 1: find the Name of Manufacturers table for which Founder equals Creative Labs.
Step 2: find the Name of Manufacturers table for which Founder equals Sony.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Name FROM Manufacturers WHERE Founder = "Creative Labs" INTERSECT SELECT Name FROM Manufacturers WHERE Founder = "Sony"
Step 1: find the number of rows of each value of characteristic_type_code in Characteristics table.
Step 2: find characteristic_name in Characteristics table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT characteristic_name FROM Characteristics GROUP BY characteristic_type_code HAVING Count ( * ) > = 2
find the Planned_Delivery_Date, Order_Date of Bookings table
Output: SELECT Planned_Delivery_Date , Order_Date FROM Bookings
Step 1: find the number of rows of each value of Railway_ID in railway table.
Step 2: find Railway_ID, Location in railway table whose corresponding value in step 1 is greater than 1
Output: SELECT Railway_ID , Location FROM railway GROUP BY Railway_ID HAVING Count ( * ) > 1
Step 1: For each row in Products table, find the corresponding rows in Product_Characteristics table.
Step 2: find product_name of the results of step 1 whose product_characteristic_value equals Handful.
Step 3: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 4: find product_name of the results of step 3 whose characteristic_data_type equals white.
Step 5: show the rows that are in the results of step 2 but not in the results of step 4
Output: SELECT T1.product_name FROM Products AS T1 JOIN Product_Characteristics AS T2 ON T1.product_id = T2.product_id WHERE T2.product_characteristic_value = "Handful" EXCEPT SELECT T1.product_name FROM Characteristics AS T3 JOIN Products AS T1 JOIN Product_Characteristics AS T2 ON T3.characteristic_id = T2.characteristic_id AND T2.product_id = T1.product_id WHERE T3.characteristic_data_type = "white"
find the pName of Player table ordered descending by HS
Output: SELECT pName FROM Player ORDER BY HS Desc
find the average active_to_date in Customer_Contact_Channels table
Output: SELECT Avg ( active_to_date ) FROM Customer_Contact_Channels
find the Speed of roller_coaster table with largest value of Height
Output: SELECT Speed FROM roller_coaster ORDER BY Height Desc LIMIT 1
find without repetition the payment_method_code of Invoices table
Output: SELECT DISTINCT payment_method_code FROM Invoices
Step 1: For each row in Lives_in table, find corresponding rows in Student table and in Dorm table.
Step 2: find dorm_name of the results of step 1 whose LName equals Smith
Output: SELECT T2.dorm_name FROM Student AS T1 JOIN Dorm AS T2 JOIN Lives_in AS T3 ON T1.StuID = T3.stuid AND T3.dormid = T2.dormid WHERE T1.LName = "Smith"
find without repetition the Winery of wine table for which Year greater than or equals 2000
Output: SELECT DISTINCT Winery FROM wine WHERE Year > = 2000
find the summation of Product_Price in Products table
Output: SELECT Sum ( Product_Price ) FROM Products
Step 1: find the state of College table.
Step 2: find the decision of Tryout table.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT T1.state FROM College AS T1 INTERSECT SELECT T2.decision FROM Tryout AS T2
Step 1: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 2: find characteristic_name of the results of step 1 whose product_name equals Herbs
Output: SELECT T1.characteristic_name FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T2.product_name = "Herbs"
find the product_name, typical_buying_price of Products table for which product_description equals yellow
Output: SELECT product_name , typical_buying_price FROM Products WHERE product_description = "yellow"
find the number of rows in appellations table whose Appelation equals Napa
Output: SELECT Count ( * ) FROM appellations WHERE Appelation = "Napa"
find the Name of wine table for which Score greater than 90
Output: SELECT Name FROM wine WHERE Score > 90
Step 1: For each row in Characteristics table, find the corresponding rows in Product_Characteristics table.
Step 2: find the number of rows of each value of Product_Characteristics's characteristic_id in the results of step 1.
Step 3: find characteristic_name of step 1 results with largest value in the results of step 2
Output: SELECT T1.characteristic_name FROM Characteristics AS T1 JOIN Product_Characteristics AS T2 ON T1.characteristic_id = T2.characteristic_id GROUP BY T2.characteristic_id ORDER BY Count ( * ) Desc LIMIT 1
find the number of rows in Player table whose pName equals yes
Output: SELECT Count ( * ) FROM Player WHERE pName = "yes"
find the Name of wine table for which Grape equals Red
Output: SELECT Name FROM wine WHERE Grape = "Red"
Step 1: For each row in Ref_Characteristic_Types table, find the corresponding rows in Characteristics table.
Step 2: find characteristic_type_description of the results of step 1 whose Characteristics's characteristic_type_code equals sesame
Output: SELECT T1.characteristic_type_description FROM Ref_Characteristic_Types AS T1 JOIN Characteristics AS T2 ON T1.characteristic_type_code = T2.characteristic_type_code WHERE T2.characteristic_type_code = "sesame"
Step 1: For each row in Lives_in table, find corresponding rows in Student table and in Dorm table.
Step 2: find the number of rows in the results of step 1 whose gender equals M and Sex equals F
Output: SELECT Count ( * ) FROM Student AS T1 JOIN Dorm AS T2 JOIN Lives_in AS T3 ON T1.StuID = T3.stuid AND T3.dormid = T2.dormid WHERE T2.gender = "M" AND T1.Sex = "F"
Step 1: For each row in movie table, find the corresponding rows in culture_company table.
Step 2: find Title, Company_name of the results of step 1 whose Company_name equals China
Output: SELECT T1.Title , T2.Company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T2.Company_name = "China"
Step 1: find the number of rows of each value of City in branch table.
Step 2: find without repetition City in branch table whose corresponding value in step 1 is greater than or equals 100
Output: SELECT DISTINCT City FROM branch GROUP BY City HAVING Count ( * ) > = 100
Step 1: find the number of rows of each value of Name in member table.
Step 2: find Name of member table ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT Name FROM member GROUP BY Name ORDER BY Count ( * ) Desc LIMIT 3
Step 1: find the number of rows of each value of Product_ID in Invoices table.
Step 2: find Order_ID of Invoices table with largest value in the results of step 1
Output: SELECT Order_ID FROM Invoices GROUP BY Product_ID ORDER BY Count ( * ) Desc LIMIT 1
find the number of rows in Products table whose Price greater than 180 or Price less than 240
Output: SELECT Count ( * ) FROM Products WHERE Price > 240 OR Price < 180
Step 1: find the number of rows of each value of product_id in Products table.
Step 2: find product_id of Products table with largest value in the results of step 1
Output: SELECT product_id FROM Products GROUP BY product_id ORDER BY Count ( * ) Desc LIMIT 1
find each value of Station_ID in station table along with the number of the corresponding rows to each value
Output: SELECT Name , Count ( * ) FROM station GROUP BY Station_ID
Step 1: find the number of rows of each value of Marketing_Region_Code in Stores table.
Step 2: find Marketing_Region_Code of Stores table with largest value in the results of step 1
Output: SELECT Marketing_Region_Code FROM Stores GROUP BY Marketing_Region_Code ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the customer_name of Customers table for which payment_method_code equals 2.
Step 2: find the customer_name of Customers table for which payment_method_code greater than Credit Card.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT customer_name FROM Customers WHERE payment_method_code = 2 INTERSECT SELECT customer_name FROM Customers WHERE payment_method_code > "Credit Card"
find the number of rows in College table
Output: SELECT Count ( * ) FROM College
Step 1: For each row in culture_company table, find corresponding rows in book_club table and in movie table.
Step 2: find Title, Author_or_Editor of the results of step 1 whose movie's Year greater than 1989
Output: SELECT T2.Title , T1.Author_or_Editor FROM book_club AS T1 JOIN movie AS T2 JOIN culture_company AS T3 ON T1.book_club_id = T3.book_club_id AND T3.movie_id = T2.movie_id WHERE T2.Year > 1989
Step 1: For each row in Tryout table, find corresponding rows in College table and in Player table.
Step 2: find College's cName, enr of the results of step 1 whose pName equals yes
Output: SELECT T1.cName , T1.enr FROM College AS T1 JOIN Player AS T2 JOIN Tryout AS T3 ON T1.cName = T3.cName AND T3.pID = T2.pID WHERE T2.pName = "yes"
find the state of College table for which cName equals Charles
Output: SELECT state FROM College WHERE cName = "Charles"
find the cName of Tryout table for which pPos equals mid
Output: SELECT cName FROM Tryout WHERE pPos = "mid"
find the product_name of Products table with largest value of product_price
Output: SELECT product_name FROM Products ORDER BY product_price Desc LIMIT 1
Step 1: find the number of rows of each value of name in stadium table.
Step 2: find name of stadium table with largest value in the results of step 1
Output: SELECT name FROM stadium GROUP BY name ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Tryout table, find corresponding rows in College table and in Player table.
Step 2: find College's cName of the results of step 1 ordered descending by HS.
Step 3: only show the first 3 rows of the results
Output: SELECT T1.cName FROM College AS T1 JOIN Player AS T2 JOIN Tryout AS T3 ON T1.cName = T3.cName AND T3.pID = T2.pID ORDER BY T2.HS Desc LIMIT 3
Step 1: For each row in appellations table, find the corresponding rows in wine table.
Step 2: only keep the results of step 1 whose Year less than 2010.
Step 3: find the number of rows of each value of Area in the results of step 2.
Step 4: find Area of the results of step 2 with largest value in the results of step 3
Output: SELECT T1.Area FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Year < 2010 GROUP BY T1.Area ORDER BY Count ( * ) Desc LIMIT 1
find the name of swimmer table
Output: SELECT name FROM swimmer
Step 1: For each row in Addresses table, find the corresponding rows in Stores table.
Step 2: find State_County of the results of step 1 whose Marketing_Region_Code equals CA or Marketing_Region_Code equals IN
Output: SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = "IN" OR T2.Marketing_Region_Code = "CA"
Step 1: find the number of rows of each value of country in Addresses table.
Step 2: find country in Addresses table whose corresponding value in step 1 is greater than 4
Output: SELECT country FROM Addresses GROUP BY country HAVING Count ( * ) > 4
Step 1: For each row in Tryout table, find corresponding rows in College table and in Player table.
Step 2: find College's cName, enr, state of the results of step 1 whose HS greater than 10000
Output: SELECT T1.cName , T1.enr , T1.state FROM College AS T1 JOIN Player AS T2 JOIN Tryout AS T3 ON T1.cName = T3.cName AND T3.pID = T2.pID WHERE T2.HS > 10000
find the Name of wine table for which Year less than Brander
Output: SELECT Name FROM wine WHERE Year < "Brander"
find the dorm_name, student_capacity of Dorm table with smallest value of dorm_name
Output: SELECT dorm_name , student_capacity FROM Dorm ORDER BY dorm_name Asc LIMIT 1
Step 1: For each row in Customers table, find the corresponding rows in Customer_Orders table.
Step 2: find customer_name, date_became_customer of the results of step 1 whose order_status equals Delivered
Output: SELECT T1.customer_name , T1.date_became_customer FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Delivered"
Step 1: find rows in Student table whose Sex equals F.
Step 2: find each value of Sex in the results of step 1 along with the  the corresponding rows to each value
Output: SELECT Sex , Count ( * ) FROM Student WHERE Sex = "F" GROUP BY Sex
Step 1: For each row in Customers table, find the corresponding rows in Customer_Contact_Channels table.
Step 2: find customer_name, date_became_customer of the results of step 1 whose channel_code equals Email
Output: SELECT T1.customer_name , T1.date_became_customer FROM Customers AS T1 JOIN Customer_Contact_Channels AS T2 ON T1.customer_id = T2.customer_id WHERE T2.channel_code = "Email"
find the Name, Time of train table ordered descending by Time
Output: SELECT Name , Time FROM train ORDER BY Time Desc
Step 1: For each row in Manufacturers table, find the corresponding rows in Products table.
Step 2: find Revenue, Manufacturer of the results of step 1
Output: SELECT T1.Revenue , T2.Manufacturer FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer
find without repetition the Company_name of culture_company table for which Type equals Alyson
Output: SELECT DISTINCT Company_name FROM culture_company WHERE Type = "Alyson"
Step 1: find the number of rows of each value of Name in branch table.
Step 2: find Name of branch table ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT Name FROM branch GROUP BY Name ORDER BY Count ( * ) Desc LIMIT 3
Step 1: For each row in Player table, find the corresponding rows in Tryout table.
Step 2: find the number of different cName in the results of step 1 whose pName equals mid and pPos equals goalie
Output: SELECT Count ( DISTINCT T2.cName ) FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID WHERE T1.pName = "mid" AND T2.pPos = "goalie"
Step 1: find the dormid of Has_amenity table.
Step 2: find the dorm_name of Dorm table whose Dorm's dormid not one of the results of step 1
Output: SELECT T1.dorm_name FROM Dorm AS T1 WHERE T1.dormid NOT IN ( SELECT T2.dormid FROM Has_amenity AS T2 )
Step 1: For each row in membership_register_branch table, find corresponding rows in member table and in branch table.
Step 2: find member's Name, Hometown of the results of step 1 whose Open_year equals 2016
Output: SELECT T1.Name , T1.Hometown FROM member AS T1 JOIN branch AS T2 JOIN membership_register_branch AS T3 ON T1.Member_ID = T3.Member_ID AND T3.Branch_ID = T2.Branch_ID WHERE T2.Open_year = 2016
find without repetition the cName of College table ordered ascending by cName
Output: SELECT DISTINCT cName FROM College ORDER BY cName Asc
find the minimum Order_Quantity and the maximum Order_Quantity in Invoice_Items table
Output: SELECT Min ( Order_Quantity ) , Max ( Order_Quantity ) FROM Invoice_Items
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_id, customer_details in Customers table whose corresponding value in step 1 is greater than or equals 3
Output: SELECT customer_id , customer_details FROM Customers GROUP BY customer_id HAVING Count ( * ) > = 3
find the number of rows in Products table whose Price less than 180
Output: SELECT Count ( * ) FROM Products WHERE Price < 180
find the Customer_Event_ID, date_moved_in, date_moved_in of Customer_Events table
Output: SELECT Customer_Event_ID , date_moved_in , date_moved_in FROM Customer_Events
Step 1: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 2: find without repetition product_name of the results of step 1 whose characteristic_data_type contains warm
Output: SELECT DISTINCT T2.product_name FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T1.characteristic_data_type LIKE "warm"
find the date_moved_in of Residents table with smallest value of date_moved_out
Output: SELECT date_moved_in FROM Residents ORDER BY date_moved_out Asc LIMIT 1
Step 1: find the Location of station table.
Step 2: find the number of rows of each value of Location in station table.
Step 3: find Location in station table whose corresponding value in step 2 is greater than or equals 15.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT Location FROM station EXCEPT SELECT Location FROM station GROUP BY Location HAVING Count ( * ) > = 15
find the Winery, Name of wine table
Output: SELECT Winery , Name FROM wine
Step 1: find the customer_id, customer_name of Customers table for which payment_method_code equals Credit Card.
Step 2: find the customer_id, customer_name of Customers table for which payment_method_code equals WY.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT customer_id , customer_name FROM Customers WHERE payment_method_code = "Credit Card" EXCEPT SELECT customer_id , customer_name FROM Customers WHERE payment_method_code = "WY"
find the amenity_name of Dorm_amenity table ordered ascending by amenity_name
Output: SELECT amenity_name FROM Dorm_amenity ORDER BY amenity_name Asc
Step 1: For each row in Characteristics table, find the corresponding rows in Product_Characteristics table.
Step 2: find the number of rows of each value of Product_Characteristics's characteristic_id in the results of step 1.
Step 3: find characteristic_name in the results of step 1 whose corresponding value in step 2 is greater than or equals 2
Output: SELECT T1.characteristic_name FROM Characteristics AS T1 JOIN Product_Characteristics AS T2 ON T1.characteristic_id = T2.characteristic_id GROUP BY T2.characteristic_id HAVING Count ( * ) > = 2
find the Built, Location of railway table
Output: SELECT Built , Location FROM railway
Step 1: For each row in College table, find the corresponding rows in Tryout table.
Step 2: only keep the results of step 1 whose enr greater than 18000.
Step 3: find the number of rows of each value of Tryout's cName in the results of step 2.
Step 4: find College's cName of the results of step 2 ordered descending by the results of step 3
Output: SELECT T1.cName FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T1.enr > 18000 GROUP BY T2.cName ORDER BY Count ( * ) Desc
find the Name of captain table ordered ascending by age
Output: SELECT Name FROM captain ORDER BY age Asc
find the Name, Score of wine table for which Appelation equals White
Output: SELECT Name , Score FROM wine WHERE Appelation = "White"
find without repetition the state of College table
Output: SELECT DISTINCT state FROM College
find the date_became_customer of Customers table for which customer_name contains Tillman Ernser
Output: SELECT date_became_customer FROM Customers WHERE customer_name LIKE "Tillman Ernser"
find the cName of College table with smallest value of enr
Output: SELECT cName FROM College ORDER BY enr Asc LIMIT 1
Step 1: For each row in membership_register_branch table, find corresponding rows in member table and in branch table.
Step 2: find branch's Name, member's Name of the results of step 1 whose Register_Year greater than 2015
Output: SELECT T2.Name , T1.Name FROM member AS T1 JOIN branch AS T2 JOIN membership_register_branch AS T3 ON T1.Member_ID = T3.Member_ID AND T3.Branch_ID = T2.Branch_ID AND T1.Member_ID = T3.Member_ID WHERE T3.Register_Year > 2015
Step 1: find the number of rows of each value of City_Town in Addresses table.
Step 2: find City_Town in Addresses table whose corresponding value in step 1 is less than or equals 1
Output: SELECT City_Town FROM Addresses GROUP BY City_Town HAVING Count ( * ) < = 1
find the Company_name of culture_company table for which Type equals Alyson
Output: SELECT Company_name FROM culture_company WHERE Type = "Alyson"
find the number of rows in member table whose Level equals 6
Output: SELECT Count ( * ) FROM member WHERE Level = 6
find Name of Products table whose Price greater than 200 or Price less than 240
Output: SELECT Name FROM Products WHERE Price > 240 OR Price < 200
Step 1: find the number of rows of each value of name in swimmer table.
Step 2: find name of swimmer table with largest value in the results of step 1
Output: SELECT name FROM swimmer GROUP BY name ORDER BY Count ( * ) Desc LIMIT 1
find the number of different state in College table
Output: SELECT Count ( DISTINCT state ) FROM College
find the Product_Name of Products table for which Product_Price less than 1000000
Output: SELECT Product_Name FROM Products WHERE Product_Price < 1000000
Step 1: For each row in Staff table, find the corresponding rows in Staff_Department_Assignments table.
Step 2: find staff_name, staff_gender of the results of step 1 whose job_title_code not equals Clerical Staff
Output: SELECT T1.staff_name , T1.staff_gender FROM Staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code ! = "Clerical Staff"
find the Grape, Winery, Year of wine table for which Price greater than 100 ordered descending by Price
Output: SELECT Grape , Winery , Year FROM wine WHERE Price > 100 ORDER BY Price Desc
find the Name, Headquarter of Manufacturers table ordered ascending by Revenue
Output: SELECT Name , Headquarter FROM Manufacturers ORDER BY Revenue Asc
find each value of dorm_name in Dorm table along with the number of the corresponding rows to each value
Output: SELECT dorm_name , Count ( * ) FROM Dorm GROUP BY dorm_name
find the product_name, typical_selling_price of Products table
Output: SELECT product_name , typical_selling_price FROM Products
Step 1: find the staff_id of Staff_Department_Assignments table.
Step 2: find the staff_name, staff_gender of Staff table whose Staff's staff_id not one of the results of step 1
Output: SELECT T1.staff_name , T1.staff_gender FROM Staff AS T1 WHERE T1.staff_id NOT IN ( SELECT T2.staff_id FROM Staff_Department_Assignments AS T2 )
Step 1: find the number of rows of each value of ID in stadium table.
Step 2: find name of stadium table with largest value in the results of step 1
Output: SELECT name FROM stadium GROUP BY ID ORDER BY Count ( * ) Desc LIMIT 1
find each value of Founder in Manufacturers table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , Founder FROM Manufacturers GROUP BY Founder
find the Name of Products table for which Price greater than 200
Output: SELECT Name FROM Products WHERE Price > 200
Step 1: find the Country_ID of roller_coaster table for which Height greater than 3000.
Step 2: find the number of rows in country table whose Country_ID not one of the results of step 1
Output: SELECT Count ( * ) FROM country AS T1 WHERE T1.Country_ID NOT IN ( SELECT T2.Country_ID FROM roller_coaster AS T2 WHERE T2.Height > 3000 )
Step 1: For each row in Tryout table, find corresponding rows in College table and in Player table.
Step 2: find the average HS in the results of step 1 whose state equals no
Output: SELECT Avg ( T2.HS ) FROM College AS T1 JOIN Player AS T2 JOIN Tryout AS T3 ON T1.cName = T3.cName AND T3.pID = T2.pID WHERE T1.state = "no"
find the number of rows in Characteristics table whose characteristic_data_type equals flax
Output: SELECT Count ( * ) FROM Characteristics WHERE characteristic_data_type = "flax"
Step 1: For each row in Manufacturers table, find the corresponding rows in Products table.
Step 2: find Manufacturers's Name, Revenue of the results of step 1 with smallest value of Price
Output: SELECT T1.Name , T1.Revenue FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer ORDER BY T2.Price Asc LIMIT 1
find the number of rows in book_club table
Output: SELECT Count ( * ) FROM book_club
find each value of Headquarter in Manufacturers table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , Headquarter FROM Manufacturers GROUP BY Headquarter
find the Name of event table with largest value of Year
Output: SELECT Name FROM event ORDER BY Year Desc LIMIT 1
find the number of rows in Student table whose Age less than 25
Output: SELECT Count ( * ) FROM Student WHERE Age < 25
find without repetition the membership_amount of branch table
Output: SELECT DISTINCT membership_amount FROM branch
Step 1: find the cName of Tryout table.
Step 2: find the pName, HS of Player table whose Player's pID one of the results of step 1
Output: SELECT T1.pName , T1.HS FROM Player AS T1 WHERE T1.pID IN ( SELECT T2.cName FROM Tryout AS T2 )
find Starting_Year of technician table whose Team equals CWS or Team equals CLE
Output: SELECT Starting_Year FROM technician WHERE Team = "CLE" OR Team = "CWS"
Step 1: For each row in Documents table, find corresponding rows in Ref_Document_Status table and in Documents_Mailed table.
Step 2: find document_status_description of the results of step 1 whose Documents_Mailed's document_id equals 1
Output: SELECT T1.document_status_description FROM Ref_Document_Status AS T1 JOIN Documents AS T2 ON T1.document_status_code = T2.document_status_code JOIN Documents_Mailed AS T3 ON T2.document_id = T3.document_id WHERE T3.document_id = 1
Step 1: For each row in Documents table, find corresponding rows in Ref_Shipping_Agents table and in Documents_Mailed table.
Step 2: find shipping_agent_name of the results of step 1 whose Documents_Mailed's document_id equals 2
Output: SELECT T1.shipping_agent_name FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T1.shipping_agent_code = T2.shipping_agent_code JOIN Documents_Mailed AS T3 ON T2.document_id = T3.document_id WHERE T3.document_id = 2
Step 1: find the number of rows of each value of Storm_ID 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 Storm_ID HAVING Count ( * ) > = 1
Step 1: For each row in musical table, find the corresponding rows in actor table.
Step 2: find Nominee of the results of step 1 whose actor's Name equals Tony Award.
Step 3: find Nominee of the results of step 1 whose actor's Name equals Drama Desk Award.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.Nominee FROM musical AS T1 JOIN actor AS T2 WHERE T2.Name = "Tony Award" INTERSECT SELECT T1.Nominee FROM musical AS T1 JOIN actor AS T2 WHERE T2.Name = "Drama Desk Award"
Step 1: find the summation of tot_cred of each value of dept_name in student table.
Step 2: find name, dept_name of student table ordered ascending by the results of step 1
Output: SELECT name , dept_name FROM student GROUP BY dept_name ORDER BY Sum ( tot_cred ) Asc
Step 1: find the summation of tot_cred of each value of dept_name in student table.
Step 2: find dept_name of student table with largest value in the results of step 1
Output: SELECT dept_name FROM student GROUP BY dept_name ORDER BY Sum ( tot_cred ) Desc LIMIT 1
find the maximum Milliseconds and the minimum Milliseconds in Track table
Output: SELECT Max ( Milliseconds ) , Min ( Milliseconds ) FROM Track
find each value of employee_id in Circulation_History table along with the number of the corresponding rows to each value
Output: SELECT employee_id , Count ( * ) FROM Circulation_History GROUP BY employee_id
find the Team_Name of basketball_match table ordered descending by Team_Name
Output: SELECT Team_Name FROM basketball_match ORDER BY Team_Name Desc
Step 1: For each row in Discount_Coupons table, find the corresponding rows in Customers table.
Step 2: find coupon_amount of the results of step 1 whose first_name equals good.
Step 3: find coupon_amount of the results of step 1 whose first_name equals bad.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN Customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.first_name = "good" INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN Customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.first_name = "bad"
Step 1: For each row in races table, find corresponding rows in circuits table and in constructorStandings table.
Step 2: find the maximum positionText in the results of step 1 whose country equals Monaco Grand Prix
Output: SELECT Max ( T3.positionText ) FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId JOIN constructorStandings AS T3 ON T2.raceId = T3.raceId WHERE T1.country = "Monaco Grand Prix"
find the country of circuits table ordered ascending by country
Output: SELECT country FROM circuits ORDER BY country Asc
Step 1: find the Company of entrepreneur table.
Step 2: For each row in people table, find the corresponding rows in entrepreneur table.
Step 3: find Company of the results of step 2 whose Name equals Rachel Elnaugh.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.Company FROM entrepreneur AS T1 EXCEPT SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Name = "Rachel Elnaugh"
find the average Milliseconds and the average Milliseconds in Track table
Output: SELECT Avg ( Milliseconds ) , Avg ( Milliseconds ) FROM Track
find the student_id of Student_Course_Registrations table
Output: SELECT student_id FROM Student_Course_Registrations
find each value of Name in actor table along with the number of the corresponding rows to each value
Output: SELECT Name , Count ( * ) FROM actor GROUP BY Name
find the first_name, last_name of People table
Output: SELECT first_name , last_name FROM People
find the constructorStandingsId, constructorId of constructorStandings table with largest value of constructorId
Output: SELECT constructorStandingsId , constructorId FROM constructorStandings ORDER BY constructorId Desc LIMIT 1
Step 1: find the number of rows of each value of id in browser table.
Step 2: find id, name of browser table with largest value in the results of step 1
Output: SELECT id , name FROM browser GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
find School of university table whose Founded equals 1850 or Founded less than Public
Output: SELECT School FROM university WHERE Founded = "Public" OR Founded < 1850
find without repetition the country of circuits table for which circuitRef equals or between 2014 and 2017
Output: SELECT DISTINCT country FROM circuits WHERE circuitRef BETWEEN 2017 AND 2014
Step 1: For each row in Customer table, find the corresponding rows in Invoice table.
Step 2: find without repetition FirstName of the results of step 1 whose BillingCountry equals Brazil
Output: SELECT DISTINCT T1.FirstName FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.BillingCountry = "Brazil"
Step 1: find the cmi_cross_ref_id of CMI_Cross_References table.
Step 2: find the cmi_cross_ref_id of Rent_Arrears 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.cmi_cross_ref_id FROM CMI_Cross_References AS T1 EXCEPT SELECT T2.cmi_cross_ref_id FROM Rent_Arrears AS T2
find the average Damage_millions_USD and the maximum Damage_millions_USD in storm table whose Max_speed greater than or equals 1000
Output: SELECT Avg ( Damage_millions_USD ) , Max ( Damage_millions_USD ) FROM storm WHERE Max_speed > = 1000
find country of circuits table whose lat greater than 2017 and circuitRef equals Spain
Output: SELECT country FROM circuits WHERE lat > 2017 AND circuitRef = "Spain"
Step 1: find the number of rows of each value of Investor in entrepreneur table.
Step 2: find Company of entrepreneur table with largest value in the results of step 1
Output: SELECT Company FROM entrepreneur GROUP BY Investor ORDER BY Count ( * ) Desc LIMIT 1
find the Character, Name of actor table
Output: SELECT Character , Name FROM actor
find the number of different Region_code in region table
Output: SELECT Count ( DISTINCT Region_code ) FROM region
find the Investor of entrepreneur table ordered descending by Money_Requested
Output: SELECT Investor FROM entrepreneur ORDER BY Money_Requested Desc
find the product_description of Products_for_Hire table for which product_name equals 102.76
Output: SELECT product_description FROM Products_for_Hire WHERE product_name = 102.76
Step 1: find the Membership_card of member table for which member's Address equals Hartford.
Step 2: For each row in shop table, find the corresponding rows in member table.
Step 3: find Membership_card of the results of step 2 whose shop's Address equals Waterbury.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.Membership_card FROM member AS T1 WHERE T1.Address = "Hartford" INTERSECT SELECT T1.Membership_card FROM shop AS T2 JOIN member AS T1 WHERE T2.Address = "Waterbury"