niryuu/sni-each-converted huggingface dataset:
find the number of rows in Claim_Headers table whose Claim_Type_Code equals Handphone Subsidy
Output: SELECT Count ( * ) FROM Claim_Headers WHERE Claim_Type_Code = "Handphone Subsidy"
Step 1: find the number of rows of each value of billing_state in invoices table.
Step 2: find billing_state of invoices table with largest value in the results of step 1
Output: SELECT billing_state FROM invoices GROUP BY billing_state ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Policies table, find corresponding rows in Customers table and in Claim_Headers table.
Step 2: find Customers's Customer_ID of the results of step 1 whose Claim_Status_Code equals Deputy or Claim_Status_Code equals Uniform
Output: SELECT T1.Customer_ID FROM Customers AS T1 JOIN Policies AS T2 ON T1.Customer_ID = T2.Customer_ID JOIN Claim_Headers AS T3 ON T2.Policy_ID = T3.Policy_ID WHERE T3.Claim_Status_Code = "Uniform" OR T3.Claim_Status_Code = "Deputy"
find the Candidate_ID, Unsure_rate, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Candidate_ID , Unsure_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
Step 1: For each row in station table, find the corresponding rows in trip table.
Step 2: find each value of start_station_id in the results of step 1 along with the average duration of the corresponding rows to each value
Output: SELECT T1.name , Avg ( T2.duration ) FROM station AS T1 JOIN trip AS T2 GROUP BY T2.start_station_id
Step 1: For each row in Has_Allergy table, find corresponding rows in Allergy_Type table and in Student table.
Step 2: find the number of rows in the results of step 1 whose Sex equals F or AllergyType equals Milk
Output: SELECT Count ( * ) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T3.Sex = "F" OR T1.AllergyType = "Milk"
Step 1: find the date of weather table ordered descending by min_humidity.
Step 2: only show the first 5 rows of the results
Output: SELECT date FROM weather ORDER BY min_humidity Desc LIMIT 5
find the number of different Sex in Student table
Output: SELECT Count ( DISTINCT Sex ) FROM Student
Step 1: find rows in employees table whose city equals IT Staff.
Step 2: find each value of city in the results of step 1 along with the  the corresponding rows to each value
Output: SELECT city , Count ( * ) FROM employees WHERE city = "IT Staff" GROUP BY city
Step 1: For each row in ACCOUNTS table, find corresponding rows in SAVINGS table and in CHECKING table.
Step 2: find name, CHECKING's balance of the results of step 1 ordered ascending by SAVINGS's balance.
Step 3: only show the first row of the results
Output: SELECT T1.name , T3.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid JOIN CHECKING AS T3 ON T1.custid = T3.custid ORDER BY T2.balance Asc LIMIT 1
find the name, city, long of station table with largest value of long
Output: SELECT name , city , long FROM station ORDER BY long Desc LIMIT 1
find each value of city in employees table along with the number of the corresponding rows to each value
Output: SELECT city , Count ( * ) FROM employees GROUP BY city
find the date of weather table for which min_temperature_f greater than 85
Output: SELECT date FROM weather WHERE min_temperature_f > 85
Step 1: For each row in station_company table, find corresponding rows in company table and in gas_station table.
Step 2: find Location, Representative_Name of the results of step 1 ordered descending by Sales_billion.
Step 3: only show the first 3 rows of the results
Output: SELECT T2.Location , T2.Representative_Name FROM company AS T1 JOIN gas_station AS T2 JOIN station_company AS T3 ON T1.Company_ID = T3.Company_ID AND T3.Station_ID = T2.Station_ID ORDER BY T1.Sales_billion Desc LIMIT 3
Step 1: For each row in station_company table, find corresponding rows in company table and in gas_station table.
Step 2: find Location of the results of step 1 whose Sales_billion greater than 100
Output: SELECT T2.Location FROM company AS T1 JOIN gas_station AS T2 JOIN station_company AS T3 ON T1.Company_ID = T3.Company_ID AND T3.Station_ID = T2.Station_ID WHERE T1.Sales_billion > 100
Step 1: find without repetition the name of station table.
Step 2: find without repetition the name of station table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT DISTINCT name FROM station EXCEPT SELECT DISTINCT name FROM station
Step 1: find the Position of pilot table for which Join_Year greater than 2000.
Step 2: find the Position of pilot table for which Join_Year less than 2005.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Position FROM pilot WHERE Join_Year > 2000 INTERSECT SELECT Position FROM pilot WHERE Join_Year < 2005
Step 1: find the number of rows in Student table whose Age greater than 18 and Sex equals food.
Step 2: find the Sex of Student table for which Age greater than 18.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Count ( * ) FROM Student WHERE Age > 18 AND Sex = "food" EXCEPT SELECT Sex FROM Student WHERE Age > 18
Step 1: For each row in genres table, find the corresponding rows in tracks table.
Step 2: find tracks's name of the results of step 1 whose genres's name equals MPEG audio file.
Step 3: find tracks's name of the results of step 1 whose genres's name equals Rock.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "MPEG audio file" INTERSECT SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock"
Step 1: For each row in station table, find the corresponding rows in trip table.
Step 2: find station's id, name of the results of step 1 whose duration greater than or equals 200
Output: SELECT T1.id , T1.name FROM station AS T1 JOIN trip AS T2 WHERE T2.duration > = 200
Step 1: find the number of rows of each value of Customer_Details in Customers table.
Step 2: find Customer_Details of Customers table with largest value in the results of step 1
Output: SELECT Customer_Details FROM Customers GROUP BY Customer_Details ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the number of rows of each value of Event_ID in Events table.
Step 2: find Event_ID, Event_Details in Events table whose corresponding value in step 1 is greater than 1
Output: SELECT Event_ID , Event_Details FROM Events GROUP BY Event_ID HAVING Count ( * ) > 1
find the summation of total and the summation of total in invoices table
Output: SELECT Sum ( total ) , Sum ( total ) FROM invoices
Step 1: For each row in Policies table, find corresponding rows in Customers table and in Claim_Headers table.
Step 2: find the summation of Amount_Claimed of each value of Customer_Details in the results of step 1.
Step 3: find Customer_Details of the results of step 1 with largest value in the results of step 2
Output: SELECT T1.Customer_Details FROM Customers AS T1 JOIN Policies AS T2 ON T1.Customer_ID = T2.Customer_ID JOIN Claim_Headers AS T3 ON T2.Policy_ID = T3.Policy_ID GROUP BY T1.Customer_Details ORDER BY Sum ( T3.Amount_Claimed ) Desc LIMIT 1
find without repetition the Fname of Student table for which Sex equals F
Output: SELECT DISTINCT Fname FROM Student WHERE Sex = "F"
find the start_date of trip table for which duration equals or between 30.3 and 31
Output: SELECT start_date FROM trip WHERE duration BETWEEN 31 AND 30.3
Step 1: find the name of station table for which city equals 10.
Step 2: find the name of station table for which city equals San Jose.
Step 3: show the rows that are in any of the results of step 1 or the results of step 2
Output: SELECT name FROM station WHERE city = 10 UNION SELECT name FROM station WHERE city = "San Jose"
find the summation of Adults in Reservations table whose FirstName equals ROY and LastName equals SWEAZY
Output: SELECT Sum ( Adults ) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY"
Step 1: find rows in trip table whose start_station_name equals 8/%.
Step 2: find each value of start_date the results of step 1 along with the average duration of the corresponding rows to each value
Output: SELECT Avg ( duration ) , start_date FROM trip WHERE start_station_name = "8/%" GROUP BY start_date
Step 1: find the Headquarters of company table.
Step 2: find the Headquarters of company table for which Company equals Banking.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Headquarters FROM company EXCEPT SELECT Headquarters FROM company WHERE Company = "Banking"
find the number of rows in Participants table whose Participant_Details equals Dr.
Output: SELECT Count ( * ) FROM Participants WHERE Participant_Details = "Dr."
find each value of Company_ID in company table along with the number of the corresponding rows to each value
Output: SELECT Company , Count ( * ) FROM company GROUP BY Company_ID
Step 1: find the number of rows of each value of state in employees table.
Step 2: find first_name, last_name of employees table ordered descending by the results of step 1.
Step 3: only show the first 10 rows of the results
Output: SELECT first_name , last_name FROM employees GROUP BY state ORDER BY Count ( * ) Desc LIMIT 10
Step 1: find the Headquarters of company table for which Main_Industry equals Banking.
Step 2: find the Headquarters of company table for which Company equals Oil and gas.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Headquarters FROM company WHERE Main_Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Company = "Oil and gas"
find the start_date of trip table
Output: SELECT start_date FROM trip
Step 1: For each row in trip table, find the corresponding rows in weather table.
Step 2: find start_date of the results of step 1 whose min_temperature_f greater than 85
Output: SELECT T1.start_date FROM trip AS T1 JOIN weather AS T2 WHERE T2.min_temperature_f > 85
find the summation of milliseconds in tracks table
Output: SELECT Sum ( milliseconds ) FROM tracks
Step 1: find the Headquarters of company table for which Company equals Banking.
Step 2: find the Headquarters of company table for which Company equals Oil and gas.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Headquarters FROM company WHERE Company = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Company = "Oil and gas"
Step 1: For each row in station table, find the corresponding rows in trip table.
Step 2: find start_station_id, name, subscription_type of the results of step 1
Output: SELECT T2.start_station_id , T1.name , T2.subscription_type FROM station AS T1 JOIN trip AS T2
Step 1: For each row in employees table, find the corresponding rows in customers table.
Step 2: find hire_date of the results of step 1 whose customers's last_name equals Lucas
Output: SELECT T1.hire_date FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id WHERE T2.last_name = "Lucas"
find without repetition the AllergyType of Allergy_Type table
Output: SELECT DISTINCT AllergyType FROM Allergy_Type
find the Rank, Company, Market_Value of company table for which Main_Industry equals Banking ordered ascending by Sales_billion
Output: SELECT Rank , Company , Market_Value FROM company WHERE Main_Industry = "Banking" ORDER BY Sales_billion Asc
Step 1: find the number of rows of each value of id in architect table.
Step 2: find id, name in architect table whose corresponding value in step 1 is greater than or equals 3
Output: SELECT id , name FROM architect GROUP BY id HAVING Count ( * ) > = 3
find the Firstname, Lastname of Band table for which Firstname equals Le Pop
Output: SELECT Firstname , Lastname FROM Band WHERE Firstname = "Le Pop"
Step 1: find the Major of Student table.
Step 2: find the DName of Department table whose DNO not one of the results of step 1
Output: SELECT T1.DName FROM Department AS T1 WHERE T1.DNO NOT IN ( SELECT T2.Major FROM Student AS T2 )
find the Famous_Title of artist table for which Famous_Release_date equals Triumfall
Output: SELECT Famous_Title FROM artist WHERE Famous_Release_date = "Triumfall"
find the bedType, roomName of Rooms table
Output: SELECT bedType , roomName FROM Rooms
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find FIRST_NAME, LAST_NAME of the results of step 1 whose SALARY greater than 24000 and JOB_TITLE equals PU_MAN
Output: SELECT T2.FIRST_NAME , T2.LAST_NAME FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 24000 AND T1.JOB_TITLE = "PU_MAN"
find the Document_Type_Name, Document_Type_Name, Document_Type_Description of Ref_Document_Types table
Output: SELECT Document_Type_Name , Document_Type_Name , Document_Type_Description FROM Ref_Document_Types
Step 1: find the FIRST_NAME, LAST_NAME of employees table.
Step 2: find the FIRST_NAME, LAST_NAME of employees table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT FIRST_NAME , LAST_NAME FROM employees EXCEPT SELECT FIRST_NAME , LAST_NAME FROM employees
find the maximum Adults and the summation of Kids in Reservations table
Output: SELECT Max ( Adults ) , Sum ( Kids ) FROM Reservations
find the number of rows in Product table whose product_name equals voluptatem
Output: SELECT Count ( * ) FROM Product WHERE product_name = "voluptatem"
Step 1: For each row in Product table, find the corresponding rows in Problems table.
Step 2: find rows in the results of step 1 whose date_problem_closed greater than 1986-11-13.
Step 3: find each value of Product's product_id the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , T1.product_id FROM Product AS T1 JOIN Problems AS T2 ON T1.product_id = T2.product_id WHERE T2.date_problem_closed > "1986-11-13" GROUP BY T1.product_id
Step 1: For each row in Asset_Parts table, find corresponding rows in Parts table and in Assets table.
Step 2: find chargeable_amount of the results of step 1 ordered ascending by asset_details
Output: SELECT T1.chargeable_amount FROM Parts AS T1 JOIN Assets AS T2 JOIN Asset_Parts AS T3 ON T1.part_id = T3.part_id AND T3.asset_id = T2.asset_id ORDER BY T2.asset_details Asc
Step 1: find the number of rows of each value of Project_ID in Projects table.
Step 2: find Project_ID in Projects table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT Project_ID FROM Projects GROUP BY Project_ID HAVING Count ( * ) > = 2
Step 1: For each row in AssignedTo table, find corresponding rows in Scientists table and in Projects table.
Step 2: find Projects's Name, Scientists's Name, Hours of the results of step 1 ordered ascending by Scientists's Name
Output: SELECT T2.Name , T1.Name , T2.Hours FROM Scientists AS T1 JOIN Projects AS T2 JOIN AssignedTo AS T3 ON T1.SSN = T3.Scientist AND T3.Project = T2.Code ORDER BY T1.Name Asc
find the number of rows in Vocals table whose Type equals Le Pop
Output: SELECT Count ( * ) FROM Vocals WHERE Type = "Le Pop"
Step 1: For each row in Instruments table, find corresponding rows in Songs table and in Band table.
Step 2: find Firstname, Lastname of the results of step 1 whose Title equals Der Kapitan
Output: SELECT T2.Firstname , T2.Lastname FROM Songs AS T1 JOIN Band AS T2 JOIN Instruments AS T3 ON T1.SongId = T3.SongId AND T3.BandmateId = T2.Id WHERE T1.Title = "Der Kapitan"
Step 1: For each row in hosting_city table, find corresponding rows in city table and in match table.
Step 2: find City of the results of step 1 whose Competition equals 1994 FIFA World Cup qualification and Competition equals Friendly match
Output: SELECT T1.City FROM city AS T1 JOIN match AS T2 JOIN hosting_city AS T3 ON T1.City_ID = T3.Host_City AND T3.Match_ID = T2.Match_ID WHERE T2.Competition = "Friendly match" AND T2.Competition = "1994 FIFA World Cup qualification"
find the number of rows in Products table
Output: SELECT Count ( * ) FROM Products
find the gradepoint, gradepoint of Gradeconversion table for which lettergrade contains A
Output: SELECT gradepoint , gradepoint FROM Gradeconversion WHERE lettergrade LIKE "A"
find name of Person table whose job equals Alice and gender equals female
Output: SELECT name FROM Person WHERE job = "Alice" AND gender = "female"
Step 1: find the EMPLOYEE_ID of job_history table.
Step 2: find the rows of employees table whose employees's EMPLOYEE_ID not one of the results of step 1
Output: SELECT * FROM employees AS T1 WHERE T1.EMPLOYEE_ID NOT IN ( SELECT T2.EMPLOYEE_ID FROM job_history AS T2 )
find name of Person table whose job equals Zach and gender equals female
Output: SELECT name FROM Person WHERE job = "Zach" AND gender = "female"
Step 1: For each row in Staff table, find the corresponding rows in Problem_Log table.
Step 2: find log_entry_description of the results of step 1 whose staff_first_name equals Christop
Output: SELECT T1.log_entry_description FROM Problem_Log AS T1 JOIN Staff AS T2 ON T1.assigned_to_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop"
Step 1: find the City of city table for which City_ID greater than 1.
Step 2: For each row in city table, find the corresponding rows in hosting_city table.
Step 3: find City of the results of step 2 whose Year equals 2008.
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 city AS T1 WHERE T1.City_ID > 1 EXCEPT SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008
find the number of different city in Person table
Output: SELECT Count ( DISTINCT city ) FROM Person
Step 1: For each row in city table, find the corresponding rows in hosting_city table.
Step 2: find City of the results of step 1 whose City equals Shanghai and Year equals 2008
Output: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T1.City = "Shanghai" AND T2.Year = 2008
find City of city table whose Regional_Population greater than 5000000 or Regional_Population less than 10000000
Output: SELECT City FROM city WHERE Regional_Population > 10000000 OR Regional_Population < 5000000
find the number of rows in Student table whose Major equals B
Output: SELECT Count ( * ) FROM Student WHERE Major = "B"
Step 1: find the Fname, Lname of Faculty table ordered descending by Rank.
Step 2: only show the first 3 rows of the results
Output: SELECT Fname , Lname FROM Faculty ORDER BY Rank Desc LIMIT 3
find the number of rows in Person table whose age greater than 30
Output: SELECT Count ( * ) FROM Person WHERE age > 30
find each value of name in airport table along with the number of the corresponding rows to each value
Output: SELECT name , Count ( * ) FROM airport GROUP BY name
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find the  rows in the results of step 1 whose SALARY less than or equals D ordered descending by MIN_SALARY
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY < = "D" ORDER BY T1.MIN_SALARY Desc
Step 1: For each row in Student table, find the corresponding rows in Enrolled_in table.
Step 2: find the average Grade in the results of step 1 whose LName equals Smith
Output: SELECT Avg ( T2.Grade ) FROM Student AS T1 JOIN Enrolled_in AS T2 ON T1.StuID = T2.StuID WHERE T1.LName = "Smith"
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find EMPLOYEE_ID, FIRST_NAME, LAST_NAME of the results of step 1 whose JOB_TITLE equals President.
Step 3: find EMPLOYEE_ID, FIRST_NAME, LAST_NAME of the results of step 1 whose JOB_TITLE equals PU_MAN.
Step 4: show the rows that are in any of the results of step 2 or the results of step 3
Output: SELECT T2.EMPLOYEE_ID , T2.FIRST_NAME , T2.LAST_NAME FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.JOB_TITLE = "President" UNION SELECT T2.EMPLOYEE_ID , T2.FIRST_NAME , T2.LAST_NAME FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.JOB_TITLE = "PU_MAN"
Step 1: For each row in Band table, find the corresponding rows in Performance table.
Step 2: find Firstname, Lastname of the results of step 1 whose StagePosition equals Der Kapitan
Output: SELECT T1.Firstname , T1.Lastname FROM Band AS T1 JOIN Performance AS T2 ON T1.Id = T2.Bandmate WHERE T2.StagePosition = "Der Kapitan"
find the asset_id, asset_details, other_asset_details of Assets table
Output: SELECT asset_id , asset_details , other_asset_details FROM Assets
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find Person's name of the results of step 1 whose friend equals Alice
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = "Alice"
Step 1: For each row in Problems table, find corresponding rows in Product table and in Staff table.
Step 2: find product_name of the results of step 1 whose staff_last_name equals Champlin and staff_first_name equals Lacey.
Step 3: find product_name of the results of step 1 whose staff_first_name equals Kenton.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.product_name FROM Product AS T1 JOIN Staff AS T2 JOIN Problems AS T3 ON T1.product_id = T3.product_id AND T3.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Champlin" AND T2.staff_first_name = "Lacey" INTERSECT SELECT T1.product_name FROM Product AS T1 JOIN Staff AS T2 JOIN Problems AS T3 ON T1.product_id = T3.product_id AND T3.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Kenton"
Step 1: For each row in artist table, find the corresponding rows in volume table.
Step 2: find Song of the results of step 1 whose Famous_Release_date equals Triumfall
Output: SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Famous_Release_date = "Triumfall"
Step 1: For each row in Documents_to_be_Destroyed table, find corresponding rows in All_Documents table and in Employees table.
Step 2: find Employee_Name, Document_Name of the results of step 1
Output: SELECT T2.Employee_Name , T1.Document_Name FROM All_Documents AS T1 JOIN Employees AS T2 JOIN Documents_to_be_Destroyed AS T3 ON T1.Document_ID = T3.Document_ID AND T3.Destroyed_by_Employee_ID = T2.Employee_ID
Step 1: For each row in Roles table, find the corresponding rows in Employees table.
Step 2: find Employee_ID of the results of step 1 whose Role_Name not equals Human Resource
Output: SELECT T2.Employee_ID FROM Roles AS T1 JOIN Employees AS T2 ON T1.Role_Code = T2.Role_Code WHERE T1.Role_Name ! = "Human Resource"
Step 1: For each row in employees table, find the corresponding rows in locations table.
Step 2: find FIRST_NAME, LAST_NAME, HIRE_DATE of the results of step 1 whose CITY equals Clara
Output: SELECT T1.FIRST_NAME , T1.LAST_NAME , T1.HIRE_DATE FROM employees AS T1 JOIN locations AS T2 WHERE T2.CITY = "Clara"
Step 1: find the number of rows of each value of Music_Festival in music_festival table.
Step 2: find Date_of_ceremony in music_festival table whose corresponding value in step 1 is greater than 2
Output: SELECT Date_of_ceremony FROM music_festival GROUP BY Music_Festival HAVING Count ( * ) > 2
Step 1: For each row in Member_of_club table, find corresponding rows in Student table and in Club table.
Step 2: find ClubName of the results of step 1 whose Fname equals Davis
Output: SELECT T2.ClubName FROM Student AS T1 JOIN Club AS T2 JOIN Member_of_club AS T3 ON T1.StuID = T3.StuID AND T3.ClubID = T2.ClubID WHERE T1.Fname = "Davis"
Step 1: find the rows of employees table ordered ascending by SALARY.
Step 2: only show the first 2500 rows of the results
Output: SELECT * FROM employees ORDER BY SALARY Asc LIMIT 2500
find the name, age of Person table ordered ascending by gender
Output: SELECT name , age FROM Person ORDER BY gender Asc
Step 1: find the number of rows of each value of Rank, Lname in Faculty table.
Step 2: find Fname, Lname of Faculty table ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT Fname , Lname FROM Faculty GROUP BY Rank , Lname ORDER BY Count ( * ) Desc LIMIT 3
Step 1: For each row in volume table, find the corresponding rows in music_festival table.
Step 2: find Volume of the results of step 1 with largest value of Weeks_on_Top
Output: SELECT T2.Volume FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume ORDER BY T1.Weeks_on_Top Desc LIMIT 1
find the number of rows in Student table whose Fname equals Bootup Baltimore and Age greater than 18
Output: SELECT Count ( * ) FROM Student WHERE Fname = "Bootup Baltimore" AND Age > 18
Step 1: find the name of Person table.
Step 2: find the name of Person 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 Person EXCEPT SELECT name FROM Person
find the FIRST_NAME, LAST_NAME of employees table for which FIRST_NAME contains z
Output: SELECT FIRST_NAME , LAST_NAME FROM employees WHERE FIRST_NAME LIKE "z"
find the number of rows in Student table whose Fname equals Tracy and LName equals Kim
Output: SELECT Count ( * ) FROM Student WHERE Fname = "Tracy" AND LName = "Kim"
Step 1: For each row in employees table, find the corresponding rows in locations table.
Step 2: find FIRST_NAME, LAST_NAME, SALARY of the results of step 1 whose CITY equals London
Output: SELECT T1.FIRST_NAME , T1.LAST_NAME , T1.SALARY FROM employees AS T1 JOIN locations AS T2 WHERE T2.CITY = "London"
find the number of different Artist in artist table
Output: SELECT Count ( DISTINCT Artist ) FROM artist
find the HIRE_DATE of employees table for which FIRST_NAME not equals M
Output: SELECT HIRE_DATE FROM employees WHERE FIRST_NAME ! = "M"
Step 1: find the number of rows of each value of DEPARTMENT_NAME in departments table.
Step 2: find DEPARTMENT_NAME in departments table whose corresponding value in step 1 is greater than or equals 1
Output: SELECT DEPARTMENT_NAME FROM departments GROUP BY DEPARTMENT_NAME HAVING Count ( * ) > = 1
Step 1: For each row in Member_of table, find corresponding rows in Faculty table and in Department table.
Step 2: find Department's Room of the results of step 1 whose Rank equals Professor and Faculty's Building equals NEB
Output: SELECT T2.Room FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T1.Rank = "Professor" AND T1.Building = "NEB"
Step 1: For each row in Problems table, find corresponding rows in Product table and in Staff table.
Step 2: find product_name of the results of step 1 whose staff_first_name equals Champlin and staff_first_name equals Lacey.
Step 3: find product_name of the results of step 1 whose staff_first_name equals Kenton.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.product_name FROM Product AS T1 JOIN Staff AS T2 JOIN Problems AS T3 ON T1.product_id = T3.product_id AND T3.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Lacey" AND T2.staff_first_name = "Champlin" INTERSECT SELECT T1.product_name FROM Product AS T1 JOIN Staff AS T2 JOIN Problems AS T3 ON T1.product_id = T3.product_id AND T3.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Kenton"
find the City of city table with largest value of Regional_Population
Output: SELECT City FROM city ORDER BY Regional_Population Desc LIMIT 1
find the Industry of Companies table ordered descending by Industry
Output: SELECT Industry FROM Companies ORDER BY Industry Desc
find the Document_ID of Documents table for which Document_Description equals Government
Output: SELECT Document_ID FROM Documents WHERE Document_Description = "Government"
find each value of maintenance_contract_id in Maintenance_Contracts table along with the number of the corresponding rows to each value
Output: SELECT maintenance_contract_company_id , Count ( * ) FROM Maintenance_Contracts GROUP BY maintenance_contract_id
find EMAIL of employees table whose SALARY greater than or equals 7000 and SALARY less than or equals 12000
Output: SELECT EMAIL FROM employees WHERE SALARY > = 12000 AND SALARY < = 7000
Step 1: find the rows of jobs table for which MIN_SALARY greater than 20000.
Step 2: find the JOB_TITLE of jobs table for which MAX_SALARY greater than 12000.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT * FROM jobs WHERE MIN_SALARY > 20000 INTERSECT SELECT JOB_TITLE FROM jobs WHERE MAX_SALARY > 12000
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find rows in the results of step 1 whose age greater than engineer.
Step 3: find the number of rows of each value of friend in step 1 rsults.
Step 4: find Person's name in the results of step 1 whose corresponding value in step 2 is greater than or equals 1
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.age > "engineer" GROUP BY T2.friend HAVING Count ( * ) > = 1
Step 1: find the number of rows of each value of Title in Songs table.
Step 2: find Title of Songs table with largest value in the results of step 1
Output: SELECT Title FROM Songs GROUP BY Title ORDER BY Count ( * ) Desc LIMIT 1
find the COUNTRY_ID, COUNTRY_NAME of countries table
Output: SELECT COUNTRY_ID , COUNTRY_NAME FROM countries
find the Author, Scores of submission table
Output: SELECT Author , Scores FROM submission
find the Document_ID of Documents table for which Document_Type_Code equals SF
Output: SELECT Document_ID FROM Documents WHERE Document_Type_Code = "SF"
Step 1: For each row in Third_Party_Companies table, find the corresponding rows in Maintenance_Contracts table.
Step 2: find company_name of the results of step 1 with smallest value of contract_end_date
Output: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id ORDER BY T2.contract_end_date Asc LIMIT 1
find the FIRST_NAME, LAST_NAME of employees table for which LAST_NAME contains z
Output: SELECT FIRST_NAME , LAST_NAME FROM employees WHERE LAST_NAME LIKE "z"
find Venue of match table whose Competition equals Nanjing ( Jiangsu ) and Score equals 1994 FIFA World Cup qualification
Output: SELECT Venue FROM match WHERE Competition = "Nanjing ( Jiangsu )" AND Score = "1994 FIFA World Cup qualification"
Step 1: For each row in film_market_estimation table, find corresponding rows in film table and in market table.
Step 2: find Country, Year of the results of step 1 whose Title equals ET the Extra-Terrestrial
Output: SELECT T2.Country , T3.Year FROM film AS T1 JOIN market AS T2 JOIN film_market_estimation AS T3 ON T1.Film_ID = T3.Film_ID AND T3.Market_ID = T2.Market_ID AND T1.Film_ID = T3.Film_ID WHERE T1.Title = "ET the Extra-Terrestrial"
Step 1: For each row in Ref_Locations table, find the corresponding rows in Document_Locations table.
Step 2: find Date_in_Locaton_To of the results of step 1 whose Location_Name equals Robin CV and Location_Name equals Brazil
Output: SELECT T2.Date_in_Locaton_To FROM Ref_Locations AS T1 JOIN Document_Locations AS T2 ON T1.Location_Code = T2.Location_Code WHERE T1.Location_Name = "Brazil" AND T1.Location_Name = "Robin CV"
find the number of different Title in Songs table
Output: SELECT Count ( DISTINCT Title ) FROM Songs
find the Host_City of hosting_city table ordered descending by Year
Output: SELECT Host_City FROM hosting_city ORDER BY Year Desc
Step 1: find the number of rows of each value of Project_ID in Projects table.
Step 2: find Project_ID, Project_Details in Projects table whose corresponding value in step 1 is greater than 2
Output: SELECT Project_ID , Project_Details FROM Projects GROUP BY Project_ID HAVING Count ( * ) > 2
Step 1: find the first_name, last_name of Maintenance_Engineers table.
Step 2: find the first_name, last_name of Maintenance_Engineers table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT first_name , last_name FROM Maintenance_Engineers EXCEPT SELECT first_name , last_name FROM Maintenance_Engineers
find each value of Industry in Companies table along with the number of the corresponding rows to each value
Output: SELECT name , Count ( * ) FROM Companies GROUP BY Industry
find the FirstName, LastName of Reservations table for which Rate greater than 0
Output: SELECT FirstName , LastName FROM Reservations WHERE Rate > 0
find each value of gender in Person table along with the number of the corresponding rows to each value
Output: SELECT gender , Count ( * ) FROM Person GROUP BY gender
Step 1: find the number of rows of each value of id in architect table.
Step 2: find id, name, nationality of architect table with largest value in the results of step 1
Output: SELECT id , name , nationality FROM architect GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Ref_Calendar table, find the corresponding rows in Documents_to_be_Destroyed table.
Step 2: find Day_Number, Actual_Destruction_Date of the results of step 1
Output: SELECT T1.Day_Number , T2.Actual_Destruction_Date FROM Ref_Calendar AS T1 JOIN Documents_to_be_Destroyed AS T2 ON T1.Calendar_Date = T2.Planned_Destruction_Date
Step 1: find the number of rows of each value of name in buildings table.
Step 2: find name of buildings table with largest value in the results of step 1
Output: SELECT name FROM buildings GROUP BY name ORDER BY Count ( * ) Desc LIMIT 1
find the MIN_SALARY of jobs table for which MAX_SALARY greater than 300
Output: SELECT MIN_SALARY FROM jobs WHERE MAX_SALARY > 300
Step 1: find the number of rows of each value of EMPLOYEE_ID in employees table.
Step 2: find EMPLOYEE_ID, FIRST_NAME, LAST_NAME of employees table with largest value in the results of step 1
Output: SELECT EMPLOYEE_ID , FIRST_NAME , LAST_NAME FROM employees GROUP BY EMPLOYEE_ID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in architect table, find the corresponding rows in bridge table.
Step 2: find without repetition architect's name of the results of step 1 whose length_feet greater than 80
Output: SELECT DISTINCT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id WHERE T2.length_feet > 80
Step 1: For each row in Rooms table, find the corresponding rows in Reservations table.
Step 2: find roomName of the results of step 1 with largest value of Adults
Output: SELECT T1.roomName FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room ORDER BY T2.Adults Desc LIMIT 1
find the summation of Kids in Reservations table
Output: SELECT Sum ( Kids ) FROM Reservations
Step 1: For each row in employees table, find corresponding rows in departments table and in jobs table.
Step 2: find EMPLOYEE_ID, JOB_TITLE of the results of step 1 whose DEPARTMENT_NAME equals 80
Output: SELECT T3.EMPLOYEE_ID , T2.JOB_TITLE FROM departments AS T1 JOIN jobs AS T2 JOIN employees AS T3 ON T1.DEPARTMENT_ID = T3.DEPARTMENT_ID AND T3.JOB_ID = T2.JOB_ID AND T1.DEPARTMENT_ID = T3.DEPARTMENT_ID WHERE T1.DEPARTMENT_NAME = 80
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find rows of the results of step 1 whose SALARY greater than 8000 or MAX_SALARY less than 12000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 8000 OR T1.MAX_SALARY < 12000
find the number of rows in flight table whose Pilot not equals Thompson
Output: SELECT Count ( * ) FROM flight WHERE Pilot ! = "Thompson"
Step 1: For each row in AssignedTo table, find corresponding rows in Scientists table and in Projects table.
Step 2: find Scientists's Name of the results of step 1 with largest value of Hours
Output: SELECT T1.Name FROM Scientists AS T1 JOIN Projects AS T2 JOIN AssignedTo AS T3 ON T1.SSN = T3.Scientist AND T3.Project = T2.Code ORDER BY T2.Hours Desc LIMIT 1
Step 1: find the average MIN_SALARY in jobs table.
Step 2: find the EMPLOYEE_ID of employees table whose SALARY greater than the results of step 1
Output: SELECT T1.EMPLOYEE_ID FROM employees AS T1 WHERE T1.SALARY > ( SELECT Avg ( T2.MIN_SALARY ) FROM jobs AS T2 )
Step 1: For each row in city table, find the corresponding rows in hosting_city table.
Step 2: find City of the results of step 1 with largest value of Year
Output: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City ORDER BY T2.Year Desc LIMIT 1
Step 1: For each row in city table, find the corresponding rows in hosting_city table.
Step 2: find City of the results of step 1 whose Year equals 2008.
Step 3: find City of the results of step 1 whose Year equals 2008.
Step 4: show the rows that are in any of the results of step 2 or the results of step 3
Output: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008 UNION SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008
find the Document_Type_Name, Document_Type_Description of Ref_Document_Types table
Output: SELECT Document_Type_Name , Document_Type_Description FROM Ref_Document_Types
Step 1: For each row in city table, find the corresponding rows in temperature table.
Step 2: find the number of rows of each value of temperature's City_ID in the results of step 1.
Step 3: find City of step 1 results with largest value in the results of step 2
Output: SELECT T1.City FROM city AS T1 JOIN temperature AS T2 ON T1.City_ID = T2.City_ID GROUP BY T2.City_ID ORDER BY Count ( * ) Desc LIMIT 1
find each value of Author in submission table along with the number of the corresponding rows to each value
Output: SELECT Author , Count ( * ) FROM submission GROUP BY Author
Step 1: find the architect_id of mill table.
Step 2: find without repetition the architect's name, nationality of architect table whose architect's id not one of the results of step 1
Output: SELECT DISTINCT T1.name , T1.nationality FROM architect AS T1 WHERE T1.id NOT IN ( SELECT T2.architect_id FROM mill AS T2 )
Step 1: For each row in employees table, find the corresponding rows in locations table.
Step 2: find FIRST_NAME, LAST_NAME of the results of step 1 whose CITY equals Clara and LAST_NAME equals Clara
Output: SELECT T1.FIRST_NAME , T1.LAST_NAME FROM employees AS T1 JOIN locations AS T2 WHERE T2.CITY = "Clara" AND T1.LAST_NAME = "Clara"
Step 1: For each row in Ref_Locations table, find the corresponding rows in Document_Locations table.
Step 2: find the number of rows of each value of Ref_Locations's Location_Code in the results of step 1.
Step 3: find Document_Locations's Location_Code in the results of step 1 whose corresponding value in step 2 is greater than or equals 3
Output: SELECT T2.Location_Code FROM Ref_Locations AS T1 JOIN Document_Locations AS T2 ON T1.Location_Code = T2.Location_Code GROUP BY T1.Location_Code HAVING Count ( * ) > = 3
Step 1: For each row in Staff table, find the corresponding rows in Problems table.
Step 2: find problem_id of the results of step 1 whose staff_first_name equals Lysanne and staff_last_name equals Turcotte
Output: SELECT T2.problem_id FROM Staff AS T1 JOIN Problems AS T2 ON T1.staff_id = T2.closure_authorised_by_staff_id WHERE T1.staff_first_name = "Lysanne" AND T1.staff_last_name = "Turcotte"
Step 1: find the Famous_Title of artist table.
Step 2: find the Famous_Title of artist table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Famous_Title FROM artist EXCEPT SELECT Famous_Title FROM artist
Step 1: For each row in Problems table, find corresponding rows in Product table and in Staff table.
Step 2: find staff_first_name, staff_last_name of the results of step 1 whose product_name not equals aut
Output: SELECT T2.staff_first_name , T2.staff_last_name FROM Product AS T1 JOIN Staff AS T2 JOIN Problems AS T3 ON T1.product_id = T3.product_id AND T3.closure_authorised_by_staff_id = T2.staff_id WHERE T1.product_name ! = "aut"
find without repetition the company_type of Third_Party_Companies table
Output: SELECT DISTINCT company_type FROM Third_Party_Companies
find the Fname, LName of Student table for which Major equals 140
Output: SELECT Fname , LName FROM Student WHERE Major = 140
Step 1: find the number of rows of each value of Location_Code in Ref_Locations table.
Step 2: find Location_Code of Ref_Locations table with largest value in the results of step 1
Output: SELECT Location_Code FROM Ref_Locations GROUP BY Location_Code ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the number of rows of each value of Document_Type_Code in Ref_Document_Types table.
Step 2: find Document_Type_Code of Ref_Document_Types table with largest value in the results of step 1
Output: SELECT Document_Type_Code FROM Ref_Document_Types GROUP BY Document_Type_Code ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in city table, find the corresponding rows in hosting_city table.
Step 2: find City of the results of step 1 whose Year less than or equals 2008.
Step 3: find City of the results of step 1 whose Year equals 2008.
Step 4: show the rows that are in any of the results of step 2 or the results of step 3
Output: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year < = 2008 UNION SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008
Step 1: For each row in city table, find the corresponding rows in hosting_city table.
Step 2: find City of the results of step 1 whose Regional_Population greater than 23019148 or Year equals 2008
Output: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T1.Regional_Population > 23019148 OR T2.Year = 2008
Step 1: find the number of rows of each value of MIN_SALARY in jobs table.
Step 2: find JOB_ID in jobs table whose corresponding value in step 1 is greater than or equals 2.
Step 3: find the number of rows of each value of JOB_ID in jobs table.
Step 4: find JOB_TITLE in jobs table whose corresponding value in step 3 is greater than 300.
Step 5: show the rows that are in any of the results of step 2 or the results of step 4
Output: SELECT JOB_ID FROM jobs GROUP BY MIN_SALARY HAVING Count ( * ) > = 2 UNION SELECT JOB_TITLE FROM jobs GROUP BY JOB_ID HAVING Count ( * ) > 300
Step 1: For each row in Ref_Document_Types table, find the corresponding rows in Documents table.
Step 2: find Document_Type_Name, Document_Type_Name, Document_Type_Description of the results of step 1 whose Document_Name equals Noel CV or Document_Name equals King Book
Output: SELECT T1.Document_Type_Name , T1.Document_Type_Name , T1.Document_Type_Description FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code WHERE T2.Document_Name = "King Book" OR T2.Document_Name = "Noel CV"
Step 1: For each row in architect table, find the corresponding rows in bridge table.
Step 2: find the maximum length_feet in the results of step 1 whose architect's name equals Frank Lloyd Wright
Output: SELECT Max ( T2.length_feet ) FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id WHERE T1.name = "Frank Lloyd Wright"
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find PersonFriend's name of the results of step 1 whose age greater than 40.
Step 3: find the Person's name of Person table for which age less than 30.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.age > 40 INTERSECT SELECT T1.name FROM Person AS T1 WHERE T1.age < 30
find the Author, Scores of submission table ordered ascending by Scores
Output: SELECT Author , Scores FROM submission ORDER BY Scores Asc
find the rows of employees table for which HIRE_DATE equals or between 2002-06-21 and 1987-06-17
Output: SELECT * FROM employees WHERE HIRE_DATE BETWEEN "1987-06-17" AND "2002-06-21"
find the Issue_Date of volume table with largest value of Weeks_on_Top
Output: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top Desc LIMIT 1
Step 1: For each row in Member_of table, find corresponding rows in Faculty table and in Department table.
Step 2: find DName, Lname of the results of step 1 whose Department's Building equals Mergenthaler and Faculty's Building equals NEB.
Step 3: find DName, Lname of the results of step 1 whose Department's Building equals M and Faculty's Building equals NEB.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T2.DName , T1.Lname FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T2.Building = "Mergenthaler" AND T1.Building = "NEB" INTERSECT SELECT T2.DName , T1.Lname FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T2.Building = "M" AND T1.Building = "NEB"
find Venue of match table whose Score equals Nanjing ( Jiangsu ) and Competition equals 1994 FIFA World Cup qualification
Output: SELECT Venue FROM match WHERE Score = "Nanjing ( Jiangsu )" AND Competition = "1994 FIFA World Cup qualification"
find the JOB_TITLE of jobs table for which MIN_SALARY greater than 8000
Output: SELECT JOB_TITLE FROM jobs WHERE MIN_SALARY > 8000
find the Document_ID of Documents table for which Document_Name contains s
Output: SELECT Document_ID FROM Documents WHERE Document_Name LIKE "s"
find Fname, Lname of Faculty table whose Rank equals M and Building equals NEB
Output: SELECT Fname , Lname FROM Faculty WHERE Rank = "M" AND Building = "NEB"
find each value of Location_Code in Ref_Locations table along with the number of the corresponding rows to each value
Output: SELECT Location_Code , Count ( * ) FROM Ref_Locations GROUP BY Location_Code
Step 1: find the number of rows of each value of Author in submission table.
Step 2: find Author in submission table whose corresponding value in step 1 is greater than 1
Output: SELECT Author FROM submission GROUP BY Author HAVING Count ( * ) > 1
find the MAX_SALARY, MIN_SALARY of jobs table
Output: SELECT MAX_SALARY , MIN_SALARY FROM jobs
Step 1: find the Document_ID of Documents table.
Step 2: For each row in Documents table, find corresponding rows in Ref_Document_Types table and in Documents_with_Expenses table.
Step 3: find Documents_with_Expenses's Document_ID of the results of step 2 whose Document_Type_Name equals CV.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.Document_ID FROM Documents AS T1 EXCEPT SELECT T3.Document_ID FROM Ref_Document_Types AS T2 JOIN Documents AS T1 ON T2.Document_Type_Code = T1.Document_Type_Code JOIN Documents_with_Expenses AS T3 ON T1.Document_ID = T3.Document_ID WHERE T2.Document_Type_Name = "CV"
Step 1: For each row in school table, find the corresponding rows in school_details table.
Step 2: find Colors of the results of step 1 with largest value of Enrollment
Output: SELECT T2.Colors FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID ORDER BY T1.Enrollment Desc LIMIT 1
Step 1: For each row in airport table, find the corresponding rows in flight table.
Step 2: find Pilot of the results of step 1 whose airport's name equals Cargo.
Step 3: For each row in flight table, find corresponding rows in airport table and in operate_company table.
Step 4: find operate_company's name of the results of step 3 whose airport's name equals Catering services.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T2.Pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.name = "Cargo" INTERSECT SELECT T3.name FROM airport AS T1 JOIN operate_company AS T3 JOIN flight AS T2 ON T1.id = T2.airport_id AND T2.company_id = T3.id WHERE T1.name = "Catering services"
find the Team of player table with smallest value of Age
Output: SELECT Team FROM player ORDER BY Age Asc LIMIT 1
Step 1: For each row in Problem_Log table, find corresponding rows in Staff table and in Problems table.
Step 2: find Problems's problem_id of the results of step 1 whose staff_first_name equals Lysanne and log_entry_date greater than Turcotte
Output: SELECT T3.problem_id FROM Problem_Log AS T1 JOIN Staff AS T2 ON T1.assigned_to_staff_id = T2.staff_id JOIN Problems AS T3 ON T1.problem_id = T3.problem_id WHERE T2.staff_first_name = "Lysanne" AND T1.log_entry_date > "Turcotte"