niryuu/sni-each-converted huggingface dataset:
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition LName of the results of step 1 whose Advisor equals 8741 and Secretary_Vote equals 1010
Output: SELECT DISTINCT T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T1.Advisor = 8741 AND T2.Secretary_Vote = 1010
Step 1: find the Actor_ID 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 Actor_ID FROM actor )
find the Employee_ID of Employees table for which Employee_Name equals Leo
Output: SELECT Employee_ID FROM Employees WHERE Employee_Name = "Leo"
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 Faculty'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 T1.Building = "M" AND T2.Building = "NEB"
find JOB_TITLE, MIN_SALARY, MAX_SALARY of jobs table whose MAX_SALARY contains 12000 and MAX_SALARY greater than 18000
Output: SELECT JOB_TITLE , MIN_SALARY , MAX_SALARY FROM jobs WHERE MAX_SALARY LIKE 18000 AND MAX_SALARY > 12000
find the average Age in artist table whose Famous_Release_date greater than or equals 25
Output: SELECT Avg ( Age ) FROM artist WHERE Famous_Release_date > = 25
Step 1: find the address_line_1, email_address of Customers table for which email_address equals hsteuber@example.org.
Step 2: find the address_line_2, email_address of Customers table for which email_address equals vbogisich@example.org.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT address_line_1 , email_address FROM Customers WHERE email_address = "hsteuber@example.org" INTERSECT SELECT address_line_2 , email_address FROM Customers WHERE email_address = "vbogisich@example.org"
find the City, City of city table with smallest value of GDP
Output: SELECT City , City FROM city ORDER BY GDP Asc 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 MIN_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.MIN_SALARY LIKE 12000
Step 1: For each row in volume table, find the corresponding rows in music_festival table.
Step 2: find Issue_Date, Date_of_ceremony of the results of step 1
Output: SELECT T1.Issue_Date , T2.Date_of_ceremony FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume
find the Name, Score of wine table for which Grape equals White
Output: SELECT Name , Score FROM wine WHERE Grape = "White"
find dorm_name, gender of Dorm table whose student_capacity equals 300 or student_capacity less than 100
Output: SELECT dorm_name , gender FROM Dorm WHERE student_capacity = 100 OR student_capacity < 300
find the average Total_Horses in farm table whose Total_Horses greater than 5000
Output: SELECT Avg ( Total_Horses ) FROM farm WHERE Total_Horses > 5000
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 Faculty'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 = "M" AND T1.Building = "NEB"
Step 1: For each row in Nurse 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 Nurse AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.PrepNurse GROUP BY T2.AppointmentID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the Consider_rate of candidate table ordered descending by Oppose_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Consider_rate FROM candidate ORDER BY Oppose_rate Desc LIMIT 3
Step 1: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 2: find characteristic_name, other_characteristic_details, characteristic_type_code of the results of step 1 whose product_name equals cumin.
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 T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_type_code FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T2.product_name = "cumin" EXCEPT SELECT T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_data_type FROM Characteristics AS T1
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 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 LIKE 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 rows of weather table for which max_sea_level_pressure_inches greater 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 * FROM weather WHERE max_sea_level_pressure_inches > 50
find the asset_details of Assets table ordered ascending by other_asset_details
Output: SELECT asset_details FROM Assets ORDER BY other_asset_details Asc
Step 1: For each row in Has_amenity table, find corresponding rows in Dorm table and in Dorm_amenity table.
Step 2: find student_capacity, gender of the results of step 1 whose amenity_name contains Donor
Output: SELECT T1.student_capacity , T1.gender FROM Dorm AS T1 JOIN Dorm_amenity AS T2 JOIN Has_amenity AS T3 ON T1.dormid = T3.dormid AND T3.amenid = T2.amenid WHERE T2.amenity_name LIKE "Donor"
Step 1: For each row in Nurse table, find the corresponding rows in Appointment table.
Step 2: find the number of rows of each value of ExaminationRoom 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 Nurse AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.PrepNurse GROUP BY T2.ExaminationRoom ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the rows of jobs table for which MIN_SALARY greater than 20000.
Step 2: find the JOB_TITLE of jobs table for which 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 jobs WHERE MIN_SALARY > 20000 INTERSECT SELECT JOB_TITLE FROM jobs WHERE MIN_SALARY > 12000
find without repetition first_name of customers table whose first_name equals Eduardo and last_name equals Martins
Output: SELECT DISTINCT first_name FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"
Step 1: find the number of rows of each value of name in user_profiles table.
Step 2: find name, email in user_profiles table whose corresponding value in step 1 is greater than 1
Output: SELECT name , email FROM user_profiles GROUP BY name HAVING Count ( * ) > 1
find JOB_TITLE of jobs table whose MIN_SALARY greater than 12000 and MIN_SALARY greater than 20000
Output: SELECT JOB_TITLE FROM jobs WHERE MIN_SALARY > 20000 AND MIN_SALARY > 12000
find JOB_TITLE, MIN_SALARY, MIN_SALARY of jobs table whose MAX_SALARY greater than 12000 and MAX_SALARY less than or equals 18000
Output: SELECT JOB_TITLE , MIN_SALARY , MIN_SALARY FROM jobs WHERE MAX_SALARY > 18000 AND MAX_SALARY < = 12000
Step 1: find the number of rows of each value of Order_ID in Invoices table.
Step 2: find Product_ID of Invoices table with largest value in the results of step 1
Output: SELECT Product_ID FROM Invoices GROUP BY Order_ID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in appellations table, find the corresponding rows in wine table.
Step 2: find Name of the results of step 1 whose Price less than 50 and appellations's State equals Monterey and County equals Sonoma
Output: SELECT T2.Name FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Price < 50 AND T1.State = "Monterey" AND T1.County = "Sonoma"
find the FIRST_NAME, LAST_NAME, MANAGER_ID, DEPARTMENT_ID of employees table
Output: SELECT FIRST_NAME , LAST_NAME , MANAGER_ID , DEPARTMENT_ID FROM employees
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find friend of the results of step 1 whose job equals Alice and gender equals female
Output: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.job = "Alice" AND T1.gender = "female"
find the Unsure_rate, Date, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Unsure_rate , Date , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
find the date of weather table for which min_temperature_f equals or between 30.3 and 31
Output: SELECT date FROM weather WHERE min_temperature_f BETWEEN 31 AND 30.3
Step 1: find the number of rows of each value of Name 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 Name ORDER BY Count ( * ) Desc LIMIT 1
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 Artist equals 25 or Artist equals Gorgoroth
Output: SELECT Avg ( T2.Weeks_on_Top ) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = "Gorgoroth" OR T1.Artist = 25
find the number of different Currency_Code in Drama_Workshop_Groups table whose Marketing_Region_Code equals FR
Output: SELECT Count ( DISTINCT Currency_Code ) FROM Drama_Workshop_Groups WHERE Marketing_Region_Code = "FR"
find the bike_id of trip table for which duration greater than 60
Output: SELECT bike_id FROM trip WHERE duration > 60
find the Name of Physician table for which Position equals senior
Output: SELECT Name FROM Physician WHERE Position = "senior"
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 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
Step 1: find the City of branch table.
Step 2: For each row in membership_register_branch table, find corresponding rows in member table and in branch table.
Step 3: find City of the results of step 2 whose Level greater than 100.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.City FROM branch AS T1 EXCEPT SELECT T1.City FROM member AS T2 JOIN branch AS T1 JOIN membership_register_branch AS T3 ON T2.Member_ID = T3.Member_ID AND T3.Branch_ID = T1.Branch_ID WHERE T2.Level > 100
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose preferred_genre equals modern or languages equals english
Output: SELECT T2.song_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.preferred_genre = "modern" OR T2.languages = "english"
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_sea_level_pressure_inches greater than 50
Output: SELECT Avg ( T1.duration ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.max_sea_level_pressure_inches > 50
find the state_province_county of Addresses table for which town_city equals 6862 Kaitlyn Knolls
Output: SELECT state_province_county FROM Addresses WHERE town_city = "6862 Kaitlyn Knolls"
Step 1: find the number of rows in weather table whose min_humidity greater than 8.
Step 2: find the mean_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 mean_sea_level_pressure_inches FROM weather WHERE max_sea_level_pressure_inches < 50
find the FirstName, LastName of teachers table for which FirstName equals EVELINA
Output: SELECT FirstName , LastName FROM teachers WHERE FirstName = "EVELINA"
Step 1: find the Oppose_rate of candidate table ordered descending by Unsure_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Oppose_rate FROM candidate ORDER BY Unsure_rate Desc LIMIT 3
find the Candidate_ID of candidate table with smallest value of Consider_rate
Output: SELECT Candidate_ID FROM candidate ORDER BY Consider_rate Asc LIMIT 1
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_name of the results of step 1 whose price_in_pounds greater than 700
Output: SELECT T3.catalog_entry_name , T1.catalog_name 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 average Gold and the average Gold in club_rank table
Output: SELECT Avg ( Gold ) , Avg ( Gold ) FROM club_rank
Step 1: find the date, mean_temperature_f, max_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 , max_dew_point_f FROM weather ORDER BY max_wind_Speed_mph Desc LIMIT 3
find the state, enr of College table
Output: SELECT state , enr FROM College
Step 1: For each row in Fault_Log table, find corresponding rows in Assets table and in Engineer_Visits table.
Step 2: find asset_details of the results of step 1 ordered ascending by visit_start_datetime
Output: SELECT T1.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 trip table, find the corresponding rows in weather table.
Step 2: find the average duration in the results of step 1 whose min_humidity greater than 50
Output: SELECT Avg ( T1.duration ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.min_humidity > 50
find the Country, Number_cities of market table
Output: SELECT Country , Number_cities FROM market
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_registration 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_registration 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: 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 Treasurer_Vote equals 1035
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 T2.Treasurer_Vote = 1035
find the JOB_TITLE, MAX_SALARY of jobs table for which MAX_SALARY equals or between 12000 and 18000
Output: SELECT JOB_TITLE , MAX_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 18000 AND 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 rows, city, address's city_id of step 1 results with largest value in the results of step 2
Output: SELECT * , 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
Step 1: find the pName of Player table for which HS equals or between 1500 and 1200.
Step 2: find the pName of Player table for which HS greater than 500.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT pName FROM Player WHERE HS BETWEEN 1200 AND 1500 INTERSECT SELECT pName FROM Player WHERE HS > 500
find rows of Albums table whose Year equals 2010 and Year equals 0
Output: SELECT * FROM Albums WHERE Year = 0 AND Year = 2010
Step 1: find the Player's player_api_id of Player table for which height greater than 180.
Step 2: find the Player_Attributes's player_api_id of Player_Attributes table for which overall_rating less than 85.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT T1.player_api_id FROM Player AS T1 WHERE T1.height > 180 INTERSECT SELECT T2.player_api_id FROM Player_Attributes AS T2 WHERE T2.overall_rating < 85
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 less than 12000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 8000 OR T1.MIN_SALARY < 12000
Step 1: For each row in Physician table, find the corresponding rows in Undergoes table.
Step 2: find each value of Physician in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT T1.Name , Count ( * ) FROM Physician AS T1 JOIN Undergoes AS T2 ON T1.EmployeeID = T2.Physician GROUP BY T2.Physician
Step 1: find the student_id of Student_Course_Attendance table.
Step 2: find the Students's student_id of Students table whose Students's student_id not one of the results of step 1
Output: SELECT T1.student_id FROM Students AS T1 WHERE T1.student_id NOT IN ( SELECT T2.student_id FROM Student_Course_Attendance AS T2 )
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 mean_visibility_miles greater than 50
Output: SELECT Avg ( T1.duration ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.mean_visibility_miles > 50
Step 1: find the number of rows of each value of Season in match_season table.
Step 2: find College of match_season table ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT College FROM match_season GROUP BY Season ORDER BY Count ( * ) Desc LIMIT 3
Step 1: find cName of College table whose enr greater than 13000 and state equals AZ.
Step 2: find cName of College table whose enr greater than 15000 and state equals LA.
Step 3: show the rows that are in any of the results of step 1 or the results of step 2
Output: SELECT cName FROM College WHERE enr > 13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr > 15000 AND state = "LA"
find the average Famous_Release_date in artist table
Output: SELECT Avg ( Famous_Release_date ) FROM artist
find the rows of jobs table for which MIN_SALARY less than 2500
Output: SELECT * FROM jobs WHERE MIN_SALARY < 2500
Step 1: For each row in employees table, find the corresponding rows in job_history table.
Step 2: find employees's EMPLOYEE_ID, END_DATE of the results of step 1 whose SALARY equals 24000
Output: SELECT T1.EMPLOYEE_ID , T2.END_DATE FROM employees AS T1 JOIN job_history AS T2 ON T1.EMPLOYEE_ID = T2.EMPLOYEE_ID WHERE T1.SALARY = 24000
find the date of weather table for which min_sea_level_pressure_inches greater than 85
Output: SELECT date FROM weather WHERE min_sea_level_pressure_inches > 85
Step 1: For each row in station table, find the corresponding rows in trip table.
Step 2: find name, subscription_type, duration of the results of step 1
Output: SELECT T1.name , T2.subscription_type , T2.duration FROM station AS T1 JOIN trip AS T2
find the number of different payment_method_code in Invoices table
Output: SELECT Count ( DISTINCT payment_method_code ) FROM Invoices
find the protein_name, protein_name of protein table
Output: SELECT protein_name , protein_name FROM protein
find each value of bedType in Rooms table along with the average maxOccupancy of the corresponding rows to each value
Output: SELECT bedType , Avg ( maxOccupancy ) FROM Rooms GROUP BY bedType
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose preferred_genre equals modern or genre_is equals english
Output: SELECT T2.song_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.preferred_genre = "modern" OR T2.genre_is = "english"
Step 1: For each row in Student table, find the corresponding rows in Has_Allergy table.
Step 2: find without repetition Fname, city_code of the results of step 1 whose Sex equals Milk or Allergy equals Cat
Output: SELECT DISTINCT T2.Fname , T2.city_code FROM Has_Allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Sex = "Milk" OR T1.Allergy = "Cat"
Step 1: For each row in Addresses table, find the corresponding rows in Clients table.
Step 2: find the number of rows of each value of Clients's Address_ID in the results of step 1.
Step 3: find City_Town in the results of step 1 whose corresponding value in step 2 is greater than or equals 1.
Step 4: find the City_Town of Addresses table.
Step 5: show the rows that are in the results of step 3 but not in the results of step 4
Output: SELECT T1.City_Town FROM Addresses AS T1 JOIN Clients AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T2.Address_ID HAVING Count ( * ) > = 1 EXCEPT SELECT T1.City_Town FROM Addresses AS T1
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_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 max_temperature_f FROM weather WHERE max_sea_level_pressure_inches < 50
find rows of employees table whose SALARY greater than or equals 8000 and SALARY less than or equals 12000
Output: SELECT * FROM employees WHERE SALARY > = 12000 AND SALARY < = 8000
Step 1: find the School_ID of basketball_match table for which ACC_Road equals 8–0.
Step 2: find the number of rows in university table whose School_ID not one of the results of step 1
Output: SELECT Count ( * ) FROM university AS T1 WHERE T1.School_ID NOT IN ( SELECT T2.School_ID FROM basketball_match AS T2 WHERE T2.ACC_Road = "8–0" )
Step 1: For each row in Customers table, find the corresponding rows in Customer_Contact_Channels table.
Step 2: find customer_name of the results of step 1 with largest value of active_to_date
Output: SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Contact_Channels AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.active_to_date Desc LIMIT 1
find the asset_details of Assets table ordered ascending by asset_acquired_date
Output: SELECT asset_details FROM Assets ORDER BY asset_acquired_date 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 less than 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 the College of match_season table for which Player contains English
Output: SELECT College FROM match_season WHERE Player LIKE "English"
find without repetition the Season of match_season table
Output: SELECT DISTINCT Season FROM match_season
Step 1: For each row in departments table, find the corresponding rows in employees table.
Step 2: find rows of the results of step 1 whose SALARY greater than 8000 or DEPARTMENT_NAME equals null
Output: SELECT * FROM departments AS T1 JOIN employees AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.SALARY > 8000 OR T1.DEPARTMENT_NAME = "null"
find the product_name, typical_selling_price of Products table for which product_description equals yellow
Output: SELECT product_name , typical_selling_price FROM Products WHERE product_description = "yellow"
find the Employee_Name, Date_of_Birth of Employees table
Output: SELECT Employee_Name , Date_of_Birth FROM Employees
find start_date of trip table whose duration greater than 60 and start_station_name equals Howard at 2nd
Output: SELECT start_date FROM trip WHERE duration > 60 AND start_station_name = "Howard at 2nd"
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_euros 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_euros > 700
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_dew_point_f greater than 85
Output: SELECT T1.start_date FROM trip AS T1 JOIN weather AS T2 WHERE T2.min_dew_point_f > 85
find rows of employees table whose SALARY contains 8000 and SALARY less than or equals 12000
Output: SELECT * FROM employees WHERE SALARY LIKE 12000 AND SALARY < = 8000
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 Faculty's Building equals M and Faculty'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 T1.Building = "NEB" AND T1.Building = "M"
find the Candidate_ID, Consider_rate, Consider_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Candidate_ID , Consider_rate , Consider_rate FROM candidate ORDER BY Unsure_rate Asc
find JOB_TITLE, MIN_SALARY of jobs table whose MAX_SALARY greater than 12000 and MAX_SALARY less than or equals 18000
Output: SELECT JOB_TITLE , MIN_SALARY FROM jobs WHERE MAX_SALARY > 18000 AND MAX_SALARY < = 12000
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 ExaminationRoom 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.ExaminationRoom ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the average SALARY in employees table.
Step 2: For each row in jobs table, find the corresponding rows in employees table.
Step 3: find EMPLOYEE_ID in the results of step 2 whose MIN_SALARY greater than the results of step 1
Output: SELECT T2.EMPLOYEE_ID FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.MIN_SALARY > ( SELECT Avg ( T2.SALARY ) FROM employees AS T2 )
find the Name of Nurse table with largest value of Name
Output: SELECT Name FROM Nurse ORDER BY Name Desc LIMIT 1
find the date of weather table for which precipitation_inches greater than 85
Output: SELECT date FROM weather WHERE precipitation_inches > 85
find JOB_TITLE, MIN_SALARY of jobs table whose MIN_SALARY contains 12000 and MAX_SALARY greater than 18000
Output: SELECT JOB_TITLE , MIN_SALARY FROM jobs WHERE MIN_SALARY LIKE 12000 AND MAX_SALARY > 18000
Step 1: find the date, mean_temperature_f, min_temperature_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 , min_temperature_f FROM weather ORDER BY max_wind_Speed_mph Desc LIMIT 3
Step 1: For each row in course table, find the corresponding rows in prereq table.
Step 2: find the number of rows of each value of prereq's course_id in the results of step 1.
Step 3: find title in the results of step 1 whose corresponding value in step 2 is greater than 1
Output: SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING Count ( * ) > 1
find the SALARY, SALARY of employees table
Output: SELECT SALARY , SALARY FROM employees
Step 1: find the Name of Products table.
Step 2: find the Name of Manufacturers 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 Products AS T1 EXCEPT SELECT T2.Name FROM Manufacturers AS T2
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 mean_sea_level_pressure_inches greater than 50
Output: SELECT Avg ( T1.duration ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.mean_sea_level_pressure_inches > 50
find the SALARY, HIRE_DATE of employees table for which LAST_NAME equals or between 2007-11-05 and 2009-07-05
Output: SELECT SALARY , HIRE_DATE FROM employees WHERE LAST_NAME BETWEEN "2009-07-05" AND "2007-11-05"
Step 1: find the minimum department_id 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 ( department_id ) FROM Staff_Department_Assignments )
find the Season of match_season table for which Player contains English
Output: SELECT Season FROM match_season WHERE Player LIKE "English"
Step 1: find the number of rows of each value of LastName in teachers table.
Step 2: find FirstName, LastName of teachers table with largest value in the results of step 1
Output: SELECT FirstName , LastName FROM teachers GROUP BY LastName ORDER BY Count ( * ) Desc LIMIT 1
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_name of the results of step 1 whose price_in_dollars greater than 700
Output: SELECT T1.catalog_name , T1.catalog_name 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
find the number of rows in budget table whose total_budget_percent_budgeted greater than 3000 or Year less than 2001
Output: SELECT Count ( * ) FROM budget WHERE total_budget_percent_budgeted > 3000 OR Year < 2001
Step 1: find the Name of Products 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 Name FROM Products EXCEPT SELECT Name FROM Products
Step 1: For each row in Employees table, find the corresponding rows in Documents_to_be_Destroyed table.
Step 2: find the number of rows of each value of Employee_ID in the results of step 1.
Step 3: find Destroyed_by_Employee_ID in the results of step 1 whose corresponding value in step 2 is equals 1
Output: SELECT T2.Destroyed_by_Employee_ID FROM Employees AS T1 JOIN Documents_to_be_Destroyed AS T2 ON T1.Employee_ID = T2.Destroyed_by_Employee_ID GROUP BY T1.Employee_ID HAVING Count ( * ) = 1
find the minimum low_temperature and the maximum high_temperature in weekly_weather table
Output: SELECT Min ( low_temperature ) , Max ( high_temperature ) FROM weekly_weather
Step 1: find the number of rows in weather table whose min_humidity greater than 8.
Step 2: find the mean_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 mean_sea_level_pressure_inches FROM weather WHERE max_temperature_f < 50
Step 1: find the number of rows in weather table whose min_sea_level_pressure_inches greater than 8.
Step 2: find the max_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_sea_level_pressure_inches > 8 INTERSECT SELECT max_sea_level_pressure_inches FROM weather WHERE max_sea_level_pressure_inches < 50
find the name, id of station table
Output: SELECT name , id FROM station
find the product_name of Products table for which product_description equals yellow
Output: SELECT product_name FROM Products WHERE product_description = "yellow"
Step 1: find the date, mean_temperature_f, max_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 , max_dew_point_f FROM weather ORDER BY mean_wind_speed_mph Desc LIMIT 3
Step 1: For each row in Course_Authors_and_Tutors table, find the corresponding rows in Courses table.
Step 2: find address_line_1 of the results of step 1 whose course_name equals database or course_name equals database
Output: SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "database" OR T2.course_name = "database"
find the state, acc_type, no_of_loans of customer table for which cust_name equals 0
Output: SELECT state , acc_type , no_of_loans FROM customer WHERE cust_name = 0
Step 1: find the average budget in department table.
Step 2: For each row in department table, find the corresponding rows in student table.
Step 3: find department's dept_name, student's dept_name in the results of step 2 whose budget greater than the results of step 1
Output: SELECT T1.dept_name , T2.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name WHERE T1.budget > ( SELECT Avg ( T1.budget ) FROM department AS T1 )
Step 1: For each row in Maintenance_Contracts table, find the corresponding rows in Assets table.
Step 2: find asset_details of the results of step 1 ordered ascending by contract_start_date
Output: SELECT T2.asset_details FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id ORDER BY T1.contract_start_date Asc
find the title, credits, credits of course table ordered ascending by title
Output: SELECT title , credits , credits FROM course ORDER BY title Asc
find artist_name of song table whose languages equals modern or genre_is equals english
Output: SELECT artist_name FROM song WHERE languages = "modern" OR genre_is = "english"
Step 1: For each row in Asset_Parts table, find corresponding rows in Parts table and in Assets table.
Step 2: find chargeable_amount of the results of step 1 ordered ascending by other_asset_details
Output: SELECT T1.chargeable_amount FROM Parts AS T1 JOIN Assets AS T2 JOIN Asset_Parts AS T3 ON T1.part_id = T3.part_id AND T3.asset_id = T2.asset_id ORDER BY T2.other_asset_details Asc
Step 1: find the Team of player table ordered ascending by Age.
Step 2: only show the first 5 rows of the results
Output: SELECT Team FROM player ORDER BY Age Asc LIMIT 5
Step 1: find the average SALARY in employees table.
Step 2: For each row in jobs table, find the corresponding rows in employees table.
Step 3: find EMPLOYEE_ID in the results of step 2 whose MAX_SALARY greater than the results of step 1
Output: SELECT T2.EMPLOYEE_ID FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.MAX_SALARY > ( SELECT Avg ( T2.SALARY ) FROM employees AS T2 )
Step 1: For each row in university table, find the corresponding rows in basketball_match table.
Step 2: find Location, Location of the results of step 1 whose Team_Name equals Clemson
Output: SELECT T2.Location , T2.Location FROM basketball_match AS T1 JOIN university AS T2 ON T1.School_ID = T2.School_ID WHERE T1.Team_Name = "Clemson"
find the problem_id, log_entry_date of Problem_Log table for which problem_log_id equals 10
Output: SELECT problem_id , log_entry_date FROM Problem_Log WHERE problem_log_id = 10
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose preferred_genre equals modern or preferred_genre equals english
Output: SELECT T2.song_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.preferred_genre = "english" OR T1.preferred_genre = "modern"
Step 1: For each row in School table, find corresponding rows in budget table and in endowment table.
Step 2: find Invested, donator_name of the results of step 1 with largest value of amount
Output: SELECT T2.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 without repetition the country of circuits table ordered ascending by country
Output: SELECT DISTINCT country FROM circuits ORDER BY country Asc
find the mean_temperature_f of weather table for which zip_code equals 3
Output: SELECT mean_temperature_f FROM weather WHERE zip_code = 3
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_name of the results of step 1 whose price_in_euros greater than 700
Output: SELECT T3.catalog_entry_name , T1.catalog_name 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_euros > 700
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_name, customer_address in Customers table whose corresponding value in step 1 is equals New.
Step 3: find customer_name, customer_email 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_address FROM Customers GROUP BY customer_id HAVING Count ( * ) = "New" INTERSECT SELECT customer_name , customer_email FROM Customers GROUP BY customer_id HAVING Count ( * ) < "Pending"
Step 1: find the Winery of wine table for which Year less than 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 Winery FROM wine WHERE Year < "Brander" )
find zip_code of weather table whose min_dew_point_f greater than 80 or min_sea_level_pressure_inches greater than 29.97
Output: SELECT zip_code FROM weather WHERE min_dew_point_f > 80 OR min_sea_level_pressure_inches > 29.97
find EMPLOYEE_ID of employees table whose HIRE_DATE greater than 1987-09-07 and HIRE_DATE greater than 1987-06-17
Output: SELECT EMPLOYEE_ID FROM employees WHERE HIRE_DATE > "1987-06-17" AND HIRE_DATE > "1987-09-07"
find the FIRST_NAME, LAST_NAME, SALARY, DEPARTMENT_ID of employees table for which FIRST_NAME not equals M
Output: SELECT FIRST_NAME , LAST_NAME , SALARY , DEPARTMENT_ID FROM employees WHERE FIRST_NAME ! = "M"
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, name of step 1 results with largest value in the results of step 2
Output: SELECT T1.id , T1.name , T1.name 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 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 min_humidity greater than 57
Output: SELECT T2.zip_code FROM station AS T1 JOIN weather AS T2 WHERE T1.long > 80 OR T2.min_humidity > 57
Step 1: find the date, mean_temperature_f, min_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 , min_dew_point_f FROM weather ORDER BY max_wind_Speed_mph Desc LIMIT 3
Step 1: find the date, mean_temperature_f, max_temperature_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 , max_temperature_f FROM weather ORDER BY mean_wind_speed_mph Desc LIMIT 3
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 goalie.
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 the results of step 2 but not in 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 = "goalie" EXCEPT 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 Customer_Orders table, find the corresponding rows in Invoices table.
Step 2: find Order_Date of the results of step 1 whose Order_Quantity equals 1
Output: SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN Invoices AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1
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, airport_id of step 1 results with largest value in the results of step 2
Output: SELECT T1.id , T1.name , T2.airport_id 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 management table, find corresponding rows in department table and in head table.
Step 2: find Name, born_state, age of the results of step 1 ordered ascending by age
Output: SELECT T1.Name , T2.born_state , T2.age FROM department AS T1 JOIN head AS T2 JOIN management AS T3 ON T1.Department_ID = T3.department_ID AND T3.head_ID = T2.head_ID ORDER BY T2.age Asc
Step 1: For each row in Student_Course_Enrolment table, find corresponding rows in Students table and in Student_Tests_Taken table.
Step 2: find date_of_latest_logon of the results of step 1 whose test_result equals Fail
Output: SELECT T1.date_of_latest_logon FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id JOIN Student_Tests_Taken AS T3 ON T2.registration_id = T3.registration_id WHERE T3.test_result = "Fail"
find the average balance in SAVINGS table
Output: SELECT Avg ( balance ) FROM SAVINGS
find the Employee_ID of Employees table for which Role_Code equals HR
Output: SELECT Employee_ID FROM Employees WHERE Role_Code = "HR"
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 Department's Building equals M and Department'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 T2.Building = "NEB" AND T2.Building = "M"
find the state of College table for which enr less than 18000
Output: SELECT state FROM College WHERE enr < 18000
Step 1: find the number of rows of each value of Classroom 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 Classroom ORDER BY Count ( * ) Desc LIMIT 1
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, airport_id of step 1 results with largest value in the results of step 2
Output: SELECT T1.id , T1.name , T2.airport_id FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T1.id ORDER BY Count ( * ) Desc LIMIT 1
find zip_code of weather table whose precipitation_inches greater than 80 or mean_sea_level_pressure_inches greater than 30.02
Output: SELECT zip_code FROM weather WHERE precipitation_inches > 80 OR mean_sea_level_pressure_inches > 30.02
Step 1: find the average SAVINGS's balance in SAVINGS table.
Step 2: For each row in ACCOUNTS table, find the corresponding rows in CHECKING table.
Step 3: find name in the results of step 2 whose CHECKING's balance less than the results of step 1
Output: SELECT T1.name FROM ACCOUNTS AS T1 JOIN CHECKING AS T2 ON T1.custid = T2.custid WHERE T2.balance < ( SELECT Avg ( T3.balance ) FROM SAVINGS AS T3 )
Step 1: For each row in albums table, find the corresponding rows in tracks table.
Step 2: find the summation of milliseconds of each value of album_id in the results of step 1.
Step 3: find title in the results of step 1 whose corresponding value in step 2 is greater than 10
Output: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T2.album_id HAVING Sum ( T2.milliseconds ) > 10
Step 1: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table.
Step 2: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 3: find product_name, other_characteristic_details, characteristic_data_type of the results of step 2.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_data_type FROM Characteristics AS T1 EXCEPT 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
Step 1: For each row in artist table, find corresponding rows in files table and in song table.
Step 2: find artist's artist_name, files's artist_name of the results of step 1 whose song_name contains love
Output: SELECT T1.artist_name , T2.artist_name FROM artist AS T1 JOIN files AS T2 ON T1.artist_name = T2.artist_name JOIN song AS T3 ON T1.artist_name = T3.artist_name WHERE T3.song_name LIKE "love"
find the maximum Unsure_rate in candidate table
Output: SELECT Max ( Unsure_rate ) FROM candidate
Step 1: find the rows of jobs table for which MAX_SALARY greater than 40000.
Step 2: find the JOB_TITLE of jobs table for which MAX_SALARY greater than 12000.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT * FROM jobs WHERE MAX_SALARY > 40000 INTERSECT SELECT JOB_TITLE FROM jobs WHERE MAX_SALARY > 12000
find the MANAGER_ID of employees table
Output: SELECT MANAGER_ID FROM employees
Step 1: For each row in people table, find the corresponding rows in candidate table.
Step 2: find Name, Sex of the results of step 1 with largest value of Consider_rate
Output: SELECT T2.Name , T2.Sex FROM candidate AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Consider_rate Desc LIMIT 1
find rows of employees table whose SALARY greater than 8000 or SALARY contains 12000
Output: SELECT * FROM employees WHERE SALARY > 12000 OR SALARY LIKE 8000
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_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 min_temperature_f FROM weather WHERE max_temperature_f < 50