niryuu/sni-each-converted huggingface dataset:
Step 1: For each row in trip table, find the corresponding rows in weather table.
Step 2: find the average duration in the results of step 1 whose min_temperature_f greater than 50
Output: SELECT Avg ( T1.duration ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.min_temperature_f > 50
Step 1: For each row in Services table, find corresponding rows in Ref_Service_Types table and in Drama_Workshop_Groups table.
Step 2: find the number of different Currency_Code in the results of step 1 whose Service_Type_Description equals provide photo service
Output: SELECT Count ( DISTINCT T2.Currency_Code ) FROM Ref_Service_Types AS T1 JOIN Drama_Workshop_Groups AS T2 JOIN Services AS T3 ON T1.Service_Type_Code = T3.Service_Type_Code AND T3.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Service_Type_Description = "provide photo service"
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 M and Department's Building equals NEB
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 = "NEB" AND T2.Building = "M"
find without repetition Fname, LName of Student table whose Advisor equals 18 and Advisor equals 1121
Output: SELECT DISTINCT Fname , LName FROM Student WHERE Advisor = 1121 AND Advisor = 18
find the number of rows in Student table whose Sex equals HKG or city_code equals CHI
Output: SELECT Count ( * ) FROM Student WHERE Sex = "HKG" OR city_code = "CHI"
find the Date_of_ceremony of music_festival table
Output: SELECT Date_of_ceremony FROM music_festival
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 MIN_SALARY greater than or equals 12000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 8000 OR T1.MIN_SALARY > = 12000
Step 1: find the number of rows in weather table whose min_humidity greater than 8.
Step 2: find the max_temperature_f of weather table for which max_temperature_f less than 50.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Count ( * ) FROM weather WHERE min_humidity > 8 INTERSECT SELECT max_temperature_f FROM weather WHERE max_temperature_f < 50
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 MAX_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.MAX_SALARY Desc
find the catalog_entry_name, height of Catalog_Contents table for which price_in_dollars greater than 700
Output: SELECT catalog_entry_name , height FROM Catalog_Contents WHERE price_in_dollars > 700
Step 1: For each row in Physician table, find the corresponding rows in Appointment table.
Step 2: find the number of rows of each value of AppointmentID in the results of step 1.
Step 3: find Name of step 1 results with largest value in the results of step 2
Output: SELECT T1.Name FROM Physician AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.Physician GROUP BY T2.AppointmentID ORDER BY Count ( * ) Desc LIMIT 1
find the f_id, song_name, artist_name of song table ordered ascending by rating
Output: SELECT f_id , song_name , artist_name FROM song ORDER BY rating Asc
find the Name of Physician table with largest value of Name
Output: SELECT Name FROM Physician ORDER BY Name Desc LIMIT 1
Step 1: For each row in Document_Structures table, find the corresponding rows in Documents table.
Step 2: for each value of Document_Structures's document_structure_code in the results of step 1, calculate number of rows.
Step 3: show each value of Document_Structures's document_structure_code in the results of step 1 along with the average access_count with smallest value in the results of step 2
Output: SELECT T2.access_count , Avg ( T2.access_count ) FROM Document_Structures AS T1 JOIN Documents AS T2 ON T1.document_structure_code = T2.document_structure_code GROUP BY T1.document_structure_code ORDER BY Count ( * ) Asc LIMIT 1
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 Problems's product_id 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.product_id > "1986-11-13" GROUP BY T1.product_id
Step 1: For each row in Services table, find corresponding rows in Ref_Service_Types table and in Drama_Workshop_Groups table.
Step 2: find the number of different Currency_Code in the results of step 1 whose Parent_Service_Type_Code equals 1
Output: SELECT Count ( DISTINCT T2.Currency_Code ) FROM Ref_Service_Types AS T1 JOIN Drama_Workshop_Groups AS T2 JOIN Services AS T3 ON T1.Service_Type_Code = T3.Service_Type_Code AND T3.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Parent_Service_Type_Code = 1
find zip_code of weather table whose precipitation_inches greater than 80 or min_sea_level_pressure_inches greater than 29.97
Output: SELECT zip_code FROM weather WHERE precipitation_inches > 80 OR min_sea_level_pressure_inches > 29.97
Step 1: find the average MAX_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.MAX_SALARY ) FROM jobs AS T2 )
find without repetition the rank of results table
Output: SELECT DISTINCT rank FROM results
find song_name of song table whose languages equals modern or languages equals english
Output: SELECT song_name FROM song WHERE languages = "english" OR languages = "modern"
find the date of weather table for which mean_dew_point_f greater than 85
Output: SELECT date FROM weather WHERE mean_dew_point_f > 85
find the date of weather table for which max_dew_point_f greater than 85
Output: SELECT date FROM weather WHERE max_dew_point_f > 85
Step 1: For each row in Fault_Log table, find corresponding rows in Assets table and in Engineer_Visits table.
Step 2: find other_asset_details of the results of step 1 ordered ascending by visit_start_datetime
Output: SELECT T1.other_asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id JOIN Engineer_Visits AS T3 ON T2.fault_log_entry_id = T3.fault_log_entry_id ORDER BY T3.visit_start_datetime Asc
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 greater 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
Step 1: find the Unsure_rate of candidate table ordered descending by Unsure_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Unsure_rate FROM candidate ORDER BY Unsure_rate Desc LIMIT 3
Step 1: find the number of rows of each value of user_id in Users table.
Step 2: find user_name, user_id of Users table with largest value in the results of step 1
Output: SELECT user_name , user_id FROM Users GROUP BY user_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in School table, find corresponding rows in budget table and in endowment table.
Step 2: find Budgeted, donator_name of the results of step 1 with largest value of amount
Output: SELECT T2.Budgeted , T3.donator_name FROM School AS T1 JOIN budget AS T2 ON T2.School_id = T1.School_id JOIN endowment AS T3 ON T1.School_id = T3.School_id ORDER BY T3.amount Desc LIMIT 1
find the Name, Headquarter, Founder of Manufacturers table ordered descending by Revenue
Output: SELECT Name , Headquarter , Founder FROM Manufacturers ORDER BY Revenue Desc
Step 1: For each row in Player table, find the corresponding rows in Player_Attributes table.
Step 2: find Player_Attributes's player_api_id of the results of step 1 whose height greater than 180.
Step 3: find the Player_Attributes's player_api_id of Player_Attributes table for which overall_rating less than 85.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.player_api_id FROM Player_Attributes AS T1 JOIN Player AS T2 ON T1.player_fifa_api_id = T2.player_fifa_api_id WHERE T2.height > 180 INTERSECT SELECT T1.player_api_id FROM Player_Attributes AS T1 WHERE T1.overall_rating < 85
Step 1: For each row in people table, find the corresponding rows in candidate table.
Step 2: find Sex, Consider_rate, Oppose_rate of the results of step 1 ordered ascending by Unsure_rate
Output: SELECT T2.Sex , T1.Consider_rate , T1.Oppose_rate FROM candidate AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Unsure_rate Asc
Step 1: find the Oppose_rate of candidate table ordered descending by Support_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Oppose_rate FROM candidate ORDER BY Support_rate Desc LIMIT 3
Step 1: find the number of rows of each value of Position in Physician table.
Step 2: find Name of Physician table with largest value in the results of step 1
Output: SELECT Name FROM Physician GROUP BY Position ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the customer_name, customer_address of Customers table.
Step 2: find the customer_name of Customers table.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT customer_name , customer_address FROM Customers INTERSECT SELECT customer_name FROM Customers
find the number of rows in Student table whose Major equals 600 and Sex equals M
Output: SELECT Count ( * ) FROM Student WHERE Major = 600 AND Sex = "M"
find the other_asset_details of Assets table ordered ascending by other_asset_details
Output: SELECT other_asset_details FROM Assets ORDER BY other_asset_details Asc
Step 1: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 2: find product_name, other_characteristic_details, characteristic_data_type of the results of step 1.
Step 3: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table.
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 , T1.other_characteristic_details , T1.characteristic_data_type 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 EXCEPT SELECT T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_data_type FROM Characteristics AS T1
find the Player of player table for which Player contains English
Output: SELECT Player FROM player WHERE Player LIKE "English"
Step 1: find the date of weather table ordered descending by max_sea_level_pressure_inches.
Step 2: only show the first 5 rows of the results
Output: SELECT date FROM weather ORDER BY max_sea_level_pressure_inches Desc LIMIT 5
Step 1: find the Unsure_rate of candidate table ordered descending by Consider_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Unsure_rate FROM candidate ORDER BY Consider_rate Desc LIMIT 3
Step 1: For each row in Drama_Workshop_Groups table, find corresponding rows in Addresses table and in Services table.
Step 2: find City_Town of the results of step 1 whose Product_Name equals FJA Filming
Output: SELECT T1.City_Town FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID JOIN Services AS T3 ON T2.Workshop_Group_ID = T3.Workshop_Group_ID WHERE T3.Product_Name = "FJA Filming"
find JOB_TITLE, MIN_SALARY of jobs table whose MAX_SALARY contains 12000 and MAX_SALARY less than or equals 18000
Output: SELECT JOB_TITLE , MIN_SALARY FROM jobs WHERE MAX_SALARY LIKE 18000 AND MAX_SALARY < = 12000
Step 1: find the Person's name, age of Person table for which job equals Dan.
Step 2: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 3: find Person's name, age of the results of step 2 whose friend equals Alice.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.name , T1.age FROM Person AS T1 WHERE T1.job = "Dan" INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = "Alice"
find the Position of match_season table for which Player contains English
Output: SELECT Position FROM match_season WHERE Player LIKE "English"
find the Fname, Lname of Faculty table for which Fname equals Linda
Output: SELECT Fname , Lname FROM Faculty WHERE Fname = "Linda"
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find SALARY, MAX_SALARY of the results of step 1
Output: SELECT T2.SALARY , T1.MAX_SALARY FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID
Step 1: For each row in Asset_Parts table, find corresponding rows in Parts table and in Assets table.
Step 2: find other_asset_details of the results of step 1 ordered ascending by chargeable_amount
Output: SELECT T2.other_asset_details 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 T1.chargeable_amount Asc
find the Name, Seating of track table for which Year_Opened greater than 2000 ordered ascending by Name
Output: SELECT Name , Seating FROM track WHERE Year_Opened > 2000 ORDER BY Name Asc
Step 1: find the Name of actor table.
Step 2: find the Name of actor table whose Actor_ID not one of the results of step 1
Output: SELECT Name FROM actor WHERE Actor_ID NOT IN ( SELECT Name FROM actor )
find the meter_600, meter_200 of swimmer table for which Nationality equals Australia
Output: SELECT meter_600 , meter_200 FROM swimmer WHERE Nationality = "Australia"
Step 1: find the Name of actor table.
Step 2: find the Name of actor table whose Name not one of the results of step 1
Output: SELECT Name FROM actor WHERE Name NOT IN ( SELECT Name FROM actor )
Step 1: find the decor of Rooms table for which bedType equals King.
Step 2: find the decor of Rooms table for which bedType equals Recluse and defiance.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT decor FROM Rooms WHERE bedType = "King" INTERSECT SELECT decor FROM Rooms WHERE bedType = "Recluse and defiance"
find the document_type_code of Documents table
Output: SELECT document_type_code FROM Documents
Step 1: find the rows of medicine table.
Step 2: find the number of rows in enzyme table whose enzyme's id not one of the results of step 1
Output: SELECT Count ( * ) FROM enzyme AS T1 WHERE T1.id NOT IN ( SELECT * FROM medicine AS T2 )
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find artist's artist_name of the results of step 1 whose song's country equals UK.
Step 3: find artist's artist_name of the results of step 1 whose song's country equals english.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.country = "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.country = "english"
find start_station_id of trip table whose duration greater than 60 and end_station_name equals San Francisco Caltrain 2 (330 Townsend)
Output: SELECT start_station_id FROM trip WHERE duration > 60 AND end_station_name = "San Francisco Caltrain 2 (330 Townsend)"
Step 1: find the characteristic_name, other_characteristic_details, characteristic_type_code of Characteristics table for which characteristic_name equals slow.
Step 2: For each row in Characteristics table, find the corresponding rows in Product_Characteristics table.
Step 3: find the number of rows of each value of Product_Characteristics's characteristic_id in the results of step 2.
Step 4: find characteristic_name, other_characteristic_details, characteristic_data_type in the results of step 3 whose corresponding value in step 3 is equals 1.
Step 5: show the rows that are in the results of step 1 but not in the results of step 4
Output: SELECT T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_type_code FROM Characteristics AS T1 WHERE T1.characteristic_name = "slow" EXCEPT SELECT T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_data_type FROM Characteristics AS T1 JOIN Product_Characteristics AS T2 ON T1.characteristic_id = T2.characteristic_id GROUP BY T2.characteristic_id HAVING Count ( * ) = 1
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 greater than 50 and County equals Monterey
Output: SELECT T2.Winery FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Price > 50 AND T1.County = "Monterey"
find the rows of jobs table for which MIN_SALARY greater than 12000
Output: SELECT * FROM jobs WHERE MIN_SALARY > 12000
find start_station_id of trip table whose duration greater than 60 and start_date equals 8/21/2015 17:03
Output: SELECT start_station_id FROM trip WHERE duration > 60 AND start_date = "8/21/2015 17:03"
Step 1: find the average salary in employee table.
Step 2: For each row in employee table, find the corresponding rows in certificate table.
Step 3: find certificate's eid in the results of step 2 whose salary greater than the results of step 1
Output: SELECT T2.eid FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid WHERE T1.salary > ( SELECT Avg ( T1.salary ) FROM employee AS T1 )
find the city of station table ordered descending by long
Output: SELECT city FROM station ORDER BY long Desc
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition Fname, LName of the results of step 1 whose President_Vote equals 18 and President_Vote equals 1004
Output: SELECT DISTINCT T1.Fname , T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.President_Vote = 1004 AND T2.President_Vote = 18
Step 1: find the SupportRepId of Customer table for which Customer's LastName greater than 20.
Step 2: find the Employee's LastName of Employee table whose EmployeeId not one of the results of step 1
Output: SELECT T1.LastName FROM Employee AS T1 WHERE T1.EmployeeId NOT IN ( SELECT T2.SupportRepId FROM Customer AS T2 WHERE T2.LastName > 20 )
find without repetition the Winery of wine table for which Score equals or between 50 and 100
Output: SELECT DISTINCT Winery FROM wine WHERE Score BETWEEN 100 AND 50
find rows of jobs table whose JOB_TITLE equals President and MAX_SALARY greater than 12000
Output: SELECT * FROM jobs WHERE JOB_TITLE = "President" AND MAX_SALARY > 12000
Step 1: find the number of rows of each value of city in station table.
Step 2: find city of station table ordered descending by the results of step 1
Output: SELECT city FROM station GROUP BY city ORDER BY Count ( * ) Desc
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find FIRST_NAME, LAST_NAME, MAX_SALARY of the results of step 1 whose SALARY less than 6000
Output: SELECT T2.FIRST_NAME , T2.LAST_NAME , T1.MAX_SALARY FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY < 6000
Step 1: find the characteristic_name, other_characteristic_details, characteristic_type_code 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_type_code FROM Characteristics EXCEPT SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics
Step 1: For each row in Catalog_Structure table, find corresponding rows in Catalogs table and in Catalog_Contents table.
Step 2: find catalog_name, catalog_publisher of the results of step 1 whose price_in_dollars greater than 700
Output: SELECT T1.catalog_name , T1.catalog_publisher FROM Catalogs AS T1 JOIN Catalog_Structure AS T2 ON T1.catalog_id = T2.catalog_id JOIN Catalog_Contents AS T3 ON T2.catalog_level_number = T3.catalog_level_number WHERE T3.price_in_dollars > 700
Step 1: find the characteristic_name, other_characteristic_details, characteristic_type_code of Characteristics table.
Step 2: find the characteristic_name, other_characteristic_details, characteristic_type_code 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_type_code FROM Characteristics EXCEPT SELECT characteristic_name , other_characteristic_details , characteristic_type_code FROM Characteristics
find the average distance and the average price in flight table whose destination equals Los Angeles
Output: SELECT Avg ( distance ) , Avg ( price ) FROM flight WHERE destination = "Los Angeles"
find the Consider_rate, Consider_rate, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Consider_rate , Consider_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
find the Draft_Class of match_season table for which Player contains English
Output: SELECT Draft_Class FROM match_season WHERE Player LIKE "English"
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_type_code 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_type_code FROM Characteristics
find the Candidate_ID, Consider_rate, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Candidate_ID , Consider_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
Step 1: For each row in volume table, find the corresponding rows in music_festival table.
Step 2: find Music_Festival, Issue_Date of the results of step 1
Output: SELECT T2.Music_Festival , T1.Issue_Date FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume
Step 1: find the Consider_rate of candidate table ordered descending by Support_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Consider_rate FROM candidate ORDER BY Support_rate Desc LIMIT 3
Step 1: For each row in list table, find the corresponding rows in teachers table.
Step 2: find FirstName of the results of step 1 whose Classroom equals 110
Output: SELECT T2.FirstName FROM list AS T1 JOIN teachers AS T2 WHERE T1.Classroom = 110
find Music_Festival of music_festival table whose Category equals Best Song and Result equals Awarded
Output: SELECT Music_Festival FROM music_festival WHERE Category = "Best Song" AND Result = "Awarded"
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_name, customer_email in Customers table whose corresponding value in step 1 is equals New.
Step 3: find customer_name, customer_address in Customers table whose corresponding value in step 1 is less than Pending.
Step 4: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT customer_name , customer_email FROM Customers GROUP BY customer_id HAVING Count ( * ) = "New" INTERSECT SELECT customer_name , customer_address FROM Customers GROUP BY customer_id HAVING Count ( * ) < "Pending"
Step 1: For each row in School table, find corresponding rows in budget table and in endowment table.
Step 2: find total_budget_percent_invested, donator_name of the results of step 1 with largest value of amount
Output: SELECT T2.total_budget_percent_invested , T3.donator_name FROM School AS T1 JOIN budget AS T2 ON T2.School_id = T1.School_id JOIN endowment AS T3 ON T1.School_id = T3.School_id ORDER BY T3.amount Desc LIMIT 1
find Fname of Student table whose Age greater than or equals 20 and Age less than or equals 25
Output: SELECT Fname FROM Student WHERE Age > = 25 AND Age < = 20
Step 1: find the number of rows of each value of Entrepreneur_ID in entrepreneur table.
Step 2: find Entrepreneur_ID of entrepreneur table with largest value in the results of step 1
Output: SELECT Entrepreneur_ID FROM entrepreneur GROUP BY Entrepreneur_ID ORDER BY Count ( * ) Desc LIMIT 1
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 MIN_SALARY less than or equals D ordered descending by SALARY
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.MIN_SALARY < = "D" ORDER BY T2.SALARY Desc
find the average Famous_Release_date in artist table whose Famous_Release_date greater than or equals 25
Output: SELECT Avg ( Famous_Release_date ) FROM artist WHERE Famous_Release_date > = 25
Step 1: find the number of rows of each value of Entrepreneur_ID in entrepreneur table.
Step 2: find Investor of entrepreneur table with largest value in the results of step 1
Output: SELECT Investor FROM entrepreneur GROUP BY Entrepreneur_ID ORDER BY Count ( * ) Desc LIMIT 1
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 equals 8000 or MAX_SALARY greater 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 rows of Assets table ordered ascending by asset_details
Output: SELECT * FROM Assets ORDER BY asset_details Asc
Step 1: For each row in Manufacturers table, find the corresponding rows in Products table.
Step 2: find Manufacturers's Name of the results of step 1 whose Price greater than 200 or Price less than 240
Output: SELECT T1.Name FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer WHERE T2.Price > 240 OR T2.Price < 200
Step 1: For each row in genre table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose g_name equals modern or languages equals english
Output: SELECT T2.song_name FROM genre AS T1 JOIN song AS T2 ON T1.g_name = T2.genre_is WHERE T1.g_name = "modern" OR T2.languages = "english"
Step 1: find the cust_name of customer table.
Step 2: find the cust_name of customer table for which acc_type equals Mortgages.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = "Mortgages"
Step 1: find the Name of Manufacturers table.
Step 2: find the Name of Products 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.Name FROM Manufacturers AS T1 EXCEPT SELECT T2.Name FROM Products AS T2
Step 1: find the number of rows of each value of id in airport table.
Step 2: find id, name, IATA of airport table with largest value in the results of step 1
Output: SELECT id , name , IATA FROM airport GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
find the rows of team table for which Name contains English
Output: SELECT * FROM team WHERE Name LIKE "English"
Step 1: find the number of rows of each value of id in airport table.
Step 2: find id, name, name of airport table with largest value in the results of step 1
Output: SELECT id , name , name FROM airport GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in volume table, find corresponding rows in artist table and in music_festival table.
Step 2: find Famous_Release_date, Date_of_ceremony of the results of step 1
Output: SELECT T1.Famous_Release_date , T3.Date_of_ceremony FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID JOIN music_festival AS T3 ON T2.Volume_ID = T3.Volume
find the average length_meters in bridge table whose name equals Xian Ren Qiao (Fairy Bridge)
Output: SELECT Avg ( length_meters ) FROM bridge WHERE name = "Xian Ren Qiao (Fairy Bridge)"
find the Author, Author of submission table ordered ascending by Scores
Output: SELECT Author , Author FROM submission ORDER BY Scores Asc
Step 1: find the Support_rate of candidate table ordered descending by Unsure_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Support_rate FROM candidate ORDER BY Unsure_rate Desc LIMIT 3
find the maximum Oppose_rate in candidate table
Output: SELECT Max ( Oppose_rate ) FROM candidate
find the FIRST_NAME, LAST_NAME, MANAGER_ID, SALARY of employees table
Output: SELECT FIRST_NAME , LAST_NAME , MANAGER_ID , SALARY FROM employees
find the start_station_id of trip table for which duration greater than 60
Output: SELECT start_station_id FROM trip WHERE duration > 60
Step 1: For each row in volume table, find the corresponding rows in music_festival table.
Step 2: find Date_of_ceremony, Song of the results of step 1
Output: SELECT T2.Date_of_ceremony , T1.Song FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume
find zip_code of weather table whose min_humidity greater than 80 or min_sea_level_pressure_inches greater than 29.97
Output: SELECT zip_code FROM weather WHERE min_humidity > 80 OR min_sea_level_pressure_inches > 29.97
find the Votes of election table ordered descending by Vote_Percent
Output: SELECT Votes FROM election ORDER BY Vote_Percent Desc
Step 1: find the number of rows of each value of Position in Nurse table.
Step 2: find Name of Nurse table with largest value in the results of step 1
Output: SELECT Name FROM Nurse GROUP BY Position ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the summation of credit_score of each value of cust_name in customer table.
Step 2: find cust_name of customer table with largest value in the results of step 1
Output: SELECT cust_name FROM customer GROUP BY cust_name ORDER BY Sum ( credit_score ) Desc LIMIT 1
find the average length_meters in bridge table whose location equals Guangxi , China
Output: SELECT Avg ( length_meters ) FROM bridge WHERE location = "Guangxi , China"
find the Consider_rate, Unsure_rate, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Consider_rate , Unsure_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
find the average price_in_euros and the minimum price_in_pounds in Catalog_Contents table
Output: SELECT Avg ( price_in_euros ) , Min ( price_in_pounds ) FROM Catalog_Contents
Step 1: find the number of rows of each value of Comptroller in party table.
Step 2: find Lieutenant_Governor of party table with largest value in the results of step 1
Output: SELECT Lieutenant_Governor FROM party GROUP BY Comptroller ORDER BY Count ( * ) Desc LIMIT 1
find the Team_Name of basketball_match table ordered descending by All_Games_Percent
Output: SELECT Team_Name FROM basketball_match ORDER BY All_Games_Percent Desc
find the date of weather table for which min_humidity greater than 85
Output: SELECT date FROM weather WHERE min_humidity > 85
find Fname, LName of Student table whose Sex equals F and Age equals 18
Output: SELECT Fname , LName FROM Student WHERE Sex = "F" AND Age = 18
Step 1: find the number of rows of each value of School_ID in school table.
Step 2: find Boys_or_Girls in school table whose corresponding value in step 1 is greater than 1
Output: SELECT Boys_or_Girls FROM school GROUP BY School_ID HAVING Count ( * ) > 1
find the FIRST_NAME, LAST_NAME, SALARY, MANAGER_ID of employees table
Output: SELECT FIRST_NAME , LAST_NAME , SALARY , MANAGER_ID FROM employees
find the number of rows in airlines table whose active equals John F Kennedy International Airport
Output: SELECT Count ( * ) FROM airlines WHERE active = "John F Kennedy International Airport"
find the number of rows in Courses table whose course_name equals Fail
Output: SELECT Count ( * ) FROM Courses WHERE course_name = "Fail"
Step 1: find the rows of employees table for which SALARY greater than 24000.
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 employees AS T1 WHERE T1.SALARY > 24000 INTERSECT SELECT T2.JOB_TITLE FROM jobs AS T2 WHERE T2.MAX_SALARY > 12000
find the number of rows in camera_lens table whose max_aperture greater than 15
Output: SELECT Count ( * ) FROM camera_lens WHERE max_aperture > 15
find without repetition the supplier_name of Suppliers table
Output: SELECT DISTINCT supplier_name FROM Suppliers
Step 1: find the date, mean_temperature_f, mean_wind_speed_mph of weather table ordered descending by max_gust_speed_mph.
Step 2: only show the first 3 rows of the results
Output: SELECT date , mean_temperature_f , mean_wind_speed_mph FROM weather ORDER BY max_gust_speed_mph Desc LIMIT 3
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition Fname, LName of the results of step 1 whose Treasurer_Vote equals 18
Output: SELECT DISTINCT T1.Fname , T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.Treasurer_Vote = 18
Step 1: find the DName of Department table.
Step 2: find the DName of Department table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT DName FROM Department EXCEPT SELECT DName FROM Department
Step 1: For each row in Customer_Orders table, find the corresponding rows in Order_Items table.
Step 2: find product_id, customer_id of the results of step 1 whose order_status_code equals Cancelled or order_item_status_code equals Paid
Output: SELECT T2.product_id , T1.customer_id FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.order_id = T2.order_id WHERE T1.order_status_code = "Cancelled" OR T2.order_item_status_code = "Paid"
Step 1: For each row in Things table, find the corresponding rows in Timed_Status_of_Things table.
Step 2: find without repetition Things's thing_id, service_type_code of the results of step 1 whose Status_of_Thing_Code equals Close or Date_and_Date less than 2017-06-19 02:59:21
Output: SELECT DISTINCT T1.thing_id , T1.service_type_code FROM Things AS T1 JOIN Timed_Status_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T2.Status_of_Thing_Code = "Close" OR T2.Date_and_Date < "2017-06-19 02:59:21"
Step 1: For each row in Students table, find the corresponding rows in Student_Course_Enrolment table.
Step 2: find date_of_latest_logon, date_of_completion of the results of step 1 whose family_name equals Zieme and personal_name equals Bernie
Output: SELECT T1.date_of_latest_logon , T2.date_of_completion FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id WHERE T1.family_name = "Zieme" AND T1.personal_name = "Bernie"
Step 1: find the Unsure_rate of candidate table ordered descending by Support_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Unsure_rate FROM candidate ORDER BY Support_rate Desc LIMIT 3
Step 1: find the minimum year in PersonFriend table.
Step 2: find the name of PersonFriend table whose year equals the results of step 1
Output: SELECT name FROM PersonFriend WHERE year = ( SELECT Min ( year ) FROM PersonFriend )
Step 1: find the number of rows of each value of Department_ID in department table.
Step 2: find Name of department table with largest value in the results of step 1
Output: SELECT Name FROM department GROUP BY Department_ID ORDER BY Count ( * ) Desc LIMIT 1
find the Attorney_General, Party of party table
Output: SELECT Attorney_General , Party FROM party
Step 1: For each row in browser table, find the corresponding rows in accelerator_compatible_browser table.
Step 2: find name of the results of step 1 whose compatible_since_year greater than 1998
Output: SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id WHERE T2.compatible_since_year > 1998
find the number of different payment_method_code in Ref_Payment_Methods table
Output: SELECT Count ( DISTINCT payment_method_code ) FROM Ref_Payment_Methods
find the rows of jobs table for which MAX_SALARY less than 2500
Output: SELECT * FROM jobs WHERE MAX_SALARY < 2500
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 2500 and MIN_SALARY less than 20000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 2500 AND T1.MIN_SALARY < 20000
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 or equals 8000 and MIN_SALARY less than or equals 12000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > = 8000 AND T1.MIN_SALARY < = 12000
Step 1: find the number of rows in weather table whose min_humidity greater than 8.
Step 2: find the min_sea_level_pressure_inches of weather table for which max_sea_level_pressure_inches less than 50.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Count ( * ) FROM weather WHERE min_humidity > 8 INTERSECT SELECT min_sea_level_pressure_inches FROM weather WHERE max_sea_level_pressure_inches < 50
find without repetition the Fname, LName of Student table for which Age equals 18
Output: SELECT DISTINCT Fname , LName FROM Student WHERE Age = 18
find the name, nationality, id of architect table ordered ascending by gender
Output: SELECT name , nationality , id FROM architect ORDER BY gender Asc
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 2500 and MAX_SALARY less than 40000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 2500 AND T1.MAX_SALARY < 40000
find the Major of Student table for which Sex equals M
Output: SELECT Major FROM Student WHERE Sex = "M"
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 contains 8000 and MAX_SALARY less than or equals 12000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY LIKE 8000 AND T1.MAX_SALARY < = 12000
find the distance, distance of flight table with largest value of price
Output: SELECT distance , distance FROM flight ORDER BY price Desc LIMIT 1
find the address of address table
Output: SELECT address FROM address
find the number of rows in trip table whose duration greater than 50
Output: SELECT Count ( * ) FROM trip WHERE duration > 50
Step 1: For each row in Residents table, find the corresponding rows in Customer_Events table.
Step 2: find Customer_Event_ID, Customer_Events's date_moved_in, Residents's date_moved_in of the results of step 1
Output: SELECT T2.Customer_Event_ID , T2.date_moved_in , T1.date_moved_in FROM Residents AS T1 JOIN Customer_Events AS T2 ON T1.date_moved_in = T2.date_moved_in
Step 1: For each row in genre table, find the corresponding rows in song table.
Step 2: find artist_name of the results of step 1 whose genre_is equals modern or g_name equals english
Output: SELECT T2.artist_name FROM genre AS T1 JOIN song AS T2 ON T1.g_name = T2.genre_is WHERE T2.genre_is = "modern" OR T1.g_name = "english"
find the HIRE_DATE of employees table for which FIRST_NAME contains M
Output: SELECT HIRE_DATE FROM employees WHERE FIRST_NAME LIKE "M"
Step 1: For each row in Appointment table, find corresponding rows in Physician table and in Nurse table.
Step 2: find the number of rows of each value of Physician's Name in the results of step 1.
Step 3: find Nurse's Name of the results of step 1 with largest value in the results of step 2
Output: SELECT T2.Name FROM Physician AS T1 JOIN Nurse AS T2 JOIN Appointment AS T3 ON T1.EmployeeID = T3.Physician AND T3.PrepNurse = T2.EmployeeID GROUP BY T1.Name ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find each value of DEPARTMENT_ID in the results of step 1 along with the average MIN_SALARY of the corresponding rows to each value
Output: SELECT T1.JOB_TITLE , Avg ( T1.MIN_SALARY ) FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.DEPARTMENT_ID
find the EMAIL of employees table
Output: SELECT EMAIL FROM employees
Step 1: For each row in Course_Authors_and_Tutors table, find the corresponding rows in Courses table.
Step 2: find login_name, personal_name, course_description of the results of step 1
Output: SELECT T1.login_name , T1.personal_name , T2.course_description FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition Fname, LName of the results of step 1 whose Advisor equals 18 and President_Vote equals 1004
Output: SELECT DISTINCT T1.Fname , T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T1.Advisor = 18 AND T2.President_Vote = 1004
Step 1: For each row in airport table, find the corresponding rows in flight table.
Step 2: find the number of rows of each value of airport's id in the results of step 1.
Step 3: find airport's id, name, Vehicle_Flight_number of step 1 results with largest value in the results of step 2
Output: SELECT T1.id , T1.name , T2.Vehicle_Flight_number FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T1.id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Product table, find the corresponding rows in Problems table.
Step 2: find the number of rows of each value of Problems's product_id in the results of step 1.
Step 3: find product_details, product_name of step 1 results with largest value in the results of step 2
Output: SELECT T1.product_details , T1.product_name FROM Product AS T1 JOIN Problems AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Courses table, find the corresponding rows in Student_Course_Registrations table.
Step 2: find student_id of the results of step 1 whose course_name equals statistics or course_name equals statistics
Output: SELECT T2.student_id FROM Courses AS T1 JOIN Student_Course_Registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" OR T1.course_name = "statistics"
Step 1: For each row in user_profiles table, find the corresponding rows in tweets table.
Step 2: find the number of rows of each value of tweets's uid in the results of step 1.
Step 3: find name, partitionid in the results of step 1 whose corresponding value in step 2 is greater than 2
Output: SELECT T2.name , T2.partitionid FROM tweets AS T1 JOIN user_profiles AS T2 ON T1.uid = T2.uid GROUP BY T1.uid HAVING Count ( * ) > 2
find rows of jobs table whose MIN_SALARY greater than 12000 and MAX_SALARY greater than 40000
Output: SELECT * FROM jobs WHERE MIN_SALARY > 12000 AND MAX_SALARY > 40000
Step 1: find the number of rows of each value of FirstName in list table.
Step 2: find FirstName, LastName of list table with largest value in the results of step 1
Output: SELECT FirstName , LastName FROM list GROUP BY FirstName ORDER BY Count ( * ) Desc LIMIT 1
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 contains 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 LIKE 12000
Step 1: For each row in city table, find the corresponding rows in address table.
Step 2: find the number of rows of each value of address's city_id in the results of step 1.
Step 3: find address_id, city, address's city_id of step 1 results with largest value in the results of step 2
Output: SELECT T1.address_id , T2.city , T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY Count ( * ) Desc LIMIT 1
find the date of weather table for which min_dew_point_f greater than 85
Output: SELECT date FROM weather WHERE min_dew_point_f > 85
Step 1: find the number of rows in weather table whose min_humidity greater than 8.
Step 2: find the min_temperature_f of weather table for which max_sea_level_pressure_inches less than 50.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Count ( * ) FROM weather WHERE min_humidity > 8 INTERSECT SELECT min_temperature_f FROM weather WHERE max_sea_level_pressure_inches < 50
Step 1: For each row in Students table, find the corresponding rows in Student_Course_Enrolment table.
Step 2: find date_of_enrolment, date_of_latest_logon of the results of step 1 whose family_name equals Zieme and personal_name equals Bernie
Output: SELECT T2.date_of_enrolment , T1.date_of_latest_logon FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id WHERE T1.family_name = "Zieme" AND T1.personal_name = "Bernie"
find the minimum Age, the maximum Age and the minimum Age in Student table
Output: SELECT Min ( Age ) , Max ( Age ) , Min ( Age ) FROM Student
find the Name of musical table
Output: SELECT Name FROM musical
find rows of Procedures table whose Cost greater than 5000 and Cost greater than 1500
Output: SELECT * FROM Procedures WHERE Cost > 1500 AND Cost > 5000
find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table
Output: SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics
Step 1: For each row in Employee table, find the corresponding rows in Customer table.
Step 2: find the number of CustomerId of each value of SupportRepId in the results of step 1.
Step 3: find Employee's LastName in the results of step 1 whose corresponding value in step 2 is greater than 20
Output: SELECT T2.LastName FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING Count ( T1.CustomerId ) > 20
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find FIRST_NAME, LAST_NAME, SALARY of the results of step 1 whose MIN_SALARY less than 6000
Output: SELECT T2.FIRST_NAME , T2.LAST_NAME , T2.SALARY FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.MIN_SALARY < 6000
find JOB_TITLE of jobs table whose MIN_SALARY greater than 12000 or MAX_SALARY greater than 40000
Output: SELECT JOB_TITLE FROM jobs WHERE MIN_SALARY > 12000 OR MAX_SALARY > 40000
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find PHONE_NUMBER of the results of step 1 whose SALARY greater than 8000 and MAX_SALARY less than 12000
Output: SELECT T2.PHONE_NUMBER FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 8000 AND T1.MAX_SALARY < 12000
Step 1: find the maximum Oppose_rate in candidate table.
Step 2: find the Poll_Source of candidate table whose Oppose_rate equals the results of step 1
Output: SELECT Poll_Source FROM candidate WHERE Oppose_rate = ( SELECT Max ( Oppose_rate ) FROM candidate )
find the start_date of trip table with largest value of bike_id
Output: SELECT start_date FROM trip ORDER BY bike_id Desc LIMIT 1
find the Name of company table for which Sales_in_Billion greater than 200 ordered descending by Sales_in_Billion
Output: SELECT Name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion Desc
Step 1: find the average min_humidity of each value of zip_code in weather table.
Step 2: find zip_code in weather table whose corresponding value in step 1 is less than 10
Output: SELECT zip_code FROM weather GROUP BY zip_code HAVING Avg ( min_humidity ) < 10
Step 1: For each row in employee table, find the corresponding rows in certificate table.
Step 2: find certificate's eid of the results of step 1 whose salary greater than 100000
Output: SELECT T2.eid FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid WHERE T1.salary > 100000