niryuu/sni-each-converted huggingface dataset:
find the number of rows in Documents_Mailed table whose document_id equals 2
Output: SELECT Count ( * ) FROM Documents_Mailed WHERE document_id = 2
Step 1: For each row in accelerator_compatible_browser table, find corresponding rows in Web_client_accelerator table and in browser table.
Step 2: find browser's name of the results of step 1 whose Connection equals Fasterfox and Web_client_accelerator's name equals CACHEbox
Output: SELECT T2.name FROM Web_client_accelerator AS T1 JOIN browser AS T2 JOIN accelerator_compatible_browser AS T3 ON T1.id = T3.accelerator_id AND T3.browser_id = T2.id WHERE T1.Connection = "Fasterfox" AND T1.name = "CACHEbox"
find the number of rows in classroom table whose capacity greater than 50 and capacity less than Lamberton
Output: SELECT Count ( * ) FROM classroom WHERE capacity > "Lamberton" AND capacity < 50
find course_id of takes table whose year equals 2010 or year equals 2009
Output: SELECT course_id FROM takes WHERE year = 2009 OR year = 2010
find the Name of musical table for which Award equals Bob Fosse
Output: SELECT Name FROM musical WHERE Award = "Bob Fosse"
Step 1: find the number of rows of each value of id in Web_client_accelerator table.
Step 2: find id, name in Web_client_accelerator table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT id , name FROM Web_client_accelerator GROUP BY id HAVING Count ( * ) > = 2
Step 1: For each row in races table, find the corresponding rows in constructorStandings table.
Step 2: find constructorStandingsId, name of the results of step 1 with largest value of constructorId
Output: SELECT T2.constructorStandingsId , T1.name FROM races AS T1 JOIN constructorStandings AS T2 ON T1.raceId = T2.raceId ORDER BY T2.constructorId Desc LIMIT 1
Step 1: For each row in affected_region table, find corresponding rows in storm table and in region table.
Step 2: find Region_name of the results of step 1 whose Number_Deaths less than 10
Output: SELECT T2.Region_name FROM storm AS T1 JOIN region AS T2 JOIN affected_region AS T3 ON T1.Storm_ID = T3.Storm_ID AND T3.Region_id = T2.Region_id WHERE T1.Number_Deaths < 10
Step 1: find the number of rows of each value of id, name in enzyme table.
Step 2: find id, name of enzyme table with largest value in the results of step 1
Output: SELECT id , name FROM enzyme GROUP BY id , name ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in track table, find the corresponding rows in race table.
Step 2: find track's Name, Location of the results of step 1 whose Race_ID equals 1
Output: SELECT T2.Name , T2.Location FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID WHERE T1.Race_ID = 1
find the name of instructor table for which salary greater than 80000
Output: SELECT name FROM instructor WHERE salary > 80000
Step 1: find the number of rows of each value of year in section table.
Step 2: find year, year of section table with smallest value in the results of step 1
Output: SELECT year , year FROM section GROUP BY year ORDER BY Count ( * ) Asc LIMIT 1
find the Time of climber table for which Country equals Uganda
Output: SELECT Time FROM climber WHERE Country = "Uganda"
Step 1: For each row in medicine_enzyme_interaction table, find corresponding rows in medicine table and in enzyme table.
Step 2: find enzyme's name of the results of step 1 whose Porphyria equals Amisulpride and medicine's name equals inhibitor
Output: SELECT T2.name FROM medicine AS T1 JOIN enzyme AS T2 JOIN medicine_enzyme_interaction AS T3 ON T1.id = T3.medicine_id AND T3.enzyme_id = T2.id WHERE T2.Porphyria = "Amisulpride" AND T1.name = "inhibitor"
find the number of rows in Web_client_accelerator table whose Connection equals Broadband, Satellite, Wireless, Fiber, DSL
Output: SELECT Count ( * ) FROM Web_client_accelerator WHERE Connection = "Broadband, Satellite, Wireless, Fiber, DSL"
find without repetition the name of races table ordered ascending by name
Output: SELECT DISTINCT name FROM races ORDER BY name Asc
find Award of musical table whose Name equals Tony Award or Name equals Cleavant Derricks
Output: SELECT Award FROM musical WHERE Name = "Cleavant Derricks" OR Name = "Tony Award"
find the council_tax_id, council_tax_id of Parking_Fines table for which council_tax_id equals 9
Output: SELECT council_tax_id , council_tax_id FROM Parking_Fines WHERE council_tax_id = 9
Step 1: For each row in party_host table, find corresponding rows in party table and in host table.
Step 2: find Party_Theme of the results of step 1 whose Age greater than 50
Output: SELECT T1.Party_Theme FROM party AS T1 JOIN host AS T2 JOIN party_host AS T3 ON T1.Party_ID = T3.Party_ID AND T3.Host_ID = T2.Host_ID WHERE T2.Age > 50
find the Duration of actor table with smallest value of age
Output: SELECT Duration FROM actor ORDER BY age Asc LIMIT 1
find the number of rows in classroom table whose capacity greater than 50 and building equals Lamberton
Output: SELECT Count ( * ) FROM classroom WHERE capacity > 50 AND building = "Lamberton"
Step 1: For each row in musical table, find the corresponding rows in actor table.
Step 2: find Nominee of the results of step 1 whose Award equals Tony Award or actor's Name equals Cleavant Derricks
Output: SELECT T1.Nominee FROM musical AS T1 JOIN actor AS T2 WHERE T1.Award = "Tony Award" OR T2.Name = "Cleavant Derricks"
find the Membership_card, Age, Address of member table ordered ascending by Time_of_purchase
Output: SELECT Membership_card , Age , Address FROM member ORDER BY Time_of_purchase Asc
Step 1: For each row in races table, find corresponding rows in constructorStandings table and in constructorResults table.
Step 2: find without repetition positionText of the results of step 1 whose constructorResults's raceId equals 1
Output: SELECT DISTINCT T2.positionText FROM races AS T1 JOIN constructorStandings AS T2 ON T2.raceId = T1.raceId JOIN constructorResults AS T3 ON T1.raceId = T3.raceId WHERE T3.raceId = 1
find the customer_id, card_id, card_number, other_card_details of Customers_Cards table
Output: SELECT customer_id , card_id , card_number , other_card_details FROM Customers_Cards
Step 1: For each row in constructorStandings table, find the corresponding rows in results table.
Step 2: find constructorStandings's positionText of the results of step 1 whose fastestLap equals 1 and milliseconds greater than 1
Output: SELECT T1.positionText FROM constructorStandings AS T1 JOIN results AS T2 WHERE T2.fastestLap = 1 AND T2.milliseconds > 1
Step 1: find rows in university table whose Founded less than 1850.
Step 2: find each value of Affiliation the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , Affiliation FROM university WHERE Founded < 1850 GROUP BY Affiliation
Step 1: For each row in student table, find the corresponding rows in takes table.
Step 2: find name of the results of step 1 whose year equals 2003
Output: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.ID = T2.ID WHERE T2.year = 2003
find the number of rows in Customer_Master_Index table
Output: SELECT Count ( * ) FROM Customer_Master_Index
find the Date of perpetrator table with largest value of Killed
Output: SELECT Date FROM perpetrator ORDER BY Killed Desc LIMIT 1
Step 1: For each row in department table, find the corresponding rows in instructor table.
Step 2: find each value of instructor's dept_name in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , T1.budget FROM department AS T1 JOIN instructor AS T2 ON T1.dept_name = T2.dept_name GROUP BY T2.dept_name
find the name, salary of instructor table for which dept_name equals History
Output: SELECT name , salary FROM instructor WHERE dept_name = "History"
Step 1: For each row in people table, find the corresponding rows in perpetrator table.
Step 2: find Name of the results of step 1 ordered ascending by Killed
Output: SELECT T2.Name FROM perpetrator AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Killed Asc
find the rows, Player, Source of injury_accident table for which Injury not equals Knee problem
Output: SELECT * , Player , Source FROM injury_accident WHERE Injury ! = "Knee problem"
Step 1: For each row in Customer_Master_Index table, find the corresponding rows in CMI_Cross_References table.
Step 2: find without repetition source_system_code of the results of step 1 whose cmi_details equals Gottlieb ,  Becker and Wyman and cmi_details equals Schmitt-Lang
Output: SELECT DISTINCT T2.source_system_code FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = "Schmitt-Lang" AND T1.cmi_details = "Gottlieb ,  Becker and Wyman"
find School of university table whose Founded greater than 1850 or Founded less than Public
Output: SELECT School FROM university WHERE Founded > "Public" OR Founded < 1850
find the Company, Investor of entrepreneur table ordered descending by Money_Requested
Output: SELECT Company , Investor FROM entrepreneur ORDER BY Money_Requested Desc
Step 1: find the number of rows of each value of Name in people table.
Step 2: find Name in people table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT Name FROM people GROUP BY Name HAVING Count ( * ) > = 2
Step 1: For each row in medicine_enzyme_interaction table, find corresponding rows in medicine table and in enzyme table.
Step 2: find Trade_Name, medicine's name of the results of step 1 whose Porphyria equals inhibitor.
Step 3: find Trade_Name, medicine's name of the results of step 1 whose Porphyria equals activitor.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.Trade_Name , T1.name FROM medicine AS T1 JOIN enzyme AS T2 JOIN medicine_enzyme_interaction AS T3 ON T1.id = T3.medicine_id AND T3.enzyme_id = T2.id WHERE T2.Porphyria = "inhibitor" INTERSECT SELECT T1.Trade_Name , T1.name FROM medicine AS T1 JOIN enzyme AS T2 JOIN medicine_enzyme_interaction AS T3 ON T1.id = T3.medicine_id AND T3.enzyme_id = T2.id WHERE T2.Porphyria = "activitor"
Step 1: For each row in medicine_enzyme_interaction table, find corresponding rows in medicine table and in enzyme table.
Step 2: find enzyme's name, Porphyria of the results of step 1 whose FDA_approved equals Yes
Output: SELECT T2.name , T2.Porphyria FROM medicine AS T1 JOIN enzyme AS T2 JOIN medicine_enzyme_interaction AS T3 ON T1.id = T3.medicine_id AND T3.enzyme_id = T2.id WHERE T1.FDA_approved = "Yes"
find the number of rows in medicine table
Output: SELECT Count ( * ) FROM medicine
find the City of Customer table for which PostalCode equals 70174
Output: SELECT City FROM Customer WHERE PostalCode = 70174
Step 1: For each row in department table, find corresponding rows in instructor table and in student table.
Step 2: find instructor's name of the results of step 1 ordered ascending by tot_cred
Output: SELECT T2.name FROM department AS T1 JOIN instructor AS T2 ON T2.dept_name = T1.dept_name JOIN student AS T3 ON T1.dept_name = T3.dept_name ORDER BY T3.tot_cred Asc
Step 1: For each row in circuits table, find the corresponding rows in races table.
Step 2: find the number of rows of each value of country in the results of step 1.
Step 3: find races's url, country of step 1 results with largest value in the results of step 2
Output: SELECT T2.url , T1.country FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId GROUP BY T1.country ORDER BY Count ( * ) Desc LIMIT 1
find the name of instructor table for which salary equals 80000
Output: SELECT name FROM instructor WHERE salary = 80000
Step 1: find the number of rows of each value of Name in actor table.
Step 2: find Name in actor table whose corresponding value in step 1 is greater than or equals 3
Output: SELECT Name FROM actor GROUP BY Name HAVING Count ( * ) > = 3
find the student_id of Student_Course_Attendance table ordered ascending by date_of_attendance
Output: SELECT student_id FROM Student_Course_Attendance ORDER BY date_of_attendance Asc
find the name, name of races table with smallest value of url
Output: SELECT name , name FROM races ORDER BY url Asc LIMIT 1
Step 1: find the maximum salary in instructor table.
Step 2: find without repetition the name of instructor table whose salary less than the results of step 1
Output: SELECT DISTINCT name FROM instructor WHERE salary < ( SELECT Max ( salary ) FROM instructor )
Step 1: For each row in university table, find the corresponding rows in basketball_match table.
Step 2: find Team_Name, School of the results of step 1 with smallest value of Founded
Output: SELECT T1.Team_Name , T2.School FROM basketball_match AS T1 JOIN university AS T2 ON T1.School_ID = T2.School_ID ORDER BY T2.Founded Asc LIMIT 1
find the account_id, customer_id, account_name, other_account_details of Accounts table
Output: SELECT account_id , customer_id , account_name , other_account_details FROM Accounts
find the Founded of university table with largest value of Founded
Output: SELECT Founded FROM university ORDER BY Founded Desc LIMIT 1
find the Date of game table ordered descending by Date
Output: SELECT Date FROM game ORDER BY Date Desc
Step 1: find the rows in enzyme table whose Chromosome contains activitor.
Step 2: find each value of id, name in the results of step 1 ordered descending by number of rows that correspond of each value.
Step 3: only show the first row of the results
Output: SELECT id , name FROM enzyme WHERE Chromosome LIKE "activitor" GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
find the first_name, last_name, gender_mf of Customers table ordered ascending by last_name
Output: SELECT first_name , last_name , gender_mf FROM Customers ORDER BY last_name Asc
Step 1: find the Connection of Web_client_accelerator table for which Connection equals Broadband, Satellite, Wireless, Fiber, DSL.
Step 2: find the number of rows in Web_client_accelerator table whose id not one of the results of step 1
Output: SELECT Count ( * ) FROM Web_client_accelerator WHERE id NOT IN ( SELECT Connection FROM Web_client_accelerator WHERE Connection = "Broadband, Satellite, Wireless, Fiber, DSL" )
Step 1: For each row in drivers table, find the corresponding rows in lapTimes table.
Step 2: find driverRef, driverRef of the results of step 1 whose milliseconds less than 93000
Output: SELECT T1.driverRef , T1.driverRef FROM drivers AS T1 JOIN lapTimes AS T2 ON T1.driverId = T2.driverId WHERE T2.milliseconds < 93000
find the country of circuits table for which circuitRef greater than Spain
Output: SELECT country FROM circuits WHERE circuitRef > "Spain"
Step 1: For each row in Documents table, find the corresponding rows in Documents_Mailed table.
Step 2: find receipt_date of the results of step 1 whose Documents_Mailed's document_id equals 7
Output: SELECT T1.receipt_date FROM Documents AS T1 JOIN Documents_Mailed AS T2 ON T1.document_id = T2.document_id WHERE T2.document_id = 7
find the Company, Company of entrepreneur table ordered descending by Money_Requested
Output: SELECT Company , Company FROM entrepreneur ORDER BY Money_Requested Desc
Step 1: find the number of rows of each value of dept_name in course table.
Step 2: find dept_name of course table with largest value in the results of step 1
Output: SELECT dept_name FROM course GROUP BY dept_name ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in affected_region table, find corresponding rows in storm table and in region table.
Step 2: find Name of the results of step 1 whose Region_code equals Afghanistan.
Step 3: find Name of the results of step 1 whose Region_code equals Albania.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.Name FROM storm AS T1 JOIN region AS T2 JOIN affected_region AS T3 ON T1.Storm_ID = T3.Storm_ID AND T3.Region_id = T2.Region_id WHERE T2.Region_code = "Afghanistan" INTERSECT SELECT T1.Name FROM storm AS T1 JOIN region AS T2 JOIN affected_region AS T3 ON T1.Storm_ID = T3.Storm_ID AND T3.Region_id = T2.Region_id WHERE T2.Region_code = "Albania"
find the average amount_paid in Payments table
Output: SELECT Avg ( amount_paid ) FROM Payments
find the Venue of debate table ordered ascending by Venue
Output: SELECT Venue FROM debate ORDER BY Venue Asc
Step 1: For each row in player_coach table, find corresponding rows in player table and in coach table.
Step 2: find Player_name of the results of step 1 whose coach's Rank equals 1 and player's Rank equals 2nd
Output: SELECT T1.Player_name FROM player AS T1 JOIN coach AS T2 JOIN player_coach AS T3 ON T1.Player_ID = T3.Player_ID AND T3.Coach_ID = T2.Coach_ID WHERE T2.Rank = 1 AND T1.Rank = "2nd"
find the Address of Customer table for which Country equals Germany
Output: SELECT Address FROM Customer WHERE Country = "Germany"
find the Name, Carrier of phone table
Output: SELECT Name , Carrier FROM phone
Step 1: For each row in debate_people table, find corresponding rows in people table and in debate table.
Step 2: find Name of the results of step 1 whose Num_of_Audience greater than 342.
Step 3: find Name of the results of step 1 whose Num_of_Audience greater than 200.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.Name FROM people AS T1 JOIN debate AS T2 JOIN debate_people AS T3 ON T1.People_ID = T3.Affirmative AND T3.Debate_ID = T2.Debate_ID WHERE T2.Num_of_Audience > 342 INTERSECT SELECT T1.Name FROM people AS T1 JOIN debate AS T2 JOIN debate_people AS T3 ON T1.People_ID = T3.Affirmative AND T3.Debate_ID = T2.Debate_ID WHERE T2.Num_of_Audience > 200
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 less than or equals 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: find the number of rows of each value of Region_name in region table.
Step 2: find Region_name in region table whose corresponding value in step 1 is greater than Denmark
Output: SELECT Region_name FROM region GROUP BY Region_name HAVING Count ( * ) > "Denmark"
find rows of Discount_Coupons table whose coupon_amount greater than 500 or coupon_amount less than 500
Output: SELECT * FROM Discount_Coupons WHERE coupon_amount > 500 OR coupon_amount < 500
Step 1: find the number of rows of each value of year in takes table.
Step 2: find year, year of takes table with largest value in the results of step 1
Output: SELECT year , year FROM takes GROUP BY year ORDER BY Count ( * ) Desc LIMIT 1
find the average Killed in perpetrator table
Output: SELECT Avg ( Killed ) FROM perpetrator
find the Name, Duration of actor table
Output: SELECT Name , Duration FROM actor
Step 1: For each row in university table, find the corresponding rows in basketball_match table.
Step 2: find Location, Enrollment of the results of step 1 whose Team_Name equals Clemson
Output: SELECT T2.Location , T2.Enrollment FROM basketball_match AS T1 JOIN university AS T2 ON T1.School_ID = T2.School_ID WHERE T1.Team_Name = "Clemson"
Step 1: For each row in stadium table, find the corresponding rows in game table.
Step 2: find Date, name of the results of step 1 ordered descending by Competition
Output: SELECT T2.Date , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id ORDER BY T2.Competition Desc
Step 1: For each row in Orders table, find corresponding rows in Order_Items table and in Shipments table.
Step 2: find Order_Items's order_id of the results of step 1 with largest value of shipment_date
Output: SELECT T2.order_id FROM Orders AS T1 JOIN Order_Items AS T2 ON T2.order_id = T1.order_id JOIN Shipments AS T3 ON T1.order_id = T3.order_id ORDER BY T3.shipment_date Desc LIMIT 1
Step 1: find the number of rows of each value of city in airports table.
Step 2: find city of airports table ordered ascending by the results of step 1
Output: SELECT city FROM airports GROUP BY city ORDER BY Count ( * ) Asc
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find the number of rows of each value of song's country in the results of step 1.
Step 3: find artist's country of step 1 results with smallest value in the results of step 2
Output: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.country ORDER BY Count ( * ) Asc LIMIT 1
Step 1: For each row in Shipments table, find corresponding rows in Invoices table and in Orders table.
Step 2: find customer_id of the results of step 1 with largest value of invoice_date
Output: SELECT T2.customer_id FROM Invoices AS T1 JOIN Orders AS T2 JOIN Shipments AS T3 ON T1.invoice_number = T3.invoice_number AND T3.order_id = T2.order_id ORDER BY T1.invoice_date Desc LIMIT 1
Step 1: find the phone_number of Customers table.
Step 2: find the phone_number of Staff table.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT T1.phone_number FROM Customers AS T1 INTERSECT SELECT T2.phone_number FROM Staff AS T2
Step 1: For each row in Parties table, find the corresponding rows in Party_Forms table.
Step 2: find the number of rows of each value of Party_Forms's party_id in the results of step 1.
Step 3: find party_email of step 1 results with largest value in the results of step 2
Output: SELECT T1.party_email FROM Parties AS T1 JOIN Party_Forms AS T2 ON T1.party_id = T2.party_id GROUP BY T2.party_id ORDER BY Count ( * ) Desc LIMIT 1
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 number of rows with largest value in the results of step 1
Output: SELECT document_name , Count ( * ) FROM Documents GROUP BY document_name ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in bank table, find corresponding rows in customer table and in loan table.
Step 2: find cust_name of the results of step 1 with largest value of amount
Output: SELECT T2.cust_name FROM bank AS T1 JOIN customer AS T2 ON T2.branch_ID = T1.branch_ID JOIN loan AS T3 ON T1.branch_ID = T3.branch_ID ORDER BY T3.amount Desc LIMIT 1
Step 1: For each row in Orders table, find the corresponding rows in Shipments table.
Step 2: find Orders's order_id of the results of step 1 ordered ascending by shipment_date
Output: SELECT T1.order_id FROM Orders AS T1 JOIN Shipments AS T2 ON T1.order_id = T2.order_id ORDER BY T2.shipment_date Asc
find the number of rows in teachers table whose FirstName equals TARRING
Output: SELECT Count ( * ) FROM teachers WHERE FirstName = "TARRING"
Step 1: For each row in bank table, find the corresponding rows in loan table.
Step 2: find the summation of amount in the results of step 1 whose city equals New York
Output: SELECT Sum ( T2.amount ) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID WHERE T1.city = "New York"
find the Advisor of Student table for which Major equals Spring
Output: SELECT Advisor FROM Student WHERE Major = "Spring"
find the bname of bank table
Output: SELECT bname FROM bank
find without repetition the Major of Student table
Output: SELECT DISTINCT Major FROM Student
find the cust_name, credit_score of customer table
Output: SELECT cust_name , credit_score FROM customer
find the number of rows in bank table whose city equals New York City
Output: SELECT Count ( * ) FROM bank WHERE city = "New York City"
Step 1: find the FacID of Faculty 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 T1.FacID FROM Faculty AS T1 UNION SELECT T2.Advisor FROM Student AS T2
Step 1: For each row in artist table, find the corresponding rows in files table.
Step 2: find artist's artist_name, gender of the results of step 1 whose formats equals Mar
Output: SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN files AS T2 ON T1.artist_name = T2.artist_name WHERE T2.formats = "Mar"
Step 1: find the number of rows of each value of user_id in Users table.
Step 2: find user_name, user_name of Users table with largest value in the results of step 1
Output: SELECT user_name , user_name FROM Users GROUP BY user_id ORDER BY Count ( * ) Desc LIMIT 1
find each value of Address in Locations table along with the number of the corresponding rows to each value
Output: SELECT Address , Count ( * ) FROM Locations GROUP BY Address
find the Address of Locations table for which Location_Name contains film
Output: SELECT Address FROM Locations WHERE Location_Name LIKE "film"
find the number of rows in routes table
Output: SELECT Count ( * ) FROM routes
find the number of rows in festival_detail table
Output: SELECT Count ( * ) FROM festival_detail
find the number of rows in Activity table
Output: SELECT Count ( * ) FROM Activity
Step 1: For each row in airports table, find the corresponding rows in routes table.
Step 2: only keep the results of step 1 whose country equals China.
Step 3: find the number of rows of each value of src_apid in the results of step 2.
Step 4: find country of the results of step 2 with largest value in the results of step 3
Output: SELECT T2.country FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = "China" GROUP BY T1.src_apid ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Tourist_Attractions table, find corresponding rows in Locations table and in Street_Markets table.
Step 2: find Market_Details of the results of step 1 whose Address equals walk or Address equals bus
Output: SELECT T3.Market_Details FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID JOIN Street_Markets AS T3 ON T2.Tourist_Attraction_ID = T3.Market_ID WHERE T1.Address = "bus" OR T1.Address = "walk"
Step 1: for each value of artist_name in song table, calculate number of rows.
Step 2: show each value of artist_name in song table along with the corresponding number of rows ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT artist_name , Count ( * ) FROM song GROUP BY artist_name ORDER BY Count ( * ) Desc LIMIT 3
Step 1: find the number of rows of each value of document_type_code in Documents table.
Step 2: find document_type_code of Documents table ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY Count ( * ) Desc LIMIT 3
find the number of rows in list table whose FirstName equals MADLOCK
Output: SELECT Count ( * ) FROM list WHERE FirstName = "MADLOCK"
Step 1: For each row in Ref_Hotel_Star_Ratings table, find the corresponding rows in Hotels table.
Step 2: find star_rating_description, star_rating_description of the results of step 1 ordered ascending by price_range.
Step 3: only show the first 3 rows of the results
Output: SELECT T1.star_rating_description , T1.star_rating_description FROM Ref_Hotel_Star_Ratings AS T1 JOIN Hotels AS T2 ON T1.star_rating_code = T2.star_rating_code ORDER BY T2.price_range Asc LIMIT 3
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 languages 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.languages = "modern" OR T1.g_name = "english"
Step 1: For each row in Students table, find the corresponding rows in Student_Course_Enrolment table.
Step 2: find date_of_latest_logon, date_of_enrolment of the results of step 1 whose family_name equals Zieme and personal_name equals Bernie
Output: SELECT T1.date_of_latest_logon , T2.date_of_enrolment 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 files table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose duration equals english or duration equals 4:%
Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration = "4:%" OR T1.duration = "english"
find the Age, Age of Student table for which Major equals 600
Output: SELECT Age , Age FROM Student WHERE Major = 600
find the average Age in Student table whose Sex equals F and Sex equals Spring
Output: SELECT Avg ( Age ) FROM Student WHERE Sex = "Spring" AND Sex = "F"
Step 1: find rows in Faculty table whose Sex equals M.
Step 2: find each value of Rank the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , Rank FROM Faculty WHERE Sex = "M" GROUP BY Rank
find the f_id of song table for which rating less than 8
Output: SELECT f_id FROM song WHERE rating < 8
find the artist_name of files table ordered ascending by artist_name
Output: SELECT artist_name FROM files ORDER BY artist_name Asc
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find f_id, preferred_genre, song's artist_name of the results of step 1 ordered ascending by rating
Output: SELECT T2.f_id , T1.preferred_genre , T2.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating Asc
Step 1: find the Fname of Faculty table.
Step 2: find the Fname of Faculty table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Fname FROM Faculty EXCEPT SELECT Fname FROM Faculty
Step 1: For each row in station table, find the corresponding rows in route table.
Step 2: find each value of station_id in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT T1.network_name , Count ( * ) FROM station AS T1 JOIN route AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id
find the bname of bank table for which city equals New York
Output: SELECT bname FROM bank WHERE city = "New York"
find the number of rows in Course_Authors_and_Tutors table
Output: SELECT Count ( * ) FROM Course_Authors_and_Tutors
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 President_Vote equals 1004
Output: SELECT DISTINCT T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.President_Vote = 1004
Step 1: For each row in airports table, find the corresponding rows in routes table.
Step 2: find the number of rows of each value of alid in the results of step 1.
Step 3: find name of step 1 results ordered descending by the results of step 2.
Step 4: only show the first 10 rows of the results
Output: SELECT T2.name FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid GROUP BY T1.alid ORDER BY Count ( * ) Desc LIMIT 10
find the LName of Student table for which Major greater than 50
Output: SELECT LName FROM Student WHERE Major > 50
Step 1: For each row in bank table, find the corresponding rows in loan table.
Step 2: find each value of bank's branch_ID in the results of step 1 along with the summation of amount of the corresponding rows to each value
Output: SELECT Sum ( T2.amount ) , T2.branch_ID FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.branch_ID
Step 1: For each row in Staff table, find the corresponding rows in Complaints table.
Step 2: find the number of rows of each value of Complaints's staff_id in the results of step 1.
Step 3: find last_name of step 1 results with smallest value in the results of step 2
Output: SELECT T1.last_name FROM Staff AS T1 JOIN Complaints AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id ORDER BY Count ( * ) Asc LIMIT 1
Step 1: For each row in Course_Authors_and_Tutors table, find the corresponding rows in Courses table.
Step 2: find login_name, family_name, course_description of the results of step 1
Output: SELECT T1.login_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
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find artist's country of the results of step 1 whose gender equals Female and song_name equals bangla
Output: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.song_name = "bangla"
Step 1: For each row in list table, find the corresponding rows in teachers table.
Step 2: find FirstName, LastName of the results of step 1 whose FirstName not equals OTHA
Output: SELECT T2.FirstName , T2.LastName FROM list AS T1 JOIN teachers AS T2 WHERE T1.FirstName ! = "OTHA"
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: only keep the results of step 1 whose languages equals bangla.
Step 3: find the number of rows of each value of files's artist_name in the results of step 2.
Step 4: find song's artist_name of the results of step 2 ordered descending by the results of step 3.
Step 5: only show the first 3 rows of the results
Output: SELECT T2.artist_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.languages = "bangla" GROUP BY T1.artist_name ORDER BY Count ( * ) Desc LIMIT 3
find without repetition the Fname, LName of Student table for which Advisor equals 18
Output: SELECT DISTINCT Fname , LName FROM Student WHERE Advisor = 18
Step 1: For each row in Locations table, find the corresponding rows in Tourist_Attractions table.
Step 2: find the number of rows of each value of Tourist_Attractions's Location_ID in the results of step 1.
Step 3: find Location_Name of step 1 results with largest value in the results of step 2
Output: SELECT T1.Location_Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID GROUP BY T2.Location_ID ORDER BY Count ( * ) Desc LIMIT 1
find the invoice_date of Invoices table for which invoice_number equals 10
Output: SELECT invoice_date FROM Invoices WHERE invoice_number = 10
find the Fname, LName of Student table for which Advisor equals Michael
Output: SELECT Fname , LName FROM Student WHERE Advisor = "Michael"
Step 1: For each row in station table, find the corresponding rows in weekly_weather table.
Step 2: find id, local_authority of the results of step 1 whose precipitation greater than 50
Output: SELECT T1.id , T1.local_authority FROM station AS T1 JOIN weekly_weather AS T2 ON T1.id = T2.station_id WHERE T2.precipitation > 50
Step 1: For each row in list table, find the corresponding rows in teachers table.
Step 2: find the number of rows in the results of step 1 whose FirstName equals CHRISSY and FirstName equals NABOZNY
Output: SELECT Count ( * ) FROM list AS T1 JOIN teachers AS T2 WHERE T1.FirstName = "CHRISSY" AND T2.FirstName = "NABOZNY"
Step 1: for each value of product_name in Products table, calculate number of rows.
Step 2: show each value of product_name in Products table along with the corresponding number of rows ordered ascending by the results of step 1
Output: SELECT product_name , Count ( * ) FROM Products GROUP BY product_name ORDER BY Count ( * ) Asc
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose duration equals english or duration less than 4:%
Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration = "4:%" OR T1.duration < "english"
Step 1: find the address_line_2, 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_2 , 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"
Step 1: find the customer_id of Complaints table.
Step 2: find the phone_number of Customers table whose Customers's customer_id one of the results of step 1
Output: SELECT T1.phone_number FROM Customers AS T1 WHERE T1.customer_id IN ( SELECT T2.customer_id FROM Complaints AS T2 )
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find song's f_id of the results of step 1 whose formats equals mp4 or rating greater than 720
Output: SELECT T2.f_id FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp4" OR T2.rating > 720
find the number of rows in list table whose FirstName equals KAWA
Output: SELECT Count ( * ) FROM list WHERE FirstName = "KAWA"
find the number of rows in airports table whose country equals Canada
Output: SELECT Count ( * ) FROM airports WHERE country = "Canada"
Step 1: find the number of rows of each value of document_type_code in Documents table.
Step 2: find document_type_code in Documents table whose corresponding value in step 1 is greater than 10000
Output: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING Count ( * ) > 10000
find the average Age in Student table whose city_code equals NYC and Major equals 600
Output: SELECT Avg ( Age ) FROM Student WHERE city_code = "NYC" AND Major = 600
Step 1: For each row in Customers table, find the corresponding rows in Customer_Orders table.
Step 2: find customer_name, customer_phone of the results of step 1 whose order_status_code equals No Response
Output: SELECT T1.customer_name , T1.customer_phone FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "No Response"
find the number of rows in train table
Output: SELECT Count ( * ) FROM train
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find the average duration in the results of step 1 whose resolution less than 800
Output: SELECT Avg ( T1.duration ) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find song's f_id of the results of step 1 whose formats equals mp4 or resolution greater than 720
Output: SELECT T2.f_id FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp4" OR T2.resolution > 720
find each value of Classroom in teachers table along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , Classroom FROM teachers GROUP BY Classroom
find the number of rows in Roles table
Output: SELECT Count ( * ) FROM Roles
Step 1: For each row in Faculty_Participates_in table, find corresponding rows in Activity table and in Faculty table.
Step 2: find activity_name of the results of step 1 whose Lname equals Mark and Lname equals Giuliano
Output: SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid JOIN Faculty AS T3 ON T2.FacID = T3.FacID WHERE T3.Lname = "Giuliano" AND T3.Lname = "Mark"
Step 1: find the number of rows of each value of party_phone in Parties table.
Step 2: find party_email of Parties table with largest value in the results of step 1
Output: SELECT party_email FROM Parties GROUP BY party_phone ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Orders table, find corresponding rows in Customers table and in Shipments table.
Step 2: find shipment_date of the results of step 1 whose customer_name equals Jeramie
Output: SELECT T3.shipment_date FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Shipments AS T3 ON T2.order_id = T3.order_id WHERE T1.customer_name = "Jeramie"
Step 1: For each row in Documents table, find the corresponding rows in Document_Sections table.
Step 2: for each value of section_title in the results of step 1, calculate number of rows.
Step 3: show each value of section_title in the results of step 1 along with the average access_count with smallest value in the results of step 2
Output: SELECT T1.access_count , Avg ( T1.access_count ) FROM Documents AS T1 JOIN Document_Sections AS T2 ON T1.document_code = T2.document_code GROUP BY T2.section_title ORDER BY Count ( * ) Asc LIMIT 1
find each value of activity_name in Activity table along with the number of the corresponding rows to each value
Output: SELECT activity_name , Count ( * ) FROM Activity GROUP BY activity_name
find without repetition the cust_name of customer table ordered ascending by acc_bal
Output: SELECT DISTINCT cust_name FROM customer ORDER BY acc_bal Asc
Step 1: find the customer_id of Complaints table.
Step 2: find the email_address of Customers table whose Customers's customer_id one of the results of step 1
Output: SELECT T1.email_address FROM Customers AS T1 WHERE T1.customer_id IN ( SELECT T2.customer_id FROM Complaints AS T2 )
Step 1: find the number of rows of each value of Type in school table.
Step 2: find Type in school table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT Type FROM school GROUP BY Type HAVING Count ( * ) > = 2
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find file_size, formats of the results of step 1 whose rating less than 800
Output: SELECT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.rating < 800
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find without repetition files's artist_name of the results of step 1 whose resolution greater than english
Output: SELECT DISTINCT T1.artist_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution > "english"
Step 1: For each row in Invoices table, find the corresponding rows in Shipments table.
Step 2: find invoice_date of the results of step 1 whose shipment_tracking_number equals 3452
Output: SELECT T1.invoice_date FROM Invoices AS T1 JOIN Shipments AS T2 ON T1.invoice_number = T2.invoice_number WHERE T2.shipment_tracking_number = 3452
Step 1: For each row in list table, find the corresponding rows in teachers table.
Step 2: find the number of rows of each value of Classroom in the results of step 1.
Step 3: find FirstName, LastName of step 1 results with largest value in the results of step 2
Output: SELECT T1.FirstName , T2.LastName FROM list AS T1 JOIN teachers AS T2 GROUP BY T1.Classroom ORDER BY Count ( * ) Desc LIMIT 1
Step 1: for each value of city in airports table, calculate number of rows.
Step 2: show each value of city in airports table along with the corresponding number of rows ordered descending by the results of step 1
Output: SELECT city , Count ( * ) FROM airports GROUP BY city ORDER BY Count ( * ) Desc
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, test_result of the results of step 1
Output: SELECT T1.date_of_latest_logon , T3.test_result 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
Step 1: For each row in Courses table, find the corresponding rows in Student_Course_Enrolment table.
Step 2: find date_of_enrolment of the results of step 1 whose course_name equals Pass
Output: SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Pass"
find the stuid of Participates_in table
Output: SELECT stuid FROM Participates_in
Step 1: For each row in Tourist_Attractions table, find corresponding rows in Locations table and in Street_Markets table.
Step 2: find Market_Details, Address of the results of step 1 whose Address equals 660 Shea Crescent
Output: SELECT T3.Market_Details , T1.Address FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID JOIN Street_Markets AS T3 ON T2.Tourist_Attraction_ID = T3.Market_ID WHERE T1.Address = "660 Shea Crescent"
Step 1: find the LastName of list table for which FirstName equals JEROME.
Step 2: find the LastName of list table for which FirstName equals COVIN.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT LastName FROM list WHERE FirstName = "JEROME" EXCEPT SELECT LastName FROM list WHERE FirstName = "COVIN"
find the number of rows in festival_detail table whose Year equals 2008 or Year equals 2010
Output: SELECT Count ( * ) FROM festival_detail WHERE Year = 2010 OR Year = 2008
Step 1: For each row in Addresses table, find the corresponding rows in Individuals table.
Step 2: find state_province_county of the results of step 1 whose individual_first_name equals 6862 Kaitlyn Knolls
Output: SELECT T1.state_province_county FROM Addresses AS T1 JOIN Individuals AS T2 WHERE T2.individual_first_name = "6862 Kaitlyn Knolls"
Step 1: find the Visits's Tourist_Attraction_ID of Visits table for which Visit_Details equals Rosalind.
Step 2: find the Name of Tourist_Attractions table whose Tourist_Attractions's Tourist_Attraction_ID not one of the results of step 1
Output: SELECT T1.Name FROM Tourist_Attractions AS T1 WHERE T1.Tourist_Attraction_ID NOT IN ( SELECT T2.Tourist_Attraction_ID FROM Visits AS T2 WHERE T2.Visit_Details = "Rosalind" )
Step 1: find the Chair_Name of festival_detail table ordered descending by Year.
Step 2: only show the first 3 rows of the results
Output: SELECT Chair_Name FROM festival_detail ORDER BY Year Desc LIMIT 3
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_registration of the results of step 1 whose test_result equals Pass
Output: SELECT T1.date_of_registration 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 = "Pass"
Step 1: find the number of rows of each value of country in airports table.
Step 2: find country of airports table with largest value in the results of step 1
Output: SELECT country FROM airports GROUP BY country ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Students table, find the corresponding rows in Student_Course_Enrolment table.
Step 2: find date_of_latest_logon, date_of_enrolment of the results of step 1 whose personal_name equals Karson
Output: SELECT T1.date_of_latest_logon , T2.date_of_enrolment FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id WHERE T1.personal_name = "Karson"
find the invoice_number of Invoices table for which invoice_date greater than or equals 1989-09-03
Output: SELECT invoice_number FROM Invoices WHERE invoice_date > = "1989-09-03"
find the number of rows in airports table whose country equals Greenland
Output: SELECT Count ( * ) FROM airports WHERE country = "Greenland"
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 course_name, family_name, course_description of step 1 results with largest value in the results of step 2
Output: SELECT T2.course_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
Step 1: For each row in company table, find the corresponding rows in employment table.
Step 2: find Name, Year_working of the results of step 1 ordered descending by Year_working
Output: SELECT T1.Name , T2.Year_working FROM company AS T1 JOIN employment AS T2 ON T1.Company_ID = T2.Company_ID ORDER BY T2.Year_working Desc
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find artist's artist_name of the results of step 1 whose song's country equals UK.
Step 3: find the song's artist_name of song table for which song's country equals english.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.country = "UK" INTERSECT SELECT T2.artist_name FROM song AS T2 WHERE T2.country = "english"
find the duration, duration, formats of files table ordered ascending by duration
Output: SELECT duration , duration , formats FROM files ORDER BY duration Asc