niryuu/sni-each-converted huggingface dataset:
find the maximum low_temperature and the maximum wind_speed_mph in weekly_weather table
Output: SELECT Max ( low_temperature ) , Max ( wind_speed_mph ) FROM weekly_weather
Step 1: For each row in employees table, find the corresponding rows in job_history table.
Step 2: find rows of the results of step 1 whose SALARY greater than 8000 or job_history's DEPARTMENT_ID equals 12000
Output: SELECT * FROM employees AS T1 JOIN job_history AS T2 ON T1.EMPLOYEE_ID = T2.EMPLOYEE_ID WHERE T1.SALARY > 8000 OR T2.DEPARTMENT_ID = 12000
Step 1: find the number of rows of each value of Market_Details in Street_Markets table.
Step 2: find Market_Details in Street_Markets table whose corresponding value in step 1 is greater than or equals walk
Output: SELECT Market_Details FROM Street_Markets GROUP BY Market_Details HAVING Count ( * ) > = "walk"
Step 1: find the Nickname of school_details table.
Step 2: find the Nickname of school_details table for which Division equals Division 1.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Nickname FROM school_details EXCEPT SELECT Nickname FROM school_details WHERE Division = "Division 1"
Step 1: For each row in employees table, find the corresponding rows in job_history table.
Step 2: find the number of different job_history's EMPLOYEE_ID of each value of employees's DEPARTMENT_ID in the results of step 1.
Step 3: find without repetition job_history's DEPARTMENT_ID in the results of step 1 whose corresponding value in step 2 is greater than or equals 4
Output: SELECT DISTINCT T2.DEPARTMENT_ID FROM employees AS T1 JOIN job_history AS T2 ON T1.EMPLOYEE_ID = T2.EMPLOYEE_ID GROUP BY T1.DEPARTMENT_ID HAVING Count ( DISTINCT T2.EMPLOYEE_ID ) > = 4
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_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 T2.airport_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the number of rows of each value of Award in musical table.
Step 2: find Award of musical table with largest value in the results of step 1
Output: SELECT Award FROM musical GROUP BY Award ORDER BY Count ( * ) Desc LIMIT 1
find without repetition the cust_name of customer table ordered ascending by credit_score
Output: SELECT DISTINCT cust_name FROM customer ORDER BY credit_score Asc
find the Music_Festival of music_festival table
Output: SELECT Music_Festival FROM music_festival
find the average price_in_dollars and the maximum price_in_euros in Catalog_Contents table
Output: SELECT Avg ( price_in_dollars ) , Max ( price_in_euros ) FROM Catalog_Contents
Step 1: find the date of weather table ordered descending by min_sea_level_pressure_inches.
Step 2: only show the first 5 rows of the results
Output: SELECT date FROM weather ORDER BY min_sea_level_pressure_inches Desc LIMIT 5
Step 1: For each row in Things table, find the corresponding rows in Timed_Status_of_Things table.
Step 2: find without repetition organization_id, Type_of_Thing_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.organization_id , T1.Type_of_Thing_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: find the number of rows of each value of Denomination in school table.
Step 2: find Denomination of school table with largest value in the results of step 1
Output: SELECT Denomination FROM school GROUP BY Denomination ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Residents table, find corresponding rows in Residents_Services table and in Customer_Events table.
Step 2: find Customer_Event_ID, Customer_Events's date_moved_in, Residents_Services's date_moved_in of the results of step 1
Output: SELECT T3.Customer_Event_ID , T3.date_moved_in , T2.date_moved_in FROM Residents AS T1 JOIN Residents_Services AS T2 ON T2.date_moved_in = T1.date_moved_in JOIN Customer_Events AS T3 ON T1.date_moved_in = T3.date_moved_in
find the number of rows in Products table whose product_name equals hot
Output: SELECT Count ( * ) FROM Products WHERE product_name = "hot"
find the catalog_entry_name, price_in_dollars of Catalog_Contents table for which price_in_pounds greater than 700
Output: SELECT catalog_entry_name , price_in_dollars FROM Catalog_Contents WHERE price_in_pounds > 700
Step 1: find the Customer_ID of Customers table.
Step 2: find the Customer_Details of Customers table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Customer_ID FROM Customers EXCEPT SELECT Customer_Details FROM Customers
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_sea_level_pressure_inches greater than 50
Output: SELECT Avg ( T1.duration ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.min_sea_level_pressure_inches > 50
find the average Total_Cattle in farm table whose Sheep_and_Goats greater than 5000
Output: SELECT Avg ( Total_Cattle ) FROM farm WHERE Sheep_and_Goats > 5000
Step 1: find the date, mean_temperature_f, max_gust_speed_mph of weather table ordered descending by max_wind_Speed_mph.
Step 2: only show the first 3 rows of the results
Output: SELECT date , mean_temperature_f , max_gust_speed_mph FROM weather ORDER BY max_wind_Speed_mph Desc LIMIT 3
Step 1: For each row in Customers table, find the corresponding rows in Complaints table.
Step 2: find the number of rows of each value of Complaints's customer_id in the results of step 1.
Step 3: find phone_number of step 1 results with largest value in the results of step 2
Output: SELECT T1.phone_number FROM Customers AS T1 JOIN Complaints AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_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 greater than 8000 or 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 > 8000 OR T1.MAX_SALARY < = 12000
find Market_Details of Street_Markets table whose Market_Details equals walk or Market_Details equals bus
Output: SELECT Market_Details FROM Street_Markets WHERE Market_Details = "bus" OR Market_Details = "walk"
find rows of employees table whose SALARY greater than 8000 or DEPARTMENT_ID equals 12000
Output: SELECT * FROM employees WHERE SALARY > 8000 OR DEPARTMENT_ID = 12000
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, Result of the results of step 1
Output: SELECT T1.Famous_Release_date , T3.Result 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
Step 1: For each row in trip table, find the corresponding rows in weather table.
Step 2: find trip's zip_code of the results of step 1 whose precipitation_inches greater than 80 or min_sea_level_pressure_inches greater than 29.97
Output: SELECT T1.zip_code FROM trip AS T1 JOIN weather AS T2 WHERE T2.precipitation_inches > 80 OR T2.min_sea_level_pressure_inches > 29.97
Step 1: For each row in Catalog_Structure table, find corresponding rows in Catalogs table and in Catalog_Contents table.
Step 2: find catalog_entry_name, catalog_publisher of the results of step 1 whose price_in_pounds greater than 700
Output: SELECT T3.catalog_entry_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_pounds > 700
find the artist_name of files table
Output: SELECT artist_name FROM files
find the maximum low_temperature and the maximum high_temperature in weekly_weather table
Output: SELECT Max ( low_temperature ) , Max ( high_temperature ) FROM weekly_weather
find the problem_log_id, problem_id of Problem_Log table with smallest value of problem_log_id
Output: SELECT problem_log_id , problem_id FROM Problem_Log ORDER BY problem_log_id Asc LIMIT 1
find the catalog_name of Catalogs table for which date_of_latest_revision greater than 8
Output: SELECT catalog_name FROM Catalogs WHERE date_of_latest_revision > 8
Step 1: find the date, mean_temperature_f, max_dew_point_f 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 , max_dew_point_f FROM weather ORDER BY max_gust_speed_mph Desc LIMIT 3
find the cName, enr of College table for which enr greater than 10000
Output: SELECT cName , enr FROM College WHERE enr > 10000
find Fname, Lname of Faculty table whose Rank equals M and Sex equals NEB
Output: SELECT Fname , Lname FROM Faculty WHERE Rank = "M" AND Sex = "NEB"
Step 1: find the OMIM of enzyme table.
Step 2: find the number of rows in enzyme table whose id not one of the results of step 1
Output: SELECT Count ( * ) FROM enzyme WHERE id NOT IN ( SELECT OMIM FROM enzyme )
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 ReportsTo not one of the results of step 1
Output: SELECT T1.LastName FROM Employee AS T1 WHERE T1.ReportsTo NOT IN ( SELECT T2.SupportRepId FROM Customer AS T2 WHERE T2.LastName > 20 )
Step 1: find the Support_rate of candidate table ordered descending by Consider_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Support_rate FROM candidate ORDER BY Consider_rate Desc LIMIT 3
Step 1: find the Oppose_rate of candidate table ordered descending by Oppose_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Oppose_rate FROM candidate ORDER BY Oppose_rate Desc LIMIT 3
find the average length_meters in bridge table
Output: SELECT Avg ( length_meters ) FROM bridge
Step 1: find the number of rows of each value of driverId in pitStops table.
Step 2: find driverId, driverId in pitStops table whose corresponding value in step 1 is greater than 5
Output: SELECT driverId , driverId FROM pitStops GROUP BY driverId HAVING Count ( * ) > 5
Step 1: find the date, mean_temperature_f, mean_wind_speed_mph of weather table ordered descending by max_wind_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_wind_Speed_mph Desc LIMIT 3
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 max_humidity greater than 50
Output: SELECT Avg ( T1.duration ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.max_humidity > 50
find the average Age in artist table whose Age greater than or equals 25
Output: SELECT Avg ( Age ) FROM artist WHERE Age > = 25
find the product_name, typical_buying_price, typical_buying_price of Products table for which product_description equals yellow
Output: SELECT product_name , typical_buying_price , typical_buying_price FROM Products WHERE product_description = "yellow"
find the start_date of trip table with largest value of start_station_id
Output: SELECT start_date FROM trip ORDER BY start_station_id Desc LIMIT 1
Step 1: find the summation of Total_Horses of each value of Farm_ID in farm table.
Step 2: find Total_Horses, Pigs of farm table ordered ascending by the results of step 1
Output: SELECT Total_Horses , Pigs FROM farm GROUP BY Farm_ID ORDER BY Sum ( Total_Horses ) Asc
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 Sex 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 T1.Sex = "M" AND T1.Building = "NEB"
Step 1: For each row in Appointment table, find corresponding rows in Nurse table and in Prescribes table.
Step 2: find the number of rows of each value of Prescribes's Physician in the results of step 1.
Step 3: find Name of the results of step 1 with largest value in the results of step 2
Output: SELECT T1.Name FROM Nurse AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.PrepNurse JOIN Prescribes AS T3 ON T2.AppointmentID = T3.Appointment GROUP BY T3.Physician ORDER BY Count ( * ) Desc LIMIT 1
find the number of rows in airports table whose country equals American Airlines
Output: SELECT Count ( * ) FROM airports WHERE country = "American Airlines"
Step 1: For each row in wine table, find corresponding rows in grapes table and in appellations table.
Step 2: find without repetition County of the results of step 1 whose Color equals Red
Output: SELECT DISTINCT T2.County FROM grapes AS T1 JOIN appellations AS T2 JOIN wine AS T3 ON T1.Grape = T3.Grape AND T3.Appelation = T2.Appelation WHERE T1.Color = "Red"
Step 1: find the date, mean_temperature_f, mean_dew_point_f of weather table ordered descending by max_wind_Speed_mph.
Step 2: only show the first 3 rows of the results
Output: SELECT date , mean_temperature_f , mean_dew_point_f FROM weather ORDER BY max_wind_Speed_mph Desc LIMIT 3
Step 1: For each row in game table, find corresponding rows in stadium table and in injury_accident table.
Step 2: find name, Player, Source of the results of step 1 whose Injury not equals Knee problem
Output: SELECT T1.name , T3.Player , T3.Source FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id WHERE T3.Injury ! = "Knee problem"
Step 1: find the number of rows of each value of Investor 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 Investor ORDER BY Count ( * ) Desc LIMIT 1
find the average rows in weather table whose min_visibility_miles greater than 50
Output: SELECT Avg ( * ) FROM weather WHERE min_visibility_miles > 50
Step 1: find the Company of entrepreneur table for which Money_Requested greater than 140000.
Step 2: find the Investor of entrepreneur table for which Money_Requested less than 120000.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Company FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000
Step 1: find the Musical_ID 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 Musical_ID FROM actor )
Step 1: For each row in Customer_Orders table, find corresponding rows in Customers table and in Order_Items table.
Step 2: find the summation of order_quantity in the results of step 1 whose date_became_customer less than 2018-03-17 07:13:53
Output: SELECT Sum ( T3.order_quantity ) FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Order_Items AS T3 ON T2.order_id = T3.order_id WHERE T1.date_became_customer < "2018-03-17 07:13:53"
find the average stamina in Player_Attributes table
Output: SELECT Avg ( stamina ) FROM Player_Attributes
Step 1: find the enzyme_id of medicine_enzyme_interaction table.
Step 2: find the number of rows in medicine table whose rows not one of the results of step 1
Output: SELECT Count ( * ) FROM medicine AS T1 WHERE * NOT IN ( SELECT T2.enzyme_id FROM medicine_enzyme_interaction AS T2 )
Step 1: find the flno of flight table ordered ascending by price.
Step 2: only show the first 3 rows of the results
Output: SELECT flno FROM flight ORDER BY price Asc LIMIT 3
find the date of weather table for which mean_sea_level_pressure_inches greater than 85
Output: SELECT date FROM weather WHERE mean_sea_level_pressure_inches > 85
Step 1: For each row in Ref_Document_Types table, find the corresponding rows in Documents table.
Step 2: find Document_Type_Name, Other_Details, Document_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 , T2.Other_Details , T2.Document_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: find the number of rows in weather table whose min_humidity greater than 8.
Step 2: find the max_sea_level_pressure_inches 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_sea_level_pressure_inches FROM weather WHERE max_temperature_f < 50
find the zip_code, min_temperature_f of weather table for which min_visibility_miles less than 80
Output: SELECT zip_code , min_temperature_f FROM weather WHERE min_visibility_miles < 80
Step 1: find the rows in weather table whose zip_code equals 94107.
Step 2: find each value of events in the results of step 1 ordered descending by number of rows that correspond of each value.
Step 3: only show the first 3 rows of the results
Output: SELECT events FROM weather WHERE zip_code = 94107 GROUP BY zip_code ORDER BY Count ( * ) Desc LIMIT 3
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 Nurse's Position in the results of step 1.
Step 3: find Physician's Name of the results of step 1 with largest value in the results of step 2
Output: SELECT T1.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 T2.Position ORDER BY Count ( * ) Desc LIMIT 1
find start_station_id of trip table whose duration greater than 60 and duration greater than 384
Output: SELECT start_station_id FROM trip WHERE duration > 384 AND duration > 60
find without repetition the product_category of Products table
Output: SELECT DISTINCT product_category FROM Products
find the rows of jobs table for which MAX_SALARY greater than 2500
Output: SELECT * FROM jobs WHERE MAX_SALARY > 2500
Step 1: find the number of different EMPLOYEE_ID of each value of DEPARTMENT_ID in job_history table.
Step 2: find without repetition DEPARTMENT_ID in job_history table whose corresponding value in step 1 is greater than or equals 4
Output: SELECT DISTINCT DEPARTMENT_ID FROM job_history GROUP BY DEPARTMENT_ID HAVING Count ( DISTINCT EMPLOYEE_ID ) > = 4
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 MIN_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.MIN_SALARY > 12000
Step 1: For each row in Customer_Events table, find corresponding rows in Customers table and in Residents table.
Step 2: find Customers's customer_id, Customer_Events's date_moved_in, date_moved_out of the results of step 1
Output: SELECT T1.customer_id , T3.date_moved_in , T2.date_moved_out FROM Customers AS T1 JOIN Residents AS T2 JOIN Customer_Events AS T3 ON T1.customer_id = T3.customer_id AND T3.date_moved_in = T2.date_moved_in AND T1.customer_id = T3.customer_id
Step 1: find the minimum date_assigned_to in Staff_Department_Assignments table.
Step 2: find the staff_id of Staff_Department_Assignments table whose date_assigned_to less than the results of step 1
Output: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < ( SELECT Min ( date_assigned_to ) FROM Staff_Department_Assignments )
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 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: 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 Sex equals M and Faculty's Building equals NEB.
Step 3: find DName, Lname of the results of step 1 whose Sex 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 T1.Sex = "M" 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 T1.Sex = "M" AND T1.Building = "NEB"
find the id of trip table for which duration greater than 60
Output: SELECT id FROM trip WHERE duration > 60
Step 1: For each row in Type_Of_Restaurant table, find corresponding rows in Restaurant table and in Restaurant_Type table.
Step 2: find Address of the results of step 1 whose ResTypeName equals Subway
Output: SELECT T1.Address FROM Restaurant AS T1 JOIN Type_Of_Restaurant AS T2 ON T1.ResID = T2.ResID JOIN Restaurant_Type AS T3 ON T2.ResTypeID = T3.ResTypeID WHERE T3.ResTypeName = "Subway"
find the minimum Support_rate, the maximum Consider_rate and the minimum Oppose_rate in candidate table
Output: SELECT Min ( Support_rate ) , Max ( Consider_rate ) , Min ( Oppose_rate ) FROM candidate
Step 1: find the course_id of prereq table.
Step 2: find the number of rows in section table whose section's course_id not one of the results of step 1
Output: SELECT Count ( * ) FROM section AS T1 WHERE T1.course_id NOT IN ( SELECT T2.course_id FROM prereq AS T2 )
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find gender, artist's artist_name of the results of step 1 with smallest value of song_name
Output: SELECT T1.gender , T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.song_name Asc LIMIT 1
find the name of enzyme table for which Porphyria not equals Heme
Output: SELECT name FROM enzyme WHERE Porphyria ! = "Heme"
find the address_line_1, email_address of Customers table for which email_address equals vbogisich@example.org
Output: SELECT address_line_1 , email_address FROM Customers WHERE email_address = "vbogisich@example.org"
find zip_code of weather table whose min_temperature_f greater than 80 or min_sea_level_pressure_inches greater than 29.97
Output: SELECT zip_code FROM weather WHERE min_temperature_f > 80 OR min_sea_level_pressure_inches > 29.97
Step 1: find the City of city table for which Regional_Population greater than 23019148.
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.Regional_Population > 23019148 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 zip_code, min_temperature_f of weather table for which min_visibility_miles greater than 80
Output: SELECT zip_code , min_temperature_f FROM weather WHERE min_visibility_miles > 80
Step 1: For each row in College table, find the corresponding rows in Tryout table.
Step 2: find College's cName of the results of step 1 whose pPos equals mid.
Step 3: For each row in Player table, find the corresponding rows in Tryout table.
Step 4: find Tryout's cName of the results of step 3 whose HS equals 1200.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T1.cName FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = "mid" INTERSECT SELECT T2.cName FROM Player AS T3 JOIN Tryout AS T2 ON T3.pID = T2.pID WHERE T3.HS = 1200
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
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 = 18
find the Candidate_ID of candidate table with smallest value of Unsure_rate
Output: SELECT Candidate_ID FROM candidate ORDER BY Unsure_rate Asc LIMIT 1
find the average price_in_dollars and the minimum price_in_euros in Catalog_Contents table
Output: SELECT Avg ( price_in_dollars ) , Min ( price_in_euros ) FROM Catalog_Contents
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 MAX_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.MAX_SALARY < = "D" ORDER BY T2.SALARY Desc
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_sea_level_pressure_inches greater than 85
Output: SELECT T1.start_date FROM trip AS T1 JOIN weather AS T2 WHERE T2.min_sea_level_pressure_inches > 85
find the average price_in_euros and the maximum price_in_euros in Catalog_Contents table
Output: SELECT Avg ( price_in_euros ) , Max ( price_in_euros ) FROM Catalog_Contents
find the number of rows in budget table whose total_budget_percent_budgeted less than 2
Output: SELECT Count ( * ) FROM budget WHERE total_budget_percent_budgeted < 2
find the events of weather table for which zip_code equals 3
Output: SELECT events FROM weather WHERE zip_code = 3
Step 1: For each row in School table, find the corresponding rows in budget table.
Step 2: find School_name, total_budget_percent_budgeted, Invested of the results of step 1 whose Year greater than or equals 2002
Output: SELECT T1.School_name , T2.total_budget_percent_budgeted , T2.Invested FROM School AS T1 JOIN budget AS T2 ON T1.School_id = T2.School_id WHERE T2.Year > = 2002
Step 1: find the number of rows of each value of Department_ID in department table.
Step 2: find Num_Employees of department table with largest value in the results of step 1
Output: SELECT Num_Employees FROM department GROUP BY Department_ID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 2: find characteristic_name of the results of step 1 whose product_category_code equals Herbs
Output: SELECT T1.characteristic_name FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T2.product_category_code = "Herbs"
Step 1: find the Support_rate of candidate table ordered descending by Oppose_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Support_rate FROM candidate ORDER BY Oppose_rate Desc LIMIT 3
find Fname, Lname of Faculty table whose Fname equals Linda and Lname equals Smith
Output: SELECT Fname , Lname FROM Faculty WHERE Fname = "Linda" AND Lname = "Smith"
Step 1: find the Name of actor table.
Step 2: find the Name of actor table whose Musical_ID not one of the results of step 1
Output: SELECT Name FROM actor WHERE Musical_ID NOT IN ( SELECT Name FROM actor )
find start_date of trip table whose duration greater than 60 and start_date equals 8/21/2015 17:03
Output: SELECT start_date FROM trip WHERE duration > 60 AND start_date = "8/21/2015 17:03"
Step 1: For each row in School table, find the corresponding rows in endowment table.
Step 2: find School_name of the results of step 1 whose amount greater than 10 or Enrollment less than 495
Output: SELECT T1.School_name FROM School AS T1 JOIN endowment AS T2 ON T1.School_id = T2.School_id WHERE T2.amount > 10 OR T1.Enrollment < 495
find the date of weather table for which min_visibility_miles greater than 85
Output: SELECT date FROM weather WHERE min_visibility_miles > 85
Step 1: find the Year of wine table for which Winery equals Brander.
Step 2: find the Name of wine table whose Year less than the results of step 1
Output: SELECT Name FROM wine WHERE Year < ( SELECT Year FROM wine WHERE Winery = "Brander" )
Step 1: For each row in artist table, find the corresponding rows in volume table.
Step 2: find the average Weeks_on_Top in the results of step 1 whose Famous_Release_date greater than or equals 25
Output: SELECT Avg ( T2.Weeks_on_Top ) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Famous_Release_date > = 25
Step 1: For each row in broadcast table, find corresponding rows in program table and in channel table.
Step 2: find channel's Owner of the results of step 1 whose program's Name equals Morning.
Step 3: For each row in program table, find the corresponding rows in broadcast table.
Step 4: find program's Owner of the results of step 3 whose Time_of_day equals Night.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T2.Owner FROM program AS T1 JOIN channel AS T2 JOIN broadcast AS T3 ON T1.Program_ID = T3.Program_ID AND T3.Channel_ID = T2.Channel_ID WHERE T1.Name = "Morning" INTERSECT SELECT T1.Owner FROM program AS T1 JOIN broadcast AS T3 ON T1.Program_ID = T3.Program_ID WHERE T3.Time_of_day = "Night"
find the product_name, typical_selling_price, typical_selling_price of Products table for which product_description equals yellow
Output: SELECT product_name , typical_selling_price , typical_selling_price FROM Products WHERE product_description = "yellow"
find the average price_in_pounds and the minimum price_in_euros in Catalog_Contents table
Output: SELECT Avg ( price_in_pounds ) , Min ( price_in_euros ) FROM Catalog_Contents
find the Date, Unsure_rate, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Date , Unsure_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
find the FIRST_NAME, LAST_NAME, DEPARTMENT_ID, DEPARTMENT_ID of employees table
Output: SELECT FIRST_NAME , LAST_NAME , DEPARTMENT_ID , DEPARTMENT_ID FROM employees
find the Name of actor table
Output: SELECT Name FROM actor
find the Fname, LName of Student table for which Advisor equals 18
Output: SELECT Fname , LName FROM Student WHERE Advisor = 18
Step 1: For each row in Addresses table, find corresponding rows in Drama_Workshop_Groups table and in Stores table.
Step 2: find the number of different Currency_Code in the results of step 1 whose Stores's Marketing_Region_Code equals IN
Output: SELECT Count ( DISTINCT T2.Currency_Code ) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T2.Address_ID = T1.Address_ID JOIN Stores AS T3 ON T1.Address_ID = T3.Address_ID WHERE T3.Marketing_Region_Code = "IN"
find the number of different Currency_Code in Drama_Workshop_Groups table whose Currency_Code equals EU
Output: SELECT Count ( DISTINCT Currency_Code ) FROM Drama_Workshop_Groups WHERE Currency_Code = "EU"
Step 1: find the average salary in employee table.
Step 2: find the eid of employee table whose salary greater than the results of step 1
Output: SELECT eid FROM employee WHERE salary > ( SELECT Avg ( salary ) FROM employee )
find the Date_of_ceremony, Music_Festival of music_festival table
Output: SELECT Date_of_ceremony , Music_Festival FROM music_festival
Step 1: find the artist_name of artist table for which country equals UK.
Step 2: find the artist_name of artist table for which country equals english.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM artist WHERE country = "english"
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 mean_sea_level_pressure_inches greater than 85
Output: SELECT T1.start_date FROM trip AS T1 JOIN weather AS T2 WHERE T2.mean_sea_level_pressure_inches > 85
find the average price_in_pounds and the maximum price_in_euros in Catalog_Contents table
Output: SELECT Avg ( price_in_pounds ) , Max ( price_in_euros ) FROM Catalog_Contents
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find EMPLOYEE_ID, JOB_TITLE of the results of step 1
Output: SELECT T2.EMPLOYEE_ID , T1.JOB_TITLE FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find without repetition Person's name, age of the results of step 1 whose job equals Dan or friend equals Alice
Output: SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.job = "Dan" OR T2.friend = "Alice"
find order_id, customer_id of Customer_Orders table whose order_status_code equals Cancelled or order_status_code equals Paid
Output: SELECT order_id , customer_id FROM Customer_Orders WHERE order_status_code = "Paid" OR order_status_code = "Cancelled"
Step 1: find the date, mean_temperature_f, min_dew_point_f of weather table ordered descending by mean_wind_speed_mph.
Step 2: only show the first 3 rows of the results
Output: SELECT date , mean_temperature_f , min_dew_point_f FROM weather ORDER BY mean_wind_speed_mph Desc LIMIT 3
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_id in the results of step 1.
Step 3: find airport's id, name, Date of step 1 results with largest value in the results of step 2
Output: SELECT T1.id , T1.name , T2.Date FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T2.airport_id ORDER BY Count ( * ) Desc LIMIT 1
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 Advisor equals 1121
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 = 18 AND T1.Advisor = 1121
find JOB_TITLE, MAX_SALARY, MAX_SALARY of jobs table whose JOB_TITLE contains President and MAX_SALARY greater than 12000
Output: SELECT JOB_TITLE , MAX_SALARY , MAX_SALARY FROM jobs WHERE JOB_TITLE LIKE "President" AND MAX_SALARY > 12000
Step 1: For each row in match_season table, find corresponding rows in country table and in team table.
Step 2: find Official_native_language of the results of step 1 whose Name contains English
Output: SELECT T1.Official_native_language FROM country AS T1 JOIN team AS T2 JOIN match_season AS T3 ON T1.Country_id = T3.Country AND T3.Team = T2.Team_id WHERE T2.Name LIKE "English"
find the Name of Nurse table with largest value of Registered
Output: SELECT Name FROM Nurse ORDER BY Registered Desc LIMIT 1
Step 1: find the number of rows of each value of County_Id in county table.
Step 2: find County_name in county table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT County_name FROM county GROUP BY County_Id HAVING Count ( * ) > = 2
Step 1: For each row in musical table, find the corresponding rows in actor table.
Step 2: find Character of the results of step 1 whose Award equals Tony Award or actor's Name equals Cleavant Derricks
Output: SELECT T2.Character FROM musical AS T1 JOIN actor AS T2 WHERE T1.Award = "Tony Award" OR T2.Name = "Cleavant Derricks"
find cName, enr of College table whose state equals LA or enr greater than 10000
Output: SELECT cName , enr FROM College WHERE state = "LA" OR enr > 10000
find the maximum rows and the minimum customer_phone in Customers table
Output: SELECT Max ( * ) , Min ( customer_phone ) FROM Customers
Step 1: For each row in school table, find the corresponding rows in school_details table.
Step 2: find School of the results of step 1 whose Division not equals Division 1
Output: SELECT T1.School FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID WHERE T2.Division ! = "Division 1"
find the number of rows in Student table whose Sex equals M
Output: SELECT Count ( * ) FROM Student WHERE Sex = "M"
Step 1: For each row in ACCOUNTS table, find the corresponding rows in SAVINGS table.
Step 2: find name, balance of the results of step 1 whose balance less than 200000
Output: SELECT T1.name , T2.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid WHERE T2.balance < 200000
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 mean_dew_point_f greater than 85
Output: SELECT T1.start_date FROM trip AS T1 JOIN weather AS T2 WHERE T2.mean_dew_point_f > 85
find without repetition the Eliminated_By of Elimination table for which Team not equals Tokyo , Japan
Output: SELECT DISTINCT Eliminated_By FROM Elimination WHERE Team ! = "Tokyo , Japan"
find without repetition the Name of Physician table ordered ascending by Name
Output: SELECT DISTINCT Name FROM Physician ORDER BY Name Asc
Step 1: find the number of rows of each value of id in airport table.
Step 2: find id, name, ICAO of airport table with largest value in the results of step 1
Output: SELECT id , name , ICAO FROM airport GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
find JOB_TITLE, MIN_SALARY, MAX_SALARY of jobs table whose MAX_SALARY greater than 12000 and MIN_SALARY less than or equals 18000
Output: SELECT JOB_TITLE , MIN_SALARY , MAX_SALARY FROM jobs WHERE MAX_SALARY > 12000 AND MIN_SALARY < = 18000
find JOB_TITLE, MIN_SALARY, MAX_SALARY of jobs table whose MIN_SALARY contains 12000 and MAX_SALARY greater than 18000
Output: SELECT JOB_TITLE , MIN_SALARY , MAX_SALARY FROM jobs WHERE MIN_SALARY LIKE 12000 AND MAX_SALARY > 18000
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 MIN_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.MIN_SALARY > 12000
find start_date of trip table whose duration greater than 60 and end_station_name equals San Francisco Caltrain 2 (330 Townsend)
Output: SELECT start_date FROM trip WHERE duration > 60 AND end_station_name = "San Francisco Caltrain 2 (330 Townsend)"
Step 1: For each row in Ref_Characteristic_Types table, find the corresponding rows in Characteristics table.
Step 2: find characteristic_name, other_characteristic_details, characteristic_type_description 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.characteristic_name , T2.other_characteristic_details , T1.characteristic_type_description FROM Ref_Characteristic_Types AS T1 JOIN Characteristics AS T2 ON T1.characteristic_type_code = T2.characteristic_type_code EXCEPT SELECT T2.characteristic_name , T2.other_characteristic_details , T2.characteristic_data_type FROM Characteristics AS T2
find the average length_feet in bridge table whose name equals Xian Ren Qiao (Fairy Bridge)
Output: SELECT Avg ( length_feet ) FROM bridge WHERE name = "Xian Ren Qiao (Fairy Bridge)"
Step 1: For each row in Employee table, find the corresponding rows in Customer table.
Step 2: find Employee's LastName of the results of step 1 whose Customer's LastName greater than 20
Output: SELECT T2.LastName FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.LastName > 20
Step 1: find the number of rows of each value of Department_ID in department table.
Step 2: find Creation of department table with largest value in the results of step 1
Output: SELECT Creation FROM department GROUP BY Department_ID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in country table, find the corresponding rows in match_season table.
Step 2: find Official_native_language of the results of step 1 whose Player contains English
Output: SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Player LIKE "English"
Step 1: For each row in Organizations table, find corresponding rows in Services table and in Things table.
Step 2: find without repetition Services's service_type_code of the results of step 1 whose Things's service_details equals Denesik and Sons Party
Output: SELECT DISTINCT T2.service_type_code FROM Organizations AS T1 JOIN Services AS T2 ON T2.organization_id = T1.organization_id JOIN Things AS T3 ON T1.organization_id = T3.organization_id WHERE T3.service_details = "Denesik and Sons Party"
Step 1: find the City of city table.
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 EXCEPT 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 jobs table, find the corresponding rows in employees table.
Step 2: find SALARY, MIN_SALARY of the results of step 1
Output: SELECT T2.SALARY , T1.MIN_SALARY FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID
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, Music_Festival of the results of step 1
Output: SELECT T1.Famous_Release_date , T3.Music_Festival 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 Sheep_and_Goats in farm table whose Pigs greater than 5000
Output: SELECT Avg ( Sheep_and_Goats ) FROM farm WHERE Pigs > 5000
find bike_id of trip table whose duration greater than 60 and duration greater than 384
Output: SELECT bike_id FROM trip WHERE duration > 384 AND duration > 60
Step 1: For each row in station table, find the corresponding rows in weather table.
Step 2: find zip_code of the results of step 1 whose long greater than 80 or mean_sea_level_pressure_inches greater than 30.02
Output: SELECT T2.zip_code FROM station AS T1 JOIN weather AS T2 WHERE T1.long > 80 OR T2.mean_sea_level_pressure_inches > 30.02
Step 1: For each row in ACCOUNTS table, find the corresponding rows in SAVINGS table.
Step 2: find name of the results of step 1 whose balance less than 200000
Output: SELECT T1.name FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid WHERE T2.balance < 200000
find JOB_TITLE, MIN_SALARY of jobs table whose MAX_SALARY contains 12000 and MAX_SALARY greater than 18000
Output: SELECT JOB_TITLE , MIN_SALARY FROM jobs WHERE MAX_SALARY LIKE 18000 AND MAX_SALARY > 12000
Step 1: For each row in country table, find the corresponding rows in match_season table.
Step 2: find Country_name of the results of step 1 whose Position equals Defender
Output: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
find the cust_name, no_of_loans of customer table
Output: SELECT cust_name , no_of_loans FROM customer
find the cust_name of customer table ordered ascending by acc_bal
Output: SELECT cust_name FROM customer ORDER BY acc_bal Asc
find the maximum Consider_rate in candidate table
Output: SELECT Max ( Consider_rate ) FROM candidate
find JOB_TITLE, MAX_SALARY of jobs table whose JOB_TITLE equals President and MAX_SALARY greater than 12000
Output: SELECT JOB_TITLE , MAX_SALARY FROM jobs WHERE JOB_TITLE = "President" AND MAX_SALARY > 12000
Step 1: find the number of rows of each value of Name 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 Name ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Documents table, find corresponding rows in Ref_Document_Types table and in Documents_with_Expenses table.
Step 2: find Budget_Type_Code, Document_Type_Description of the results of step 1
Output: SELECT T3.Budget_Type_Code , T1.Document_Type_Description FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code JOIN Documents_with_Expenses AS T3 ON T2.Document_ID = T3.Document_ID
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 district, city, city's city_id of step 1 results with largest value in the results of step 2
Output: SELECT T1.district , T2.city , T2.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
Step 1: find the City of city table for which GDP greater than 1919.57.
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.GDP > 1919.57 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 rows of jobs table whose JOB_TITLE equals President and MIN_SALARY greater than 12000
Output: SELECT * FROM jobs WHERE JOB_TITLE = "President" AND MIN_SALARY > 12000
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 Nurse's Name in the results of step 1.
Step 3: find Physician's Name of the results of step 1 with largest value in the results of step 2
Output: SELECT T1.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 T2.Name ORDER BY Count ( * ) Desc LIMIT 1
find JOB_TITLE, MIN_SALARY of jobs table whose JOB_TITLE equals President and MAX_SALARY greater than 12000
Output: SELECT JOB_TITLE , MIN_SALARY FROM jobs WHERE JOB_TITLE = "President" AND MAX_SALARY > 12000
find the meter_700, meter_400 of swimmer table for which Nationality equals Australia
Output: SELECT meter_700 , meter_400 FROM swimmer WHERE Nationality = "Australia"
find id of trip table whose duration greater than 60 and duration greater than 384
Output: SELECT id FROM trip WHERE duration > 384 AND duration > 60
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, date_moved_out of the results of step 1
Output: SELECT T2.Customer_Event_ID , T2.date_moved_in , T1.date_moved_out FROM Residents AS T1 JOIN Customer_Events AS T2 ON T1.date_moved_in = T2.date_moved_in
find the catalog_entry_name of Catalog_Contents table with largest value of price_in_euros
Output: SELECT catalog_entry_name FROM Catalog_Contents ORDER BY price_in_euros Desc LIMIT 1
find rows of jobs table whose MIN_SALARY greater than 2500 and MAX_SALARY less than 40000
Output: SELECT * FROM jobs WHERE MIN_SALARY > 2500 AND MAX_SALARY < 40000
find the login_name of Course_Authors_and_Tutors table
Output: SELECT login_name FROM Course_Authors_and_Tutors
find each value of budget in department table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , budget FROM department GROUP BY budget
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find Fname, LName of the results of step 1 whose President_Vote equals 18
Output: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.President_Vote = 18