niryuu/sni-each-converted huggingface dataset:
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.
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" 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 Person table, find the corresponding rows in PersonFriend table.
Step 2: find the summation of age of each value of friend in the results of step 1.
Step 3: find Person's name in the results of step 1 whose corresponding value in step 2 is greater than or equals engineer
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name GROUP BY T2.friend HAVING Sum ( T1.age ) > = "engineer"
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition Fname, Age of the results of step 1 whose President_Vote equals 18
Output: SELECT DISTINCT T1.Fname , T1.Age FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.President_Vote = 18
Step 1: find the Player's player_api_id of Player table for which height greater than 180.
Step 2: For each row in Player table, find the corresponding rows in Player_Attributes table.
Step 3: find Player_Attributes's player_api_id of the results of step 2 whose height less than 85.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
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 JOIN Player AS T1 ON T2.player_fifa_api_id = T1.player_fifa_api_id WHERE T1.height < 85
Step 1: For each row in country table, find the corresponding rows in match_season table.
Step 2: find Season, Country_name, Country_name of the results of step 1
Output: SELECT T2.Season , T1.Country_name , T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country
find the average Silver and the maximum Gold in club_rank table
Output: SELECT Avg ( Silver ) , Max ( Gold ) FROM club_rank
Step 1: For each row in Customers table, find the corresponding rows in Customer_Orders table.
Step 2: find without repetition customer_name of the results of step 1 ordered ascending by Customer_Orders's customer_id
Output: SELECT DISTINCT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.customer_id Asc
find the product_name, typical_buying_price, typical_selling_price of Products table for which product_description equals yellow
Output: SELECT product_name , typical_buying_price , typical_selling_price FROM Products WHERE product_description = "yellow"
Step 1: find the name 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 name FROM enzyme )
find the Name, Name of driver table
Output: SELECT Name , Name FROM driver
find the Issue_Date of volume table
Output: SELECT Issue_Date FROM volume
Step 1: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table for which characteristic_name equals slow.
Step 2: For each row in Characteristics table, find the corresponding rows in Product_Characteristics table.
Step 3: find the number of rows of each value of Product_Characteristics's characteristic_id in the results of step 2.
Step 4: find characteristic_name, other_characteristic_details, characteristic_data_type in the results of step 3 whose corresponding value in step 3 is equals 1.
Step 5: show the rows that are in the results of step 1 but not in the results of step 4
Output: SELECT T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_data_type FROM Characteristics AS T1 WHERE T1.characteristic_name = "slow" EXCEPT SELECT T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_data_type FROM Characteristics AS T1 JOIN Product_Characteristics AS T2 ON T1.characteristic_id = T2.characteristic_id GROUP BY T2.characteristic_id HAVING Count ( * ) = 1
find Lieutenant_Governor of party table whose Comptroller equals Democratic and Comptroller equals Carl McCall
Output: SELECT Lieutenant_Governor FROM party WHERE Comptroller = "Carl McCall" AND Comptroller = "Democratic"
Step 1: For each row in Asset_Parts table, find corresponding rows in Parts table and in Assets table.
Step 2: find asset_details of the results of step 1 ordered ascending by chargeable_amount
Output: SELECT T2.asset_details FROM Parts AS T1 JOIN Assets AS T2 JOIN Asset_Parts AS T3 ON T1.part_id = T3.part_id AND T3.asset_id = T2.asset_id ORDER BY T1.chargeable_amount Asc
find the zip_code of weather table for which zip_code equals 3
Output: SELECT zip_code FROM weather WHERE zip_code = 3
Step 1: For each row in Customers table, find the corresponding rows in Customer_Events table.
Step 2: find Customers's customer_id, date_moved_in, date_moved_in of the results of step 1
Output: SELECT T1.customer_id , T2.date_moved_in , T2.date_moved_in FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id
Step 1: find the StuID of Student table.
Step 2: find the Sex of Student table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT StuID FROM Student EXCEPT SELECT Sex FROM Student
find the SALARY, HIRE_DATE of employees table for which HIRE_DATE equals or between 2007-11-05 and 2009-07-05
Output: SELECT SALARY , HIRE_DATE FROM employees WHERE HIRE_DATE BETWEEN "2009-07-05" AND "2007-11-05"
find the characteristic_name, other_characteristic_details, characteristic_type_code of Characteristics table
Output: SELECT characteristic_name , other_characteristic_details , characteristic_type_code FROM Characteristics
Step 1: find the number of rows of each value of Headquarters in company table.
Step 2: find Headquarters in company table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT Headquarters FROM company GROUP BY Headquarters HAVING Count ( * ) > = 2
find address_content of Addresses table whose address_content equals Gleasonmouth and state_province_county equals Arizona
Output: SELECT address_content FROM Addresses WHERE address_content = "Gleasonmouth" AND state_province_county = "Arizona"
Step 1: For each row in Ref_Document_Types table, find the corresponding rows in Documents table.
Step 2: find Document_Type_Name, Document_Type_Description, 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 , T1.Document_Type_Description , 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: 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, date_requested of the results of step 1
Output: SELECT T3.Customer_Event_ID , T3.date_moved_in , T2.date_requested 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
Step 1: find the number of rows of each value of student_id in Student_Course_Attendance table.
Step 2: find student_id in Student_Course_Attendance table whose corresponding value in step 1 is greater than or equals 1
Output: SELECT student_id FROM Student_Course_Attendance GROUP BY student_id HAVING Count ( * ) > = 1
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, address's city_id of step 1 results with largest value in the results of step 2
Output: SELECT T1.district , 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: For each row in School table, find the corresponding rows in budget table.
Step 2: find School_name, Budgeted, total_budget_percent_budgeted of the results of step 1 whose Year greater than or equals 2002
Output: SELECT T1.School_name , T2.Budgeted , T2.total_budget_percent_budgeted FROM School AS T1 JOIN budget AS T2 ON T1.School_id = T2.School_id WHERE T2.Year > = 2002
find the maximum start_date in trip table
Output: SELECT Max ( start_date ) FROM trip
find the number of rows in Dorm table whose gender equals M and gender equals X
Output: SELECT Count ( * ) FROM Dorm WHERE gender = "X" AND gender = "M"
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, height of the results of step 1 whose price_in_dollars greater than 700
Output: SELECT T1.catalog_name , T3.height FROM Catalogs AS T1 JOIN Catalog_Structure AS T2 ON T1.catalog_id = T2.catalog_id JOIN Catalog_Contents AS T3 ON T2.catalog_level_number = T3.catalog_level_number WHERE T3.price_in_dollars > 700
Step 1: find the average min_visibility_miles of each value of zip_code in weather table.
Step 2: find zip_code in weather table whose corresponding value in step 1 is less than 10
Output: SELECT zip_code FROM weather GROUP BY zip_code HAVING Avg ( min_visibility_miles ) < 10
find the Date, Consider_rate, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Date , Consider_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
Step 1: find the cName of Tryout table for which pPos equals mid.
Step 2: For each row in Player table, find the corresponding rows in Tryout table.
Step 3: find cName of the results of step 2 whose HS equals 1200.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.cName FROM Tryout AS T1 WHERE T1.pPos = "mid" INTERSECT SELECT T1.cName FROM Player AS T2 JOIN Tryout AS T1 ON T2.pID = T1.pID WHERE T2.HS = 1200
Step 1: find the rows of Activity table.
Step 2: find the Advisor of Student table.
Step 3: show the rows that are in any of the results of step 1 or the results of step 2
Output: SELECT * FROM Activity AS T1 UNION SELECT T2.Advisor FROM Student AS T2
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 Patient 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.Patient 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 lat greater than 80 or min_sea_level_pressure_inches greater than 29.97
Output: SELECT T2.zip_code FROM station AS T1 JOIN weather AS T2 WHERE T1.lat > 80 OR T2.min_sea_level_pressure_inches > 29.97
find each value of Team in machine table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , Team FROM machine GROUP BY Team
find without repetition the service_type_code of Services table for which service_details equals Denesik and Sons Party
Output: SELECT DISTINCT service_type_code FROM Services WHERE service_details = "Denesik and Sons Party"
Step 1: For each row in Ref_Document_Types table, find the corresponding rows in Documents table.
Step 2: find Document_Type_Name, Document_Name, Document_Type_Description of the results of step 1
Output: SELECT T1.Document_Type_Name , T2.Document_Name , T1.Document_Type_Description FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code
Step 1: For each row in routes table, find corresponding rows in airports table and in airlines table.
Step 2: find the number of rows of each value of airports's country in the results of step 1.
Step 3: find airlines's country of the results of step 1 with largest value in the results of step 2
Output: SELECT T3.country FROM routes AS T1 JOIN airports AS T2 ON T2.apid = T1.dst_apid JOIN airlines AS T3 ON T1.alid = T3.alid GROUP BY T2.country ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in School table, find the corresponding rows in budget table.
Step 2: find School_name, Budgeted, Invested of the results of step 1 whose Year greater than 2002
Output: SELECT T1.School_name , T2.Budgeted , T2.Invested FROM School AS T1 JOIN budget AS T2 ON T1.School_id = T2.School_id WHERE T2.Year > 2002
find the School_name of School table
Output: SELECT School_name FROM School
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find FIRST_NAME, LAST_NAME, SALARY, DEPARTMENT_ID of the results of step 1 whose JOB_TITLE not equals M
Output: SELECT T2.FIRST_NAME , T2.LAST_NAME , T2.SALARY , T2.DEPARTMENT_ID FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.JOB_TITLE ! = "M"
Step 1: find the channel's Owner of channel table for which channel's Name equals Morning.
Step 2: For each row in program table, find the corresponding rows in broadcast table.
Step 3: find program's Owner of the results of step 2 whose Time_of_day equals Night.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.Owner FROM channel AS T1 WHERE T1.Name = "Morning" INTERSECT SELECT T2.Owner FROM program AS T2 JOIN broadcast AS T3 ON T2.Program_ID = T3.Program_ID WHERE T3.Time_of_day = "Night"
Step 1: for each value of School_ID in school table, calculate number of rows.
Step 2: show each value of School_ID in school table along with the corresponding number of rows ordered descending by the results of step 1
Output: SELECT Boys_or_Girls , Count ( * ) FROM school GROUP BY School_ID ORDER BY Count ( * ) Desc
Step 1: for each value of document_name in Documents table, calculate number of rows.
Step 2: show each value of document_name in Documents table along with the corresponding average access_count with smallest value in the results of step 1
Output: SELECT access_count , Avg ( access_count ) FROM Documents GROUP BY document_name ORDER BY Count ( * ) Asc LIMIT 1
Step 1: For each row in culture_company table, find corresponding rows in book_club table and in movie table.
Step 2: find Title, Author_or_Editor of the results of step 1 whose book_club's Year greater than 1989
Output: SELECT T2.Title , T1.Author_or_Editor FROM book_club AS T1 JOIN movie AS T2 JOIN culture_company AS T3 ON T1.book_club_id = T3.book_club_id AND T3.movie_id = T2.movie_id WHERE T1.Year > 1989
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, 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 T1.id ORDER BY Count ( * ) Desc LIMIT 1
find the start_date of trip table for which duration greater than 60
Output: SELECT start_date FROM trip WHERE duration > 60
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 Famous_Release_date equals November 2007
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 = 25 OR T1.Famous_Release_date = "November 2007"
find the Music_Festival, Date_of_ceremony of music_festival table
Output: SELECT Music_Festival , Date_of_ceremony FROM music_festival
Step 1: find the date, mean_temperature_f, min_temperature_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 , min_temperature_f FROM weather ORDER BY max_gust_speed_mph Desc LIMIT 3
find the summation of Age in artist table
Output: SELECT Sum ( Age ) FROM artist
Step 1: find the date, mean_temperature_f, max_temperature_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_temperature_f FROM weather ORDER BY max_gust_speed_mph Desc LIMIT 3
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 genre_is 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 T2.genre_is = "modern" OR T1.preferred_genre = "english"
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_dollars 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_dollars > 700
find the catalog_name of Catalogs table for which date_of_publication greater than 8
Output: SELECT catalog_name FROM Catalogs WHERE date_of_publication > 8
Step 1: For each row in election table, find corresponding rows in county table and in party table.
Step 2: find Governor, County_name of the results of step 1
Output: SELECT T2.Governor , T1.County_name FROM county AS T1 JOIN party AS T2 JOIN election AS T3 ON T1.County_Id = T3.District AND T3.Party = T2.Party_ID
Step 1: find the Consider_rate of candidate table ordered descending by Unsure_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Consider_rate FROM candidate ORDER BY Unsure_rate Desc LIMIT 3
find the date of weather table for which mean_temperature_f greater than 85
Output: SELECT date FROM weather WHERE mean_temperature_f > 85
Step 1: For each row in Bookings table, find the corresponding rows in Payments table.
Step 2: find the number of rows of each value of Payments's booking_id in the results of step 1.
Step 3: find Bookings's booking_id, amount_paid of step 1 results with largest value in the results of step 2
Output: SELECT T1.booking_id , T2.amount_paid FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T2.booking_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in volume table, find the corresponding rows in music_festival table.
Step 2: find Music_Festival, Song of the results of step 1
Output: SELECT T2.Music_Festival , T1.Song FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume
Step 1: find the Musical_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 Musical_ID FROM actor )
find School_name of School table whose Enrollment less than 10 or Enrollment greater than 495
Output: SELECT School_name FROM School WHERE Enrollment < 495 OR Enrollment > 10
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 mean_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 mean_sea_level_pressure_inches > 50
find the average agility in Player_Attributes table
Output: SELECT Avg ( agility ) FROM Player_Attributes
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 min_sea_level_pressure_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.min_sea_level_pressure_inches > 29.97 OR T2.min_sea_level_pressure_inches > 80
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 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.Sex = "M" AND T2.Building = "NEB"
Step 1: For each row in Students table, find the corresponding rows in Student_Course_Enrolment table.
Step 2: find date_of_completion, date_of_completion of the results of step 1 whose family_name equals Zieme and personal_name equals Bernie
Output: SELECT T2.date_of_completion , T2.date_of_completion FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id WHERE T1.family_name = "Zieme" AND T1.personal_name = "Bernie"
Step 1: For each row in ACCOUNTS table, find the corresponding rows in SAVINGS table.
Step 2: find name, name of the results of step 1 with smallest value of balance
Output: SELECT T1.name , T1.name FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid ORDER BY T2.balance Asc LIMIT 1
find the asset_details of Assets table ordered ascending by asset_details
Output: SELECT asset_details FROM Assets ORDER BY asset_details Asc
Step 1: For each row in Things table, find the corresponding rows in Customer_Events table.
Step 2: find Customer_Event_ID, date_moved_in, organization_id of the results of step 1
Output: SELECT T2.Customer_Event_ID , T2.date_moved_in , T1.organization_id FROM Things AS T1 JOIN Customer_Events AS T2 ON T1.thing_id = T2.thing_id
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 PrepNurse 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.PrepNurse ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in hosting_city table, find corresponding rows in city table and in match table.
Step 2: find City of the results of step 1 whose Competition equals 1994 FIFA World Cup qualification and Year equals 2008
Output: SELECT T1.City FROM city AS T1 JOIN match AS T2 JOIN hosting_city AS T3 ON T1.City_ID = T3.Host_City AND T3.Match_ID = T2.Match_ID AND T1.City_ID = T3.Host_City WHERE T2.Competition = "1994 FIFA World Cup qualification" AND T3.Year = 2008
Step 1: For each row in trip table, find the corresponding rows in weather table.
Step 2: find the average start_date in the results of step 1 whose min_visibility_miles greater than 50
Output: SELECT Avg ( T1.start_date ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.min_visibility_miles > 50
find id of trip table whose duration greater than 60 and zip_code equals 94041
Output: SELECT id FROM trip WHERE duration > 60 AND zip_code = 94041
Step 1: For each row in Students table, find the corresponding rows in Student_Course_Enrolment table.
Step 2: find date_of_registration, date_of_completion of the results of step 1 whose family_name equals Zieme and personal_name equals Bernie
Output: SELECT T1.date_of_registration , T2.date_of_completion FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id WHERE T1.family_name = "Zieme" AND T1.personal_name = "Bernie"
Step 1: 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 Owner 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.Owner = "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 zip_code, min_dew_point_f of weather table for which min_visibility_miles less than 80
Output: SELECT zip_code , min_dew_point_f FROM weather WHERE min_visibility_miles < 80
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, Pilot of step 1 results with largest value in the results of step 2
Output: SELECT T1.id , T1.name , T2.Pilot 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
find the rows of employees table ordered descending by SALARY
Output: SELECT * FROM employees ORDER BY SALARY Desc
find the number of rows in enzyme table whose Porphyria equals No
Output: SELECT Count ( * ) FROM enzyme WHERE Porphyria = "No"
Step 1: For each row in Ref_Payment_Methods table, find the corresponding rows in Invoices table.
Step 2: find the number of different Invoices's payment_method_code in the results of step 1 whose payment_method_description equals credit
Output: SELECT Count ( DISTINCT T2.payment_method_code ) FROM Ref_Payment_Methods AS T1 JOIN Invoices AS T2 ON T1.payment_method_code = T2.payment_method_code WHERE T1.payment_method_description = "credit"
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find the summation of age of each value of friend in the results of step 1.
Step 3: find Person's name in the results of step 1 whose corresponding value in step 2 is greater than engineer
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name GROUP BY T2.friend HAVING Sum ( T1.age ) > "engineer"
find without repetition the positionText of constructorStandings table
Output: SELECT DISTINCT positionText FROM constructorStandings
find each value of city in Person table along with the average age of the corresponding rows to each value
Output: SELECT job , Avg ( age ) FROM Person GROUP BY city
find the average length_feet in bridge table whose location equals Guangxi , China
Output: SELECT Avg ( length_feet ) FROM bridge WHERE location = "Guangxi , China"
find the gender, artist_name of artist table with smallest value of gender
Output: SELECT gender , artist_name FROM artist ORDER BY gender Asc LIMIT 1
Step 1: For each row in city table, find the corresponding rows in address table.
Step 2: find the number of rows of each value of address's city_id in the results of step 1.
Step 3: find address, city, city's city_id of step 1 results with largest value in the results of step 2
Output: SELECT T1.address , 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
find the rows of employees table for which SALARY greater than 2500
Output: SELECT * FROM employees WHERE SALARY > 2500
Step 1: find the Name of Scientists table.
Step 2: find the Name of Scientists table whose Name not one of the results of step 1
Output: SELECT Name FROM Scientists WHERE Name NOT IN ( SELECT Name FROM Scientists )
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 min_humidity 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.min_humidity > 80 OR T2.min_sea_level_pressure_inches > 29.97
Step 1: find the StuID of Student table.
Step 2: find the StuID of Student table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Student
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_data_type 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_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 WHERE T2.product_name = "cumin" EXCEPT SELECT T1.characteristic_name , T1.other_characteristic_details , T1.characteristic_data_type FROM Characteristics AS T1
find JOB_TITLE, MAX_SALARY of jobs table whose MAX_SALARY contains 12000 and MAX_SALARY greater than 18000
Output: SELECT JOB_TITLE , MAX_SALARY FROM jobs WHERE MAX_SALARY LIKE 18000 AND MAX_SALARY > 12000
find the Music_Festival, Music_Festival of music_festival table
Output: SELECT Music_Festival , Music_Festival FROM music_festival
Step 1: find the date, mean_temperature_f, max_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 , max_temperature_f FROM weather ORDER BY max_wind_Speed_mph Desc LIMIT 3
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 precipitation_inches greater than 0
Output: SELECT T2.zip_code FROM station AS T1 JOIN weather AS T2 WHERE T1.long > 80 OR T2.precipitation_inches > 0
find Country of manager table whose Age greater than 50 or Age greater than 46
Output: SELECT Country FROM manager WHERE Age > 46 OR Age > 50
Step 1: find the Musical_ID 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 Musical_ID FROM actor )
find the Classroom of list table for which Grade equals 5 ordered ascending by Classroom
Output: SELECT Classroom FROM list WHERE Grade = 5 ORDER BY Classroom Asc
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find FIRST_NAME, LAST_NAME of the results of step 1 whose SALARY equals 6000 and MIN_SALARY less than 20000
Output: SELECT T2.FIRST_NAME , T2.LAST_NAME FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY = 6000 AND T1.MIN_SALARY < 20000
find the Season of match_season table
Output: SELECT Season FROM match_season
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 duration greater than 60 and events equals A
Output: SELECT T1.start_date FROM trip AS T1 JOIN weather AS T2 WHERE T1.duration > 60 AND T2.events = "A"
find song_name of song table whose genre_is equals modern or genre_is equals english
Output: SELECT song_name FROM song WHERE genre_is = "english" OR genre_is = "modern"
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 or equals 12000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 8000 OR T1.MIN_SALARY < = 12000
Step 1: find the number of rows of each value of Order_ID in Invoices table.
Step 2: find Order_ID of Invoices table with largest value in the results of step 1
Output: SELECT Order_ID FROM Invoices GROUP BY Order_ID ORDER BY Count ( * ) Desc LIMIT 1
find the Unsure_rate, Consider_rate, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Unsure_rate , Consider_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
Step 1: find the Classroom of list table for which Grade equals 2.
Step 2: find the Classroom of list table for which Grade equals 4.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Classroom FROM list WHERE Grade = 2 INTERSECT SELECT Classroom FROM list WHERE Grade = 4
Step 1: find the number of rows in weather table whose min_humidity greater than 8.
Step 2: find the min_humidity of weather table for which max_sea_level_pressure_inches less than 50.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Count ( * ) FROM weather WHERE min_humidity > 8 INTERSECT SELECT min_humidity FROM weather WHERE max_sea_level_pressure_inches < 50
find rows of jobs table whose MAX_SALARY greater than 2500 and MIN_SALARY less than 20000
Output: SELECT * FROM jobs WHERE MAX_SALARY > 2500 AND MIN_SALARY < 20000
Step 1: For each row in volume table, find the corresponding rows in music_festival table.
Step 2: find Issue_Date, Result of the results of step 1
Output: SELECT T1.Issue_Date , T2.Result FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume
find the average Famous_Release_date in artist table whose Artist greater than or equals 25
Output: SELECT Avg ( Famous_Release_date ) FROM artist WHERE Artist > = 25
find Venue of match table whose Competition equals Nanjing ( Jiangsu ) and Competition equals 1994 FIFA World Cup qualification
Output: SELECT Venue FROM match WHERE Competition = "1994 FIFA World Cup qualification" AND Competition = "Nanjing ( Jiangsu )"
Step 1: For each row in Student table, find the corresponding rows in Has_Allergy table.
Step 2: find the number of rows in the results of step 1 whose Sex equals F and Allergy equals Milk
Output: SELECT Count ( * ) FROM Has_Allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Sex = "F" AND T1.Allergy = "Milk"
find name, Client of Web_client_accelerator table whose Connection equals Broadband or Connection equals Broadband, Satellite, Wireless, Fiber, DSL
Output: SELECT name , Client FROM Web_client_accelerator WHERE Connection = "Broadband, Satellite, Wireless, Fiber, DSL" OR Connection = "Broadband"
Step 1: find the Player's 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.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
find the Location_Name of Ref_Locations table for which Location_Name equals Robin CV
Output: SELECT Location_Name FROM Ref_Locations WHERE Location_Name = "Robin CV"
Step 1: For each row in Institution table, find the corresponding rows in protein table.
Step 2: find common_name, Type of the results of step 1
Output: SELECT T2.common_name , T1.Type FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id
find the f_id, artist_name, artist_name of song table ordered ascending by rating
Output: SELECT f_id , artist_name , artist_name FROM song ORDER BY rating Asc
Step 1: For each row in trip table, find the corresponding rows in weather table.
Step 2: find each value of weather's zip_code in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , T1.zip_code FROM trip AS T1 JOIN weather AS T2 GROUP BY T2.zip_code
find FIRST_NAME, LAST_NAME, SALARY, DEPARTMENT_ID of employees table whose FIRST_NAME equals M or LAST_NAME equals King
Output: SELECT FIRST_NAME , LAST_NAME , SALARY , DEPARTMENT_ID FROM employees WHERE FIRST_NAME = "M" OR LAST_NAME = "King"
Step 1: For each row in genre table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose genre_is equals modern or g_name equals english
Output: SELECT T2.song_name FROM genre AS T1 JOIN song AS T2 ON T1.g_name = T2.genre_is WHERE T2.genre_is = "modern" OR T1.g_name = "english"
find rows of jobs table whose MIN_SALARY equals 12000 and MAX_SALARY greater than 40000
Output: SELECT * FROM jobs WHERE MIN_SALARY = 12000 AND MAX_SALARY > 40000
find the rows of employees table for which SALARY equals or between 2500 and 24000
Output: SELECT * FROM employees WHERE SALARY BETWEEN 24000 AND 2500
find the number of different Currency_Code in Drama_Workshop_Groups table whose Store_Name equals Amely Cafe
Output: SELECT Count ( DISTINCT Currency_Code ) FROM Drama_Workshop_Groups WHERE Store_Name = "Amely Cafe"
Step 1: For each row in Employee table, find the corresponding rows in Customer table.
Step 2: find the number of rows of each value of SupportRepId in the results of step 1.
Step 3: find Employee's LastName in the results of step 1 whose corresponding value in step 2 is greater than 20
Output: SELECT T2.LastName FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING Count ( * ) > 20
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, ICAO of step 1 results with largest value in the results of step 2
Output: SELECT T1.id , T1.name , T1.ICAO 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
find rows of jobs table whose MAX_SALARY greater than 2500 and MAX_SALARY less than 40000
Output: SELECT * FROM jobs WHERE MAX_SALARY > 40000 AND MAX_SALARY < 2500
find the student_id of Student_Course_Attendance table
Output: SELECT student_id FROM Student_Course_Attendance
Step 1: For each row in Problems table, find the corresponding rows in Problem_Log table.
Step 2: find problem_log_id, date_problem_reported of the results of step 1 whose problem_log_id equals 10
Output: SELECT T1.problem_log_id , T2.date_problem_reported FROM Problem_Log AS T1 JOIN Problems AS T2 ON T1.problem_id = T2.problem_id WHERE T1.problem_log_id = 10
find the date of weather table for which max_sea_level_pressure_inches greater than 85
Output: SELECT date FROM weather WHERE max_sea_level_pressure_inches > 85
Step 1: For each row in broadcast table, find corresponding rows in program table and in channel table.
Step 2: find channel's Name, Origin, program's Owner of the results of step 1
Output: SELECT T2.Name , T1.Origin , T1.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
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_dollars 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_dollars > 700
find the email, phone of customers table for which first_name equals Astrid
Output: SELECT email , phone FROM customers WHERE first_name = "Astrid"
find start_station_id of trip table whose duration greater than 60 and start_station_name equals Howard at 2nd
Output: SELECT start_station_id FROM trip WHERE duration > 60 AND start_station_name = "Howard at 2nd"
Step 1: find the characteristic_name, other_characteristic_details, characteristic_type_code of Characteristics table for which characteristic_name equals slow.
Step 2: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT characteristic_name , other_characteristic_details , characteristic_type_code FROM Characteristics WHERE characteristic_name = "slow" EXCEPT SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics
Step 1: find the characteristic_name, characteristic_name, other_characteristic_details of Characteristics table.
Step 2: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT characteristic_name , characteristic_name , other_characteristic_details FROM Characteristics EXCEPT SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics
find the maximum date in weather table
Output: SELECT Max ( date ) FROM weather
find the cust_name of customer table ordered ascending by credit_score
Output: SELECT cust_name FROM customer ORDER BY credit_score Asc
find JOB_TITLE, MAX_SALARY of jobs table whose MIN_SALARY contains 12000 and MAX_SALARY greater than 18000
Output: SELECT JOB_TITLE , MAX_SALARY FROM jobs WHERE MIN_SALARY LIKE 12000 AND MAX_SALARY > 18000
Step 1: For each row in School table, find the corresponding rows in budget table.
Step 2: find School_name, Budgeted, Budget_invested_percent of the results of step 1 whose Year greater than or equals 2002
Output: SELECT T1.School_name , T2.Budgeted , T2.Budget_invested_percent FROM School AS T1 JOIN budget AS T2 ON T1.School_id = T2.School_id WHERE T2.Year > = 2002
find the asset_details of Assets table ordered ascending by asset_disposed_date
Output: SELECT asset_details FROM Assets ORDER BY asset_disposed_date Asc
find Country of manager table whose Age greater than 50 or Manager_ID equals 46
Output: SELECT Country FROM manager WHERE Age > 50 OR Manager_ID = 46
find the zip_code, min_humidity of weather table for which min_visibility_miles greater than 80
Output: SELECT zip_code , min_humidity FROM weather WHERE min_visibility_miles > 80
find the name of bridge table ordered descending by length_feet
Output: SELECT name FROM bridge ORDER BY length_feet Desc
Step 1: find the number of rows of each value of Entrepreneur_ID in entrepreneur table.
Step 2: find Company of entrepreneur table with largest value in the results of step 1
Output: SELECT Company FROM entrepreneur GROUP BY Entrepreneur_ID ORDER BY Count ( * ) Desc LIMIT 1
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 min_temperature_f 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.min_temperature_f > 80 OR T2.min_sea_level_pressure_inches > 29.97
find Country of manager table whose Age greater than 50 or Age equals 46
Output: SELECT Country FROM manager WHERE Age > 46 OR Age = 50
Step 1: For each row in Course_Authors_and_Tutors table, find the corresponding rows in Courses table.
Step 2: find the number of rows of each value of Courses's author_id in the results of step 1.
Step 3: find personal_name, family_name, course_description of step 1 results with largest value in the results of step 2
Output: SELECT T1.personal_name , T1.family_name , T2.course_description FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY Count ( * ) Desc LIMIT 1
find the Unsure_rate, Oppose_rate, Oppose_rate of candidate table ordered ascending by Unsure_rate
Output: SELECT Unsure_rate , Oppose_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
Step 1: find the number of rows of each value of FirstName 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 FirstName ORDER BY Count ( * ) Desc LIMIT 1
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 greater 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: find the date, mean_temperature_f, mean_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 , mean_dew_point_f FROM weather ORDER BY max_gust_speed_mph Desc LIMIT 3
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 Employee's LastName not one of the results of step 1
Output: SELECT T1.LastName FROM Employee AS T1 WHERE T1.LastName NOT IN ( SELECT T2.SupportRepId FROM Customer AS T2 WHERE T2.LastName > 20 )
Step 1: For each row in game table, find the corresponding rows in injury_accident table.
Step 2: find Date, Player of the results of step 1 ordered descending by Competition
Output: SELECT T1.Date , T2.Player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id ORDER BY T1.Competition Desc
find the name of aircraft table for which name contains 99
Output: SELECT name FROM aircraft WHERE name LIKE 99
Step 1: For each row in Documents table, find the corresponding rows in Documents_with_Expenses table.
Step 2: find rows in the results of step 1 whose Document_Type_Code equals BK.
Step 3: find each value of Documents's Document_ID the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , T2.Budget_Type_Code FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.Document_ID = T2.Document_ID WHERE T1.Document_Type_Code = "BK" GROUP BY T1.Document_ID
find each value of dept_name in student table along with the summation of tot_cred of the corresponding rows to each value
Output: SELECT Sum ( tot_cred ) , dept_name FROM student GROUP BY dept_name
Step 1: find the number of rows of each value of product_id in Products table.
Step 2: find product_details of Products table with largest value in the results of step 1
Output: SELECT product_details FROM Products GROUP BY product_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the average min_sea_level_pressure_inches of each value of zip_code in weather table.
Step 2: find zip_code in weather table whose corresponding value in step 1 is greater than 10
Output: SELECT zip_code FROM weather GROUP BY zip_code HAVING Avg ( min_sea_level_pressure_inches ) > 10
Step 1: For each row in Has_amenity table, find corresponding rows in Dorm table and in Dorm_amenity table.
Step 2: find amenity_name of the results of step 1 whose student_capacity greater than 300
Output: SELECT T2.amenity_name 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 T1.student_capacity > 300
find the cust_name, credit_score of customer table for which no_of_loans greater than 5000
Output: SELECT cust_name , credit_score FROM customer WHERE no_of_loans > 5000
find the Employee_Name, Other_Details of Employees table
Output: SELECT Employee_Name , Other_Details FROM Employees
find the other_asset_details of Assets table ordered ascending by asset_details
Output: SELECT other_asset_details FROM Assets ORDER BY asset_details Asc
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find gender, song's artist_name of the results of step 1 with smallest value of gender
Output: SELECT T1.gender , T2.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T1.gender Asc LIMIT 1
find zip_code of weather table whose min_sea_level_pressure_inches greater than 80 or min_sea_level_pressure_inches greater than 29.97
Output: SELECT zip_code FROM weather WHERE min_sea_level_pressure_inches > 29.97 OR min_sea_level_pressure_inches > 80
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 Age 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.Age > = 25