niryuu/sni-each-converted huggingface dataset:
SQL: SELECT student_id FROM Student_Course_Registrations ORDER BY registration_date Asc
Feedback: Make sure student registered for course name equals statistics
Output: SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date
SQL: SELECT T2.student_id FROM Student_Course_Registrations AS T1 JOIN Student_Course_Attendance AS T2 ON T1.course_id = T2.course_id ORDER BY T1.registration_date Desc LIMIT 1
Feedback: Make sure course id equals 301 and in step 2 , there should be student course registrations instead of student course attendance .
Output: SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1
SQL: SELECT T1.country , T1.lat FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId JOIN pitStops AS T3 ON T2.raceId = T3.raceId ORDER BY T3.milliseconds Desc LIMIT 1
Feedback: In step 2 replace country with name ,  latitude with date ,  milliseconds with date .
Output: SELECT name ,  date FROM races ORDER BY date DESC LIMIT 1
SQL: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Visits_Restaurant AS T2 ON T1.StuID = T2.StuID WHERE T2.Spent = 600
Feedback: Need to replace spent with major .
Output: SELECT Fname , Lname FROM Student WHERE Major  =  600
SQL: SELECT T1.card_type_code FROM Customers_Cards AS T1 JOIN Financial_Transactions AS T2 ON T1.card_id = T2.card_id GROUP BY T2.transaction_type HAVING Count ( * ) > = 5
Feedback: Replace transaction type with card type code of customers cards .
Output: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING count(*)  >=  5
SQL: SELECT Location , Location FROM university
Feedback: Remove one location and make sure to find school for which affiliation equals Public .
Output: SELECT school ,  LOCATION FROM university WHERE affiliation  =  'Public'
SQL: SELECT cmi_cross_ref_id , source_system_code FROM CMI_Cross_References GROUP BY cmi_cross_ref_id HAVING Count ( * ) > = 1
Feedback: In step 1 , it should be council tax table in place of cmi cross references table .
Output: SELECT T1.cmi_cross_ref_id ,  T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*)  >=  1
SQL: SELECT T1.booking_start_date , T1.booking_start_date FROM Bookings AS T1 JOIN Products_for_Hire AS T2 JOIN Products_Booked AS T3 ON T1.booking_id = T3.booking_id AND T3.product_id = T2.product_id WHERE T2.product_name = "Book collection A"
Feedback: One of the product description should be replaced by returned yes or no .
Output: SELECT T3.booking_start_date ,   T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id  =  T2.product_id JOIN bookings AS T3 ON T2.booking_id  =  T3.booking_id WHERE T1.product_name  =  'Book collection A'
SQL: SELECT Count ( * ) FROM enzyme WHERE id NOT IN ( SELECT Chromosome FROM enzyme )
Feedback: Make sure to replace chromosome of enzyme with enzyme id of medicine enzyme interaction .
Output: SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction )
SQL: SELECT qualifyId , constructorId FROM qualifying WHERE number = "Belgium" OR number = "France"
Feedback: Replace qualify Id ,  constructor Id ,  both "number" and qualifying table with circuit Id , location , country and circuits table respectively .
Output: SELECT circuitid ,  LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
SQL: 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 LIKE "inhibitor"
Feedback: Replace porphyria and medicine 's name contains" with medicine 's name and medicine enzyme interaction 's interaction type equals" respectively .
Output: SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id  =  T3.id WHERE T3.name  =  'Amisulpride' AND T2.interaction_type  =  'inhibitor'
SQL: SELECT country FROM circuits WHERE lat BETWEEN 2011 AND 2009
Feedback: Change country of circuits table with races' name and "lat equals or" with "races' year is".
Output: SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
SQL: SELECT T3.name FROM department AS T1 JOIN course AS T2 ON T2.dept_name = T1.dept_name JOIN student AS T3 ON T1.dept_name = T3.dept_name WHERE T2.dept_name = "International Finance"
Feedback: Replace department and department name with prerequisite and title , student must have taken prerequiste for course .
Output: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id  =  T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id  =  T4.course_id WHERE T3.title  =  'International Finance')
SQL: SELECT name FROM enzyme WHERE Porphyria LIKE "ALA"
Feedback: Replace porphyria with name .
Output: SELECT name FROM enzyme WHERE name LIKE "%ALA%"
SQL: SELECT T1.course_id , T1.course_name , Count ( * ) FROM Courses AS T1 JOIN Student_Course_Registrations AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id
Feedback: In step 2 , interchange student course registrations with courses and vice versa .
Output: SELECT T3.course_name ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id
SQL: SELECT name FROM races ORDER BY name Asc
Feedback: Replace name with forename and races table with drivers table .
Output: SELECT DISTINCT forename FROM drivers ORDER BY forename ASC
SQL: SELECT Nationality FROM host WHERE Age < 45 INTERSECT SELECT Nationality FROM host WHERE Age > 35
Feedback: Replace less than to greater than in step 1 and greater than to less than(in step 2).
Output: SELECT Nationality FROM HOST WHERE Age  >  45 INTERSECT SELECT Nationality FROM HOST WHERE Age  <  35
SQL: SELECT dept_name , building FROM department ORDER BY budget Asc
Feedback: Make sure to find ordered descending by budget not ascending by budget .
Output: SELECT dept_name ,  building FROM department ORDER BY budget DESC
SQL: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Company = "Peter Jones" OR T1.Company = "Simon Woodroffe"
Feedback: There should be investor instead of company .
Output: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor  =  "Simon Woodroffe" OR T1.Investor  =  "Peter Jones"
SQL: SELECT Count ( * ) FROM circuits WHERE * NOT IN ( SELECT * FROM circuits WHERE circuitRef = 2009 )
Feedback: In step 1 use races table instead of circuits table and year instead of circuit reference .
Output: SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )
SQL: SELECT T2.Season FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id WHERE T1.name = "Walter Samuel"
Feedback: In step 1 replace stadium with injury accident , in step 2 replace name with player .
Output: SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id  =  T2.game_id WHERE T2.player  =  'Walter Samuel'
SQL: SELECT T1.Name , Count ( * ) FROM people AS T1 JOIN debate_people AS T2 ON T1.People_ID = T2.Affirmative GROUP BY T2.Affirmative
Feedback: Make sure to find those name of people who were took affirmative side of debate .
Output: SELECT T2.Name ,  COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative  =  T2.People_ID GROUP BY T2.Name
SQL: SELECT document_id FROM Documents WHERE document_type_code = "done" EXCEPT SELECT document_id FROM Documents WHERE document_type_code = "USPS"
Feedback: In step 1 replace document type code with document status code also add document type code equals Paper , In step 2 replace document type code with shipping agent name .
Output: SELECT document_id FROM Documents WHERE document_status_code  =  "done" AND document_type_code = "Paper" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
SQL: SELECT T1.country , T1.circuitRef FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId WHERE T2.name = "Lewis"
Feedback: Replace circuits table , country , circuit Reference and races's name with drivers table , races's name ,  year and drivers' forename respectively .
Output: SELECT T2.name ,  T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
SQL: SELECT Company FROM entrepreneur GROUP BY Investor HAVING Count ( * ) > = 2
Feedback: In step 2 find investor instead of company .
Output: SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*)  >=  2
SQL: SELECT Email FROM Customer WHERE City = "NY"
Feedback: Also need to find customer id and city and replace city with state .
Output: SELECT * FROM CUSTOMER WHERE State  =  "NY"
SQL: SELECT T1.Name , Count ( * ) FROM technician AS T1 JOIN repair_assignment AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.technician_id
Feedback: ( Step 2) Find number of rows of each value of repair assignment's technician id along with corresponding technician's name .
Output: SELECT T2.Name ,  COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID  =  T2.technician_ID GROUP BY T2.Name
SQL: SELECT Milliseconds , TrackId FROM Track ORDER BY Milliseconds Asc LIMIT 1
Feedback: Also find milliseconds with the largest value of it . Remove track id .
Output: SELECT max(Milliseconds) ,  min(Milliseconds) FROM TRACK
SQL: SELECT Company FROM entrepreneur
Feedback: Need to find people's name whose people id is also present in entrepreneur's people id .
Output: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID
SQL: SELECT T1.LastName FROM Customer AS T1 WHERE T1.CustomerId NOT IN ( SELECT T2.CustomerId FROM Invoice AS T2 WHERE T2.Total < 20 )
Feedback: Replace Customer's customer id with Invoice's customer id and total should be equals or less than 20.
Output: SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T2.total  >  20
SQL: SELECT Count ( * ) FROM bank
Feedback: Make sure to find summation of no of customers .
Output: SELECT sum(no_of_customers) FROM bank
SQL: SELECT T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id AND T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id WHERE T2.Away_team = "Thiago Motta" AND T3.Player = "Walter Samuel"
Feedback: There should be player instead of away team .
Output: SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id WHERE T3.player  =  'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id WHERE T3.player  =  'Thiago Motta'
SQL: SELECT candidate_id FROM Candidate_Assessments WHERE qualification = "Pass"
Feedback: Need to replace qualification with asessment outcome code .
Output: SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass"
SQL: SELECT transaction_type , Count ( * ) FROM Financial_Transactions GROUP BY transaction_type
Feedback: Replace transaction type in financial transactions table with distinct card type code in customers cards , corresponding rows to each value of transaction made .
Output: SELECT T2.card_type_code ,  count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id  =  T2.card_id GROUP BY T2.card_type_code
SQL: SELECT T1.sec_id FROM section AS T1 WHERE T1.course_id NOT IN ( SELECT T2.course_id FROM prereq AS T2 )
Feedback: In step 2 it should find course's course id which are'nt one of the results of step 1.
Output: SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq
SQL: SELECT T1.Name FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T2.Storm_ID HAVING Count ( * ) > = 2
Feedback: Make sure to replace "greater than or equals" with "less than".
Output: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id HAVING count(*)  >=  2
SQL: SELECT title FROM course WHERE title = "Mobile Computing"
Feedback: Make sure prerequisite for course's title equals Mobile Computing .
Output: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id  =  T2.course_id WHERE T2.title  =  'Mobile Computing')
SQL: SELECT Name , ArtistId FROM Artist GROUP BY ArtistId HAVING Count ( * ) > = 3
Feedback: In step 1 , replace artist id in artist table in place of artist id in album table .
Output: SELECT T2.Name ,  T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*)  >=  3 ORDER BY T2.Name
SQL: SELECT T2.name , T1.Trade_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 T1.FDA_approved = "Yes"
Feedback: In step 2 Replace enzyme with medicine .
Output: SELECT name ,  trade_name FROM medicine WHERE FDA_approved  =  'Yes'
SQL: SELECT Starting_Year FROM technician ORDER BY Age Asc LIMIT 1
Feedback: Instead of smallest value of age , find for largest value of age .
Output: SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1
SQL: SELECT employee_name FROM Employees EXCEPT SELECT employee_name FROM Employees
Feedback: Make sure corresponding employee id is also present in Circulation History's employee id in step 2.
Output: SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id
SQL: SELECT Region_code , Count ( * ) FROM region GROUP BY Region_code
Feedback: Replace region code with region name , should find number of corresponding rows of each region id in affected region .
Output: SELECT T1.region_name ,  count(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
SQL: SELECT T1.Name FROM Artist AS T1 WHERE T1.ArtistId NOT IN ( SELECT T2.ArtistId FROM Album AS T2 )
Feedback: In step 2 replace artist 's artist with album 's artist .
Output: SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId
SQL: SELECT shipping_agent_code FROM Documents WHERE receipt_number = "UPS"
Feedback: Replace documents table with reference shipping agents table , receipt number with shipping agent name .
Output: SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS"
SQL: SELECT circuitId , name FROM races GROUP BY url ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Replace url in races , circuit Id , name , races table with lap times in milliseconds , forename , surname and drivers table respectively .
Output: SELECT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
SQL: SELECT T2.Name , T2.Location FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID WHERE T1.Class = 1
Feedback: Replace class with race id .
Output: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
SQL: SELECT Player_name , Sponsor_name FROM player WHERE Occupation ! = "Researcher"
Feedback: Need to replace sponsor name with residence .
Output: SELECT Player_name ,  residence FROM player WHERE Occupation != "Researcher"
SQL: SELECT T3.council_tax_id FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id JOIN Parking_Fines AS T3 ON T2.cmi_cross_ref_id = T3.cmi_cross_ref_id WHERE T1.cmi_details = "Schmitt-Lang" EXCEPT SELECT T3.council_tax_id FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id JOIN Parking_Fines AS T3 ON T2.cmi_cross_ref_id = T3.cmi_cross_ref_id WHERE T1.cmi_details = "Schmidt ,  Kertzmann and Lubowitz"
Feedback: Replace whose cmi details equals Schmitt Lang with for customer master index table , In step 1 replace parking fines with rent arrears .
Output: SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id  =  T2.master_customer_id WHERE T3.cmi_details != 'Schmidt ,  Kertzmann and Lubowitz'
SQL: SELECT Founded FROM university ORDER BY Enrollment Desc LIMIT 1
Feedback: There should be founded instead of enrollment . and make sure affiliation is nonpublic .
Output: SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1
SQL: SELECT T1.role_description , T2.employee_id , Count ( * ) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
Feedback: Also count the number of rows of employees table .
Output: SELECT T1.role_description ,  T2.role_code ,  count(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
SQL: SELECT Location FROM perpetrator ORDER BY Injured Desc LIMIT 1
Feedback: There should be largest value of killed not injured .
Output: SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1
SQL: SELECT title FROM course WHERE dept_name = "Statistics" AND dept_name ! = "Psychology"
Feedback: Make sure to swap Psychology and Statistics department .
Output: SELECT title FROM course WHERE dept_name  =  'Statistics' EXCEPT SELECT title FROM course WHERE dept_name  =  'Psychology'
SQL: SELECT T2.i_ID FROM instructor AS T1 JOIN advisor AS T2 ON T1.ID = T2.i_ID WHERE T1.dept_name = "History"
Feedback: Find instructor's id for student whose department name equals History , make sure instructor is an advisor .
Output: SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id  =  T2.id WHERE T2.dept_name  =  'History'
SQL: SELECT Region_name FROM region WHERE Region_code ! = "Denmark"
Feedback: It should be region name in place of region code .
Output: SELECT region_name FROM region WHERE region_name != 'Denmark'
SQL: SELECT T1.Party_Theme FROM party AS T1 JOIN party_host AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T2.Party_ID HAVING Count ( * ) > 20
Feedback: In step 1 replace party host table with host , In step 2 replace party host 's party id with party 's number of hosts , Add host 's name In step 3.
Output: SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID  =  T2.Host_ID JOIN party AS T3 ON T1.Party_ID  =  T3.Party_ID WHERE T3.Number_of_hosts  >  20
SQL: SELECT Count ( * ) FROM Customers WHERE customer_first_name = "Blanche" AND customer_last_name = "Huels"
Feedback: Replace customers table with customers cards table and make sure card type code equals credit .
Output: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Blanche" AND T2.customer_last_name  =  "Huels" AND T1.card_type_code  =  "Credit"
SQL: SELECT Count ( DISTINCT Advisor ) FROM Student
Feedback: Replace advisor with student id and Add Student's advisor equals 1121.
Output: SELECT count(*) FROM Student WHERE Advisor =  1121
SQL: SELECT T2.Height FROM perpetrator AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Killed Desc
Feedback: There should be injured instead of killed .
Output: SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Injured DESC
SQL: SELECT Count ( * ) FROM university WHERE Location = "NY"
Feedback: Instead "equals" make sure it is"contains".
Output: SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"
SQL: SELECT name FROM instructor WHERE dept_name = "Math" ORDER BY salary Asc
Feedback: Make sure instructor who teaches department name equals Math of students , Replace salary with total credits .
Output: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id WHERE T3.dept_name  =  'Math' ORDER BY T3.tot_cred
SQL: SELECT Count ( * ) FROM Student WHERE Fname = "Linda" AND LName = "Smith"
Feedback: Make sure to find number of rows of visits restaurant for which Restaurant's restaurant id equals Subway .
Output: SELECT count(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway"
SQL: SELECT card_type_code , Count ( * ) FROM Customers_Cards GROUP BY card_type_code
Feedback: It should be the number of the corresponding rows to each card type code .
Output: SELECT card_type_code ,  count(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code
SQL: SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 GROUP BY T1.customer_id ORDER BY Count ( * ) Asc LIMIT 1
Feedback: In step 3 replace accounts with customers .
Output: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1
SQL: SELECT T2.Name FROM perpetrator AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Country = "China" OR T1.Location = "Japan"
Feedback: Replace location with country .
Output: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID WHERE T2.Country  =  "China" OR T2.Country  =  "Japan"
SQL: SELECT Name FROM actor EXCEPT SELECT Name FROM actor
Feedback: In step 1 find musical id of musical table , in step 2 find musical id of actor table .
Output: SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor)
SQL: SELECT Count ( * ) FROM classroom AS T1 JOIN time_slot AS T2 WHERE T2.end_hr > 50 AND T1.building = "Alumni"
Feedback: Find only room number and building , make sure capacity range is 50 to 100.
Output: SELECT building ,  room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
SQL: SELECT T1.Product , T1.Chromosome , T2.interaction_type FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T1.Location = "Cytosol"
Feedback: Use porphyria Instead of interaction type .
Output: SELECT product ,  chromosome ,  porphyria FROM enzyme WHERE LOCATION  =  'Cytosol'
SQL: SELECT Name FROM actor WHERE age < = 20
Feedback: Replace equals 20 with greater than 20.
Output: SELECT Name FROM actor WHERE Age != 20
SQL: SELECT student_id , Count ( * ) FROM Student_Course_Attendance GROUP BY student_id
Feedback: Replace student course attendance with student course registrations and should be number of corresponding rows of each student course registrations student id .
Output: SELECT T1.student_id ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id
SQL: SELECT source_system_code , cmi_cross_ref_id FROM CMI_Cross_References ORDER BY source_system_code Asc
Feedback: Need to find benifit id instead of cmi cross reference id , and also order by benifit id for corresponding cmi cross reference id .
Output: SELECT T1.source_system_code ,  T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id ORDER BY T2.council_tax_id
SQL: SELECT T1.card_type_code FROM Customers_Cards AS T1 JOIN Financial_Transactions AS T2 ON T1.card_id = T2.card_id GROUP BY T2.transaction_type ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Make sure to replace transaction type with card type code .
Output: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Documents_Mailed WHERE document_id = 2
Feedback: Replace documents mailed table with draft copies table .
Output: SELECT count(*) FROM Draft_Copies WHERE document_id = 2
SQL: 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"
Feedback: Use web client accelerator name instead of connection .
Output: SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T1.name  =  'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T1.name  =  'Fasterfox'
SQL: SELECT Count ( * ) FROM classroom WHERE capacity > "Lamberton" AND capacity < 50
Feedback: Make sure it should be capacity less than 50 and building equals Lamberton .
Output: SELECT count(*) FROM classroom WHERE building  =  'Lamberton' AND capacity  <  50
SQL: SELECT Name FROM musical WHERE Award = "Bob Fosse"
Feedback: Replace award with nominee .
Output: SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse"
SQL: SELECT id , name FROM Web_client_accelerator GROUP BY id HAVING Count ( * ) > = 2
Feedback: In step 1 , there should be accelerator id of accelerator compatible browser table in place of id in web client accelerator table .
Output: SELECT T1.id ,  T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
SQL: 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
Feedback: Replace less with greater than or equals .
Output: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id JOIN storm AS T3 ON T1.storm_id  =  T3.storm_id WHERE T3.number_deaths  >=  10
SQL: SELECT id , name FROM enzyme GROUP BY id , name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace id , name in enzyme with enzyme id of medicine enzyme interaction for which interaction type equals activator in step 1.
Output: SELECT T1.id ,  T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id WHERE T2.interaction_type  =  'activitor' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT name FROM instructor WHERE salary > 80000
Feedback: Make sure department name equals Comp . Sci . department .
Output: SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'  AND salary  >  80000
SQL: SELECT Time FROM climber WHERE Country = "Uganda"
Feedback: Make sure it is mountain's country .
Output: SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID WHERE T2.Country  =  "Uganda"
SQL: SELECT Count ( * ) FROM Web_client_accelerator WHERE Connection = "Broadband, Satellite, Wireless, Fiber, DSL"
Feedback: Make sure to find without repetition client in web client accelerator table and remove condition .
Output: SELECT count(DISTINCT client) FROM web_client_accelerator
SQL: SELECT Avg ( UnitPrice ) FROM Track
Feedback: Make sure it is a track of jazz .
Output: SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Jazz"
SQL: SELECT name FROM instructor
Feedback: Make sure whose department name equals Comp . Sci .
Output: SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'
SQL: SELECT Award FROM musical WHERE Name = "Cleavant Derricks" OR Name = "Tony Award"
Feedback: Replace award and name with nominee and award , Replace Tony award with Bob Fosse .
Output: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" OR Award  =  "Cleavant Derricks"
SQL: SELECT council_tax_id , council_tax_id FROM Parking_Fines WHERE council_tax_id = 9
Feedback: Remove"for which council tax id equals 9" and replace one "council tax id" with "cmi cross ref id".
Output: SELECT council_tax_id ,  cmi_cross_ref_id FROM parking_fines
SQL: 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
Feedback: Replace party theme with party id And Make sure to count rows of party table .
Output: SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID  =  T2.Host_ID JOIN party AS T3 ON T1.Party_ID  =  T3.Party_ID WHERE T2.Age  >  50
SQL: SELECT Duration FROM actor ORDER BY age Asc LIMIT 1
Feedback: There should be largest value of age instead of smallest value of age .
Output: SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1
SQL: SELECT Membership_card , Age , Address FROM member ORDER BY Time_of_purchase Asc
Feedback: Replace membership card with time of purchase .
Output: SELECT Time_of_purchase ,  age ,  address FROM member ORDER BY Time_of_purchase
SQL: 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
Feedback: Replace constructor results with driver standings , position text with forename , race id with wins , also make sure position equals standing .
Output: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
SQL: SELECT customer_id , card_id , card_number , other_card_details FROM Customers_Cards
Feedback: Replace other card details with card type code .
Output: SELECT card_id ,  customer_id ,  card_type_code ,  card_number FROM Customers_cards
SQL: SELECT Count ( * ) , Affiliation FROM university WHERE Founded < 1850 GROUP BY Affiliation
Feedback: Replace affiliation with enrollment , find corresponding rows to each value of affiliation . make sure greater than 1850.
Output: SELECT sum(Enrollment) ,  affiliation FROM university WHERE founded  >  1850 GROUP BY affiliation
SQL: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.ID = T2.ID WHERE T2.year = 2003
Feedback: Also make sure semester equals Fall .
Output: SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester  =  'Fall' AND YEAR  =  2003)
SQL: SELECT Count ( * ) FROM stadium
Feedback: Find number of games whose game id is not one of the result of injury accident table .
Output: SELECT count(*) FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident )
SQL: SELECT Count ( * ) FROM Customer_Master_Index
Feedback: Replace customer master index with rent arrears .
Output: SELECT count(*) FROM rent_arrears
SQL: SELECT Date FROM perpetrator ORDER BY Killed Desc LIMIT 1
Feedback: Need to change height instead of killed .
Output: SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Height DESC LIMIT 1
SQL: SELECT name , salary FROM instructor WHERE dept_name = "History"
Feedback: Make sure instructor's id is one of the result of advisor's year .
Output: SELECT T2.name ,  T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id WHERE T3.dept_name  =  'History'
SQL: SELECT T2.Name FROM perpetrator AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Killed Asc
Feedback: Replace killed with injured in step 2.
Output: SELECT Injured FROM perpetrator ORDER BY Injured ASC
SQL: SELECT * , Player , Source FROM injury_accident WHERE Injury ! = "Knee problem"
Feedback: Also need to find number of matches .
Output: SELECT player ,  number_of_matches ,  SOURCE FROM injury_accident WHERE injury != 'Knee problem'
SQL: 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"
Feedback: " and cmi details equals Schmitt Lang " Remove this .
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  =  'Gottlieb ,  Becker and Wyman'
SQL: SELECT Company , Investor FROM entrepreneur ORDER BY Money_Requested Desc
Feedback: Replace company with people's name , make sure they are entrepreneur .
Output: SELECT T2.Name ,  T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested
SQL: SELECT Name FROM people GROUP BY Name HAVING Count ( * ) > = 2
Feedback: Replace name in people table with negative in debate people table in step 1.
Output: SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative  =  T2.People_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2
SQL: 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"
Feedback: In step 2 , replace porphyria with interaction type and in step 3 replace porphyria with interaction type .
Output: SELECT T1.name ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id WHERE interaction_type  =  'inhibitor' INTERSECT SELECT T1.name ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id WHERE interaction_type  =  'activitor'
SQL: SELECT Count ( * ) FROM medicine
Feedback: Replace medicine table with enzyme table .
Output: SELECT count(*) FROM enzyme
SQL: SELECT City FROM Customer WHERE PostalCode = 70174
Feedback: Replace customer table with employee table .
Output: SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.PostalCode  =  "70174"
SQL: 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
Feedback: Find driver id and constructor reference of status table who has participates in largest country of drivers .
Output: SELECT T1.driverid ,  T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Name FROM actor GROUP BY Name HAVING Count ( * ) > = 3
Feedback: Replace name with musical id in step 1 and replace actor table with musical table in step 2.
Output: SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*)  >=  3
SQL: SELECT student_id FROM Student_Course_Attendance ORDER BY date_of_attendance Asc
Feedback: Make sure course in the statistics department .
Output: SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance
SQL: SELECT DISTINCT name FROM instructor WHERE salary < ( SELECT Max ( salary ) FROM instructor )
Feedback: Their should be salary instead of name .
Output: SELECT DISTINCT salary FROM instructor WHERE salary  <  (SELECT max(salary) FROM instructor)
SQL: SELECT Date FROM game ORDER BY Date Desc
Feedback: Order should be descending by home team .
Output: SELECT Date FROM game ORDER BY home_team DESC
SQL: SELECT first_name , last_name , gender_mf FROM Customers ORDER BY last_name Asc
Feedback: Make sure good or bad customer equal to good .
Output: SELECT first_name ,  last_name ,  gender_mf FROM customers WHERE good_or_bad_customer  =  'good' ORDER BY last_name
SQL: SELECT Count ( * ) FROM Web_client_accelerator WHERE id NOT IN ( SELECT Connection FROM Web_client_accelerator WHERE Connection = "Broadband, Satellite, Wireless, Fiber, DSL" )
Feedback: Replace connection of web client accelerator table with browser id of accelerator compatible browser in step 1 , remove last connection part .
Output: SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser )
SQL: 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
Feedback: Use mailing date instead of receipt date .
Output: SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7
SQL: 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"
Feedback: Their should be region name instead of region code in step 2 and step 3.
Output: SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id JOIN storm AS T3 ON T1.storm_id  =  T3.storm_id WHERE T2.Region_name  =  'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id JOIN storm AS T3 ON T1.storm_id  =  T3.storm_id WHERE T2.Region_name  =  'Albania'
SQL: SELECT Avg ( amount_paid ) FROM Payments
Feedback: Use amount due instead of amount paid .
Output: SELECT avg(amount_due) FROM payments
SQL: SELECT Venue FROM debate ORDER BY Venue Asc
Feedback: Need to find ordered ascending by num of audience not by venue .
Output: SELECT Venue FROM debate ORDER BY Num_of_Audience ASC
SQL: 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"
Feedback: Remove" player's rank equals 2nd".
Output: SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID  =  T2.Coach_ID JOIN player AS T3 ON T1.Player_ID  =  T3.Player_ID WHERE T2.Rank  =  1
SQL: SELECT Name , Carrier FROM phone
Feedback: Replace name with memory in g .
Output: SELECT Memory_in_G ,  Carrier FROM phone
SQL: 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
Feedback: In second step only make sure people are on affirmative side under debate people
Output: SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Affirmative  =  T3.People_ID WHERE T2.Num_of_Audience  >  200
SQL: SELECT student_id FROM Student_Course_Registrations
Feedback: There should be student course attendance table instead of student course registrations table .
Output: SELECT student_id FROM student_course_attendance
SQL: SELECT T2.LastName FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING Count ( * ) < = 20
Feedback: should find CUSTOMER's last name
Output: SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  <=  20
SQL: SELECT * FROM Discount_Coupons WHERE coupon_amount > 500 OR coupon_amount < 500
Feedback: Replace discount coupons table with customers table , make sure coupon amount equals 500 , and good or bad customer equals good or bad .
Output: SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id  =  T2.coupon_id WHERE T2.coupon_amount  =  500
SQL: SELECT Count ( * ) FROM Ref_Document_Types
Feedback: Replace reference document types table with documents table and Make sure shipping agent name equals USPS for document id .
Output: SELECT count(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
SQL: SELECT year , year FROM takes GROUP BY year ORDER BY Count ( * ) Desc LIMIT 1
Feedback: replace first year with section's semester .
Output: SELECT semester ,  YEAR FROM SECTION GROUP BY semester ,  YEAR ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Avg ( Killed ) FROM perpetrator
Feedback: Need to find average injured people not average killed .
Output: SELECT avg(Injured) FROM perpetrator
SQL: SELECT Count ( * ) FROM storm
Feedback: It should be region table instead of storm .
Output: SELECT count(*) FROM region
SQL: SELECT Name , Duration FROM actor
Feedback: Replace name with character .
Output: SELECT Character ,  Duration FROM actor
SQL: 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"
Feedback: Replace all games with enrollment .
Output: SELECT t2.All_Games ,  t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'Clemson'
SQL: SELECT T2.Date , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id ORDER BY T2.Competition Desc
Feedback: Replace stadium table with injury table , name with player and competition with season
Output: SELECT T1.date ,  T2.player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id  =  T2.game_id ORDER BY T1.season DESC
SQL: 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
Feedback: Require date order placed instead shipment date
Output: SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1
SQL: SELECT city FROM airports GROUP BY city ORDER BY Count ( * ) Asc
Feedback: the number is step 1 should be greater than 2
Output: SELECT city FROM airports GROUP BY city HAVING count(*)  >  2 ORDER BY count(*)
SQL: 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
Feedback: should find the number of songs of each artist then find the country of the artist
Output: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1
SQL: SELECT T1.phone_number FROM Customers AS T1 INTERSECT SELECT T2.phone_number FROM Staff AS T2
Feedback: it does not have to be in both results . should be in any of them instead
Output: SELECT phone_number FROM customers UNION SELECT phone_number FROM staff
SQL: 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
Feedback: in step 2 use , use form id instead of party id
Output: SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id  =  t2.party_id WHERE t2.form_id  =  (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1)
SQL: SELECT document_name , Count ( * ) FROM Documents GROUP BY document_name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: remove step 1 , number of accesses is already calculated as access count
Output: SELECT document_name ,  access_count FROM documents ORDER BY access_count DESC LIMIT 1
SQL: 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
Feedback: should add all load amounts of each customer
Output: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1
SQL: 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
Feedback: It should order ascending by date order placed and Orders's order id must find without repetition .
Output: SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed
SQL: SELECT Count ( * ) FROM teachers WHERE FirstName = "TARRING"
Feedback: Change teachers table with list table , and ensure that teachers's first name equals TARRING and last name equals LEIA .
Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "TARRING" AND T2.lastname  =  "LEIA"
SQL: SELECT Sum ( T2.amount ) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID WHERE T1.city = "New York"
Feedback: state equals New York will take the place of 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.state  =  'New York'
SQL: SELECT Advisor FROM Student WHERE Major = "Spring"
Feedback: major will be replaced by election cycle and that advisor must have record of treasurer votes .
Output: SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.Treasurer_Vote WHERE T2.Election_Cycle  =  "Spring"
SQL: SELECT Count ( * ) FROM Student
Feedback: List distinct president vote in voting record table .
Output: SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD
SQL: SELECT bname FROM bank
Feedback: Also Ensure that branch id is present in loan table .
Output: SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id
SQL: SELECT DISTINCT Major FROM Student
Feedback: Use treasurer vote of voting record table instead of advisor of student table .
Output: SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.Treasurer_Vote
SQL: SELECT cust_name , credit_score FROM customer
Feedback: Specify that the customers have taken any loan .
Output: SELECT DISTINCT T1.cust_name ,  T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id
SQL: SELECT Count ( * ) FROM bank WHERE city = "New York City"
Feedback: In place of finding number of rows we need to find summation of no of customers .
Output: SELECT sum(no_of_customers) FROM bank WHERE city  =  'New York City'
SQL: SELECT T1.FacID FROM Faculty AS T1 UNION SELECT T2.Advisor FROM Student AS T2
Feedback: Find faculty id of faculty who is present in faculty participates in table and advisor of student table .
Output: SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student
SQL: 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"
Feedback: Use song table instead of files table in step 1 , change formats with releasedate in step 2.
Output: SELECT T1.artist_name ,  T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.releasedate LIKE "%Mar%"
SQL: SELECT user_name , user_name FROM Users GROUP BY user_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Put user name , password in place of user name , user name and role code instead of user id .
Output: SELECT user_name ,  password FROM users GROUP BY role_code ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Address , Count ( * ) FROM Locations GROUP BY Address
Feedback: we'll need to supplant address in locations table with how to get there in tourist attractions table .
Output: SELECT How_to_Get_There ,  COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There
SQL: SELECT Address FROM Locations WHERE Location_Name LIKE "film"
Feedback: address is wrong . It should be replaced with location name .
Output: SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE "%film%"
SQL: SELECT Count ( * ) FROM routes
Feedback: Use airlines table in place of routes table .
Output: SELECT count(*) FROM airlines
SQL: SELECT Count ( * ) FROM festival_detail
Feedback: Need to Summation of num of audience for each festivals .
Output: SELECT sum(Num_of_Audience) FROM festival_detail
SQL: SELECT Count ( * ) FROM Activity
Feedback: There should be faculty participates in table to be used , not activity table .
Output: SELECT count(DISTINCT FacID) FROM Faculty_participates_in
SQL: 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
Feedback: Use country instead of airport id in step 4.
Output: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid WHERE T1.country  =  'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1