niryuu/sni-each-converted huggingface dataset:
SQL: SELECT Author , Scores FROM submission ORDER BY Scores Asc
Feedback: Do not need to find scores .
Output: SELECT Author FROM submission ORDER BY Scores ASC
SQL: SELECT * FROM employees WHERE HIRE_DATE BETWEEN "1987-06-17" AND "2002-06-21"
Feedback: Only need to find for hire date less than June 21 , 2002.
Output: SELECT * FROM employees WHERE hire_date  <  '2002-06-21'
SQL: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top Desc LIMIT 1
Feedback: Replace largest with smallest .
Output: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
SQL: SELECT Count ( * ) FROM Songs WHERE Title = "Flash"
Feedback: Make sure to find number of bandmate in performance table instead of songs table .
Output: SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate  =  T2.id JOIN songs AS T3 ON T3.songid  =  T1.songid WHERE T3.Title  =  "Flash"
SQL: SELECT T2.DName , T1.Lname FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T2.Building = "Mergenthaler" AND T1.Building = "NEB" INTERSECT SELECT T2.DName , T1.Lname FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T2.Building = "M" AND T1.Building = "NEB"
Feedback: Make sure find Faculty's last name last name , first name for male gender and residing in building NEB .
Output: SELECT Fname ,  Lname FROM FACULTY WHERE sex  =  "M" AND Building  =  "NEB"
SQL: SELECT JOB_TITLE FROM jobs WHERE MIN_SALARY > 8000
Feedback: Replace job title with job id and replace min salary with average salary of employees table .
Output: SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000
SQL: SELECT Document_ID FROM Documents WHERE Document_Name LIKE "s"
Feedback: Make sure those documents are available in reference document types table .
Output: SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T1.document_name LIKE '%s%'
SQL: SELECT T1.DEPARTMENT_NAME , Count ( * ) FROM departments AS T1 JOIN employees AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY T2.DEPARTMENT_ID
Feedback: Replace employees's department id with departments's department name , should find summation of employees working in it
Output: SELECT department_name ,  COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY department_name
SQL: SELECT Location_Code , Count ( * ) FROM Ref_Locations GROUP BY Location_Code
Feedback: Find the number of corresponding rows of document locations table and also the number of documents .
Output: SELECT location_code ,  count(*) FROM Document_locations GROUP BY location_code
SQL: SELECT Sum ( T2.Adults ) FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room WHERE T1.bedType = "modern"
Feedback: Replace adults and bed Type with max occupancy of rooms table and decor respectively .
Output: SELECT sum(maxOccupancy) FROM Rooms WHERE decor  =  'modern'
SQL: SELECT Author FROM submission GROUP BY Author HAVING Count ( * ) > 1
Feedback: Replace author in submission table with author in acceptance table
Output: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id)  >  1
SQL: SELECT DName FROM Department WHERE Building = 268
Feedback: Replace department name with department phone .
Output: SELECT DPhone FROM DEPARTMENT WHERE Room  =  268
SQL: SELECT MAX_SALARY , MIN_SALARY FROM jobs
Feedback: Replace max salary with salary , min salary with manager id , jobs table with employees table
Output: SELECT salary ,  manager_id FROM employees WHERE manager_id != "null"
SQL: SELECT T1.Document_ID FROM Documents AS T1 EXCEPT SELECT T3.Document_ID FROM Ref_Document_Types AS T2 JOIN Documents AS T1 ON T2.Document_Type_Code = T1.Document_Type_Code JOIN Documents_with_Expenses AS T3 ON T1.Document_ID = T3.Document_ID WHERE T2.Document_Type_Name = "CV"
Feedback: Make sure document type code equals CV .
Output: SELECT document_id FROM Documents WHERE document_type_code  =  "CV" EXCEPT SELECT document_id FROM Documents_with_expenses
SQL: SELECT T2.Colors FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID ORDER BY T1.Enrollment Desc LIMIT 1
Feedback: Replace colors with school colors of school table .
Output: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
SQL: SELECT T2.Pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.name = "Cargo" INTERSECT SELECT T3.name FROM airport AS T1 JOIN operate_company AS T3 JOIN flight AS T2 ON T1.id = T2.airport_id AND T2.company_id = T3.id WHERE T1.name = "Catering services"
Feedback: Replace airport's name with operate company's principal activities for both , step 4: replace operate company's name with pilot .
Output: SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Catering services'
SQL: SELECT Team FROM player ORDER BY Age Asc LIMIT 1
Feedback: Replace smallest value of age with largest value of age .
Output: SELECT Team FROM player ORDER BY Age DESC LIMIT 1
SQL: SELECT Building FROM Faculty GROUP BY Building ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Need to find for the instructor who teaches highest number of courses .
Output: SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor  =  T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Denomination FROM school WHERE Founded > 1890 INTERSECT SELECT Denomination FROM school WHERE Founded < 1900
Feedback: Replace greater than to less than and less than to greater than in step 1 and 2.
Output: SELECT Denomination FROM school WHERE Founded  <  1890 INTERSECT SELECT Denomination FROM school WHERE Founded  >  1900
SQL: SELECT Count ( * ) FROM Ref_Document_Types
Feedback: Replace reference document types table with statements table .
Output: SELECT count(*) FROM Statements
SQL: SELECT Location FROM school GROUP BY Location HAVING Count ( * ) > 1
Feedback: Replace location with school id , school with player in step 1.
Output: SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*)  >  1
SQL: SELECT name , age FROM Person WHERE job = "Dan" INTERSECT SELECT name , age FROM Person WHERE job = "Alice"
Feedback: Replace job with friend for all steps .
Output: SELECT T1.name ,  T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Dan' INTERSECT SELECT T1.name ,   T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Alice'
SQL: SELECT name , Industry FROM Companies ORDER BY name Asc
Feedback: Replace industry with assets billion .
Output: SELECT name ,  Assets_billion FROM Companies ORDER BY name ASC
SQL: SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Famous_Title = "Gorgoroth"
Feedback: Replace famous title with artist .
Output: SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.Artist  =  "Gorgoroth"
SQL: SELECT Title FROM film GROUP BY Title ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace title with studio in both .
Output: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT T2.Type FROM Band AS T1 JOIN Vocals AS T2 ON T1.Id = T2.Bandmate WHERE T1.Lastname = "Heilo"
Feedback: Also add songs table in step 1 , also make sure title equals Der Kapitan .
Output: SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid JOIN band AS T3 ON T1.bandmate  =  T3.id WHERE T3.lastname  =  "Heilo" AND T2.title  =  "Der Kapitan"
SQL: SELECT name FROM buildings GROUP BY name HAVING Count ( * ) > 1
Feedback: Instep 1 , there should be company id of office locations instead of name in buildings table .
Output: SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id  =  T2.id JOIN Companies AS T3 ON T1.company_id  =  T3.id GROUP BY T1.building_id HAVING COUNT(*)  >  1
SQL: SELECT T2.Firstname , T2.Lastname FROM Songs AS T1 JOIN Band AS T2 JOIN Instruments AS T3 ON T1.SongId = T3.SongId AND T3.BandmateId = T2.Id WHERE T1.Title = "Badlands"
Feedback: Replace instrument instruments table with performance table to make sure song performed by artist .
Output: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Badlands"
SQL: SELECT T2.FIRST_NAME , T2.LAST_NAME FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.JOB_TITLE LIKE "%m"
Feedback: Also find salary , Replace "JOB TITLE" with first name
Output: SELECT first_name ,  last_name ,  salary FROM employees WHERE first_name LIKE '%m'
SQL: SELECT T1.part_id , T2.part_fault_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_id ORDER BY Sum ( T1.chargeable_amount ) Asc LIMIT 1
Feedback: No need to find summation of chargeable amount in step 2 , replace part fault id with chargeable amount .
Output: SELECT part_id ,  chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1
SQL: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008 AND T1.Regional_Population < 23019148
Feedback: Remove condition , Also find city whose temperature's mar is lower than jul and hosted any event .
Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
SQL: SELECT T1.Name , T2.Name FROM Scientists AS T1 JOIN Projects AS T2 JOIN AssignedTo AS T3 ON T1.SSN = T3.Scientist AND T3.Project = T2.Code ORDER BY T2.Hours Desc LIMIT 1
Feedback: Replace Projects's name with Scientists's ssn .
Output: SELECT T3.ssn ,  T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT max(hours) FROM projects)
SQL: SELECT DISTINCT staff_first_name , staff_last_name FROM Staff WHERE staff_id = 1
Feedback: Replace staff id with problem id of Problem Log's table .
Output: SELECT DISTINCT staff_first_name ,  staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1
SQL: SELECT FIRST_NAME , LAST_NAME FROM employees WHERE SALARY BETWEEN 24000 AND 6000
Feedback: Also need to find salary and make sure salary is lower than 6000.
Output: SELECT first_name ,  last_name ,  salary FROM employees WHERE salary  <  6000
SQL: SELECT EMPLOYEE_ID , HIRE_DATE FROM employees WHERE SALARY = 24000
Feedback: Replace hire date with end date of job history table and remove " salary equals 24000".
Output: SELECT employee_id ,  MAX(end_date) FROM job_history GROUP BY employee_id
SQL: SELECT Count ( * ) FROM Ref_Document_Types
Feedback: Replace reference document types table with reference calendar table .
Output: SELECT count(*) FROM Ref_calendar
SQL: SELECT FIRST_NAME , LAST_NAME , SALARY , DEPARTMENT_ID FROM employees
Feedback: Also need to find hire date and make sure first name should not contain letter M .
Output: SELECT first_name ,  last_name ,  hire_date ,  salary ,  department_id FROM employees WHERE first_name NOT LIKE '%M%'
SQL: SELECT EMPLOYEE_ID , LAST_NAME FROM employees WHERE FIRST_NAME LIKE "T"
Feedback: Also find first name ahead of last name , employee should have another employee containing letter T in ( same)department
Output: SELECT employee_id ,  first_name ,  last_name FROM employees WHERE department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%T%' )
SQL: SELECT Location_Name , Location_Code FROM Ref_Locations GROUP BY Location_Code ORDER BY Count ( * ) Asc LIMIT 1
Feedback: In step 1 , Replace reference locations table with document locations table .
Output: SELECT T2.location_name ,  T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code  =  T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1
SQL: SELECT DISTINCT Type FROM Vocals
Feedback: Replace type with instrument instruments , vocals table with instrument instruments table .
Output: SELECT DISTINCT instrument FROM Instruments
SQL: SELECT name , age , city FROM Person ORDER BY age Desc LIMIT 1
Feedback: Only need to make sure these persons are friends with Alice for largest time .
Output: SELECT T1.name ,  T1.age ,  T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend =  'Alice' AND T2.year  =  (SELECT max(YEAR) FROM PersonFriend WHERE friend =  'Alice')
SQL: SELECT T1.Document_Date FROM Documents AS T1 WHERE T1.Document_Type_Code = "GV" INTERSECT SELECT T2.Document_Details FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.Document_ID = T2.Document_ID WHERE T1.Document_Type_Code = "SF"
Feedback: Replace document type code with budget type code in both step 1 and 3 , and document details with document date .
Output: SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'SF'
SQL: SELECT City , Hanyu_Pinyin FROM city ORDER BY GDP Asc LIMIT 1
Feedback: Replace hanyu pinyin with gdp .
Output: SELECT city ,  GDP FROM city ORDER BY GDP LIMIT 1
SQL: SELECT T2.Location_Code , T2.Date_in_Location_From , T3.Actual_Destruction_Date FROM All_Documents AS T1 JOIN Document_Locations AS T2 ON T2.Document_ID = T1.Document_ID JOIN Documents_to_be_Destroyed AS T3 ON T1.Document_ID = T3.Document_ID
Feedback: Replace actual destruction date with date in locaton to of document locations table .
Output: SELECT location_code ,  date_in_location_from ,  date_in_locaton_to FROM Document_locations
SQL: SELECT T2.DName FROM Student AS T1 JOIN Department AS T2 JOIN Minor_in AS T3 ON T1.StuID = T3.StuID AND T3.DNO = T2.DNO GROUP BY T1.Major ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Need to find Minor instead of each value of major .
Output: SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO  =  T2.DNO GROUP BY T2.DNO ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Avg ( Famous_Release_date ) FROM artist WHERE Artist = "Gorgoroth" OR Artist = 25
Feedback: Replace famous release date with average weeks on top of volumes table , age equal or lower than 25 , remove last part .
Output: SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  25
SQL: SELECT GDP , Regional_Population FROM city GROUP BY City HAVING Count ( * ) > 1
Feedback: Replace city in city table with host city in hosting city .
Output: SELECT t1.gdp ,  t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY t2.Host_City HAVING count(*)  >  1
SQL: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Club AS T2 JOIN Member_of_club AS T3 ON T1.StuID = T3.StuID AND T3.ClubID = T2.ClubID AND T1.StuID = T3.StuID WHERE T2.ClubName = "Bootup Baltimore" AND T3.Position = "F"
Feedback: Replace position with sex of student table , make sure females are member of the club .
Output: SELECT t3.fname ,  t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t1.clubname  =  "Bootup Baltimore" AND t3.sex  =  "F"
SQL: SELECT T3.Statement_ID , T1.Document_Description , T3.Account_Details FROM Documents AS T1 JOIN Statements AS T2 ON T1.Document_ID = T2.Statement_ID JOIN Accounts AS T3 ON T2.Statement_ID = T3.Statement_ID
Feedback: Remove document description , also find Statements's statement details ahead of account details .
Output: SELECT T1.statement_id ,  T2.statement_details ,  T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id  =  T2.statement_id
SQL: SELECT T2.FIRST_NAME , T2.LAST_NAME , T1.COUNTRY_NAME FROM countries AS T1 JOIN employees AS T2
Feedback: Should also find employee id , make sure country should be printed in which employees residing currently
Output: SELECT T1.first_name ,  T1.last_name , T1.employee_id ,  T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id JOIN locations AS T3 ON T2.location_id  =  T3.location_id JOIN countries AS T4 ON T3.country_id  =  T4.country_id
SQL: SELECT Document_Name , Document_Date FROM Documents WHERE Document_Description = "Graph Database project"
Feedback: Replace document description with project details .
Output: SELECT document_name ,  document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id  =  T2.project_id WHERE T2.project_details  =  'Graph Database project'
SQL: SELECT bedType FROM Rooms GROUP BY bedType ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Replace bed Type with decor for both .
Output: SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1
SQL: SELECT Count ( DISTINCT Budget_Type_Code ) FROM Documents_with_Expenses
Feedback: Replace documents with expenses table with reference budget codes .
Output: SELECT count(*) FROM Ref_budget_codes
SQL: SELECT name , job , city FROM Person ORDER BY name Asc
Feedback: Need to remove city .
Output: SELECT name ,  job FROM Person ORDER BY name
SQL: SELECT Count ( * ) FROM Club WHERE ClubName = "Bootup Baltimore" AND ClubName = "Pen and Paper Gaming"
Feedback: Find the total StudID of member of club who is member of Pen and Paper Gaming club .
Output: SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t1.clubname  =  "Pen and Paper Gaming"
SQL: SELECT Count ( * ) FROM Person WHERE city = "Austin"
Feedback: Make sure to find those people who have no friends in Austin .
Output: SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city  =  'Austin')
SQL: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Club AS T2 JOIN Member_of_club AS T3 ON T1.StuID = T3.StuID AND T3.ClubID = T2.ClubID WHERE T2.ClubName = "Hopkins Student Enterprises"
Feedback: Find the student's full name whose position equals CTO of member of club table .
Output: SELECT t3.fname ,  t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t1.clubname  =  "Hopkins Student Enterprises" AND t2.position  =  "CTO"
SQL: SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Age = 34 OR T1.Age = 32
Feedback: Make sure artist 's age equals or greater than 32.
Output: SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  >=  32
SQL: SELECT T2.part_fault_id , T1.skill_description , T2.part_id FROM Skills AS T1 JOIN Part_Faults AS T2 JOIN Skills_Required_To_Fix AS T3 ON T1.skill_id = T3.skill_id AND T3.part_fault_id = T2.part_fault_id GROUP BY T2.part_fault_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Need to find fault log entry id , fault description , fault log entry datetime instead of Part Faults's part fault id , skill description , part id .
Output: SELECT T1.fault_log_entry_id ,  T1.fault_description ,  T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT name FROM Person ORDER BY age Asc LIMIT 1
Feedback: Need to find on basis of largest value of age of that person's friend .
Output: SELECT T2.name ,  avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1
SQL: SELECT Count ( * ) , Project_ID FROM Documents WHERE Document_Type_Code = "BK" GROUP BY Document_ID
Feedback: Should be corresponding rows to each value of product id .
Output: SELECT count(*) ,  project_id FROM Documents WHERE document_type_code  =  "BK" GROUP BY project_id
SQL: SELECT Boys_or_Girls , Count ( * ) FROM school GROUP BY School_ID
Feedback: Need to replace school id with denomination , and should find numbers of schools associated with it .
Output: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination
SQL: SELECT Account_Details , Account_ID FROM Accounts GROUP BY Account_Details ORDER BY Count ( * ) Desc LIMIT 1 INTERSECT SELECT Account_Details FROM Accounts GROUP BY Account_Details ORDER BY Count ( * ) Desc LIMIT 1
Feedback: account details should contain character 5 , remove account id , step 3 , 5 , 6 and step 4 replace step 4 with step 2.
Output: SELECT max(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"
SQL: SELECT Count ( * ) FROM Student WHERE Fname = "Linda" AND LName = "Smith"
Feedback: Need to find number of clubs linda smith is member of .
Output: SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t3.fname  =  "Linda" AND t3.lname  =  "Smith"
SQL: SELECT Destruction_Authorised_by_Employee_ID , Count ( DISTINCT Document_ID ) FROM Documents_to_be_Destroyed GROUP BY Destruction_Authorised_by_Employee_ID
Feedback: Replace destruction authorised by employee id with destroyed by employee id
Output: SELECT Destroyed_by_Employee_ID ,  count(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID
SQL: SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY name Asc
Feedback: Replace name with stories .
Output: SELECT name FROM buildings WHERE Status  =  "on-hold" ORDER BY Stories ASC
SQL: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Club AS T2 JOIN Member_of_club AS T3 ON T1.StuID = T3.StuID AND T3.ClubID = T2.ClubID WHERE T2.ClubName = "Bootup Baltimore"
Feedback: Also need to mention the position equals president .
Output: SELECT t3.fname ,  t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t1.clubname  =  "Bootup Baltimore" AND t2.position  =  "President"
SQL: SELECT T1.problem_log_id , T2.problem_description FROM Problem_Log AS T1 JOIN Problems AS T2 ON T1.problem_id = T2.problem_id
Feedback: Replace problem description with log entry description
Output: SELECT problem_log_id ,  log_entry_description FROM problem_log
SQL: SELECT Music_Festival FROM music_festival WHERE Category = "Best Song"
Feedback: Replace music festival with date of ceremony and make sure to add result equals Awarded .
Output: SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded"
SQL: SELECT DISTINCT T1.Type FROM operate_company AS T1 JOIN flight AS T2 ON T1.id = T2.company_id WHERE T2.Velocity < = 200
Feedback: velocity should be less than 200 and not equals to 200.
Output: SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T2.velocity  <  200
SQL: SELECT T2.Document_Description , T2.Document_Name FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID WHERE T1.Project_Details = "Private Project"
Feedback: Replace document description with statement details , and project details with statement details .
Output: SELECT T1.statement_details ,  T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id  =  T2.document_id WHERE T1.statement_details  =  'Private Project'
SQL: SELECT Count ( * ) FROM Songs
Feedback: Replace songs table with band table .
Output: SELECT count(*) FROM Band
SQL: SELECT Max ( Age ) , Min ( Age ) FROM artist
Feedback: Replace age with weeks on top and replace artist table with volume table .
Output: SELECT max(Weeks_on_Top) ,  min(Weeks_on_Top) FROM volume
SQL: SELECT roomName FROM Rooms ORDER BY basePrice Desc
Feedback: Replace descending order with ascending order .
Output: SELECT roomName FROM Rooms ORDER BY basePrice
SQL: SELECT Count ( * ) FROM Songs WHERE Title = "Le Pop"
Feedback: Replace songs table with instrument instruments table and make sure to find number of instrument instruments .
Output: SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Le Pop"
SQL: SELECT Count ( * ) FROM Band WHERE Lastname = "Heilo"
Feedback: Replace band table with instrument instruments , make sure to find total number of instrument instruments .
Output: SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid  =  T2.id WHERE T2.lastname  =  "Heilo"
SQL: SELECT T1.Title FROM Songs AS T1 JOIN Albums AS T2 JOIN Tracklists AS T3 ON T1.SongId = T3.SongId AND T3.AlbumId = T2.AId WHERE T2.Year < "A Kiss Before You Go: Live in Hamburg"
Feedback: Replace "Year less than" with "Album's title equals"
Output: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE T1.title  =  "A Kiss Before You Go: Live in Hamburg"
SQL: SELECT T2.first_name , T2.last_name , T1.skill_description FROM Skills AS T1 JOIN Maintenance_Engineers AS T2 JOIN Engineer_Skills AS T3 ON T1.skill_id = T3.skill_id AND T3.engineer_id = T2.engineer_id
Feedback: Also need to find other details of maintenance engineers .
Output: SELECT T1.first_name ,  T1.last_name ,  T1.other_details ,  T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id  =  T2.engineer_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
SQL: SELECT T1.problem_log_id FROM Problem_Log AS T1 JOIN Staff AS T2 ON T1.assigned_to_staff_id = T2.staff_id WHERE T2.staff_first_name = "Weber" OR T2.staff_first_name = "Jolie"
Feedback: Also add staff first name equals Dameon and staff last name equals Frami , replace ör"with"and" , last staff first name with staff last name .
Output: SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Jolie" AND T2.staff_last_name = "Weber"
SQL: SELECT T1.product_name FROM Product AS T1 JOIN Problems AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id ORDER BY Count ( * ) Desc LIMIT 3
Feedback: Replace Problems's product id with problem id .
Output: SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3
SQL: SELECT CName FROM Course GROUP BY CID HAVING Count ( * ) > = 5
Feedback: Replace course table with enrolled in table .
Output: SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID  =  T2.CID GROUP BY T2.CID HAVING COUNT(*)  >=  5
SQL: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.age = ( SELECT Min ( T2.year ) FROM PersonFriend AS T2 )
Feedback: Only find for persons who are friends with Alice .
Output: SELECT name FROM PersonFriend WHERE friend =  'Alice' AND YEAR  =  (SELECT min(YEAR) FROM PersonFriend WHERE friend =  'Alice')
SQL: SELECT Avg ( T1.SALARY ) FROM employees AS T1 WHERE T1.EMPLOYEE_ID NOT IN ( SELECT T2.EMPLOYEE_ID FROM job_history AS T2 )
Feedback: Remove step 1 and last part of step 2 , Make sure to find commission pct does not equals to null .
Output: SELECT department_id ,  AVG(salary) FROM employees WHERE commission_pct != "null" GROUP BY department_id
SQL: SELECT Count ( * ) FROM Vocals WHERE Type = "lead"
Feedback: Make sure to find number of songs in songs table .
Output: SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE TYPE  =  "lead"
SQL: SELECT T2.FIRST_NAME , T2.LAST_NAME FROM departments AS T1 JOIN employees AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.DEPARTMENT_NAME = 90 OR T1.DEPARTMENT_NAME = 70
Feedback: Replace department name with department id for both .
Output: SELECT first_name ,  last_name FROM employees WHERE department_id  =  70 OR department_id  =  90
SQL: SELECT Count ( * ) FROM Student WHERE Fname = "Eric" AND LName = "Tai"
Feedback: Find number of clubs and make sure Eric Tai is student of that clubs .
Output: SELECT count(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t3.fname  =  "Eric" AND t3.lname  =  "Tai"
SQL: SELECT Date , Venue FROM workshop ORDER BY Date Asc
Feedback: Replace date with venue .
Output: SELECT Date ,  Venue FROM workshop ORDER BY Venue
SQL: SELECT product_details , product_name FROM Product GROUP BY product_name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: find number of problems instead of product details .
Output: SELECT count(*) ,  T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1
SQL: SELECT name , gender , gender FROM architect GROUP BY id HAVING Count ( * ) > = 1
Feedback: Replace first gender with id , Remove last part , Make sure architect build two bridges or one mill .
Output: SELECT T1.id ,  T1.name ,  T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  2 UNION SELECT T1.id ,  T1.name ,  T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  1
SQL: SELECT Studio FROM film WHERE Director = "Walter Hill"
Feedback: Also find for director equals Nicholas Meyer .
Output: SELECT Studio FROM film WHERE Director  =  "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director  =  "Walter Hill"
SQL: SELECT DName FROM Department WHERE Division = "AS" AND Building = "Mergenthaler" INTERSECT SELECT DName FROM Department WHERE Division = "EN" AND Building = "NEB"
Feedback: step 1 , replace and building equals Mergenthaler" with "or division equals EN" , Remove "Division equals EN and" step 2.
Output: SELECT DName FROM DEPARTMENT WHERE Division  =  "AS" UNION SELECT DName FROM DEPARTMENT WHERE Division  =  "EN" AND Building  =  "NEB"
SQL: SELECT Count ( * ) FROM Songs
Feedback: Make sure songs are in studio albums .
Output: SELECT count(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE t1.type  =  "Studio"
SQL: SELECT T1.Role_Name , T2.Role_Code , T2.Date_of_Birth FROM Roles AS T1 JOIN Employees AS T2 ON T1.Role_Code = T2.Role_Code WHERE T2.Employee_Name = "Armani"
Feedback: Replace role name with employee name .
Output: SELECT employee_name ,  role_code ,  date_of_birth FROM Employees WHERE employee_Name  =  'Armani'
SQL: SELECT T2.Type FROM Band AS T1 JOIN Vocals AS T2 ON T1.Id = T2.Bandmate WHERE T1.Firstname = "Solveig"
Feedback: Make sure to include title equals "A Bar in Amsterdam" of songs table .
Output: SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid JOIN band AS T3 ON T1.bandmate  =  T3.id WHERE T3.firstname  =  "Solveig" AND T2.title  =  "A Bar In Amsterdam"
SQL: SELECT staff_name , staff_id FROM Staff EXCEPT SELECT staff_name , staff_id FROM Staff
Feedback: Step 1:staff who has recorded any Fault . Step 2:staff who has contacted any visiting engineer .
Output: SELECT T1.staff_name ,  T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id  =  T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name ,  T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id  =  T4.contact_staff_id
SQL: SELECT Count ( * ) FROM Student
Feedback: Replace student table with club table .
Output: SELECT count(*) FROM club
SQL: SELECT DISTINCT Fname FROM Student WHERE LName LIKE "a"
Feedback: Replace last name last name with first name .
Output: SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'
SQL: SELECT DISTINCT skill_description , skill_description FROM Skills
Feedback: Make sure to replace skill description with fault short name of part faults table .
Output: SELECT T1.fault_short_name ,  T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id  =  T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
SQL: SELECT decor FROM Rooms WHERE decor = "modern" INTERSECT SELECT decor FROM Rooms WHERE bedType = "Recluse and defiance"
Feedback: Remove 1st and 3rd steps , Replace bed Type with room name .
Output: SELECT decor FROM Rooms WHERE roomName  =  "Recluse and defiance"
SQL: SELECT T1.Famous_Title FROM artist AS T1 EXCEPT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2
Feedback: Replace less than 2 with quals to 2.
Output: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  <  2
SQL: SELECT Document_Type_Code FROM Documents GROUP BY Document_Type_Code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace document type code in documents table with budget type code in documents with expenses for all .
Output: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1
SQL: SELECT route_name FROM Delivery_Routes GROUP BY route_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace delivery routes table with delivery route locations table .
Output: SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id  =  t2.route_id GROUP BY t1.route_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Author FROM submission ORDER BY Scores Asc LIMIT 1
Feedback: Replace smallest with largest .
Output: SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
SQL: SELECT job FROM Person ORDER BY age Asc LIMIT 1
Feedback: Make sure to find for each job .
Output: SELECT min(age) ,  job FROM Person GROUP BY job
SQL: SELECT T2.Document_Name , T1.Document_Type_Description , T2.Document_Date FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code
Feedback: Replace document name with document type name .
Output: SELECT T1.document_type_name ,  T1.document_type_description ,  T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code  =  T2.document_type_code
SQL: SELECT Employee_ID FROM Employees
Feedback: Make sure find those employees have authorized destruction .
Output: SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
SQL: SELECT FIRST_NAME , LAST_NAME FROM employees ORDER BY SALARY Asc LIMIT 1
Feedback: Also need to find department id and make sure to find the details for each departments .
Output: SELECT first_name ,  last_name ,  department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)
SQL: SELECT Max ( Age ) , Min ( Age ) FROM Student WHERE city_code = "NYC"
Feedback: Replace age with grade point in both .
Output: SELECT max(T2.gradepoint) ,  min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.city_code  =  "NYC"
SQL: SELECT Famous_Title FROM artist GROUP BY Famous_Title HAVING Count ( * ) > 2
Feedback: In step 1 , replace famous title in artist table with weeks on top of volume table .
Output: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2
SQL: SELECT age FROM Person WHERE name = "doctor"
Feedback: Make sure for which job equals doctor and name equals Zach .
Output: SELECT age FROM Person WHERE job  =  'doctor' AND name  =  'Zach'
SQL: SELECT Count ( * ) FROM Engineer_Visits WHERE fault_status = "Waiting"
Feedback: Replace engineer visits table with fault log parts table and remove the last part .
Output: SELECT DISTINCT fault_status FROM Fault_Log_Parts
SQL: SELECT Count ( * ) FROM Scientists
Feedback: Count projects along with scientists name assigned to him or her .
Output: SELECT count(*) ,  T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn  =  T2.scientist GROUP BY T1.name
SQL: SELECT name , age FROM Person WHERE age > ( SELECT Avg ( age ) FROM Person )
Feedback: Replace name of person table with friend of person friend .
Output: SELECT DISTINCT T2.name ,  T2.friend ,  T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend WHERE T1.age  >  (SELECT avg(age) FROM person)
SQL: SELECT T1.Song FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume WHERE T2.Category = "Nominated"
Feedback: Replace category with result .
Output: SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume  =  T2.Volume_ID WHERE T1.Result  =  "Nominated"
SQL: SELECT Count ( DISTINCT Document_Type_Code ) FROM All_Documents
Feedback: Replace document type code with document id .
Output: SELECT count(*) FROM Ref_document_types
SQL: SELECT FIRST_NAME , LAST_NAME FROM employees WHERE JOB_ID = "AD_PRES" AND SALARY > 163
Feedback: Make sure the salary is greater than that of Employee whose employee id equals 163.
Output: SELECT first_name ,  last_name FROM employees WHERE salary  >  (SELECT salary FROM employees WHERE employee_id = 163 )
SQL: SELECT state_province_county , Count ( * ) FROM Addresses GROUP BY state_province_county
Feedback: The corresponding rows should be of customer addresses table and need to count total customers .
Output: SELECT t2.state_province_county ,  count(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id  =  t2.address_id GROUP BY t2.state_province_county
SQL: SELECT T1.roomName FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room WHERE T2.FirstName = "ROY"
Feedback: Replace "equals" with "contains" in step 2.
Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE firstname LIKE '%ROY%'
SQL: SELECT EMPLOYEE_ID FROM employees GROUP BY EMPLOYEE_ID HAVING Count ( * ) > = 2
Feedback: Replace employees table with job history table in step 1.
Output: SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*)  >= 2
SQL: SELECT DISTINCT T1.Fname FROM Student AS T1 JOIN Enrolled_in AS T2 ON T1.StuID = T2.StuID JOIN Gradeconversion AS T3 ON T2.Grade = T3.lettergrade WHERE T1.Major = 3.8 OR T3.gradepoint > 4
Feedback: Remove condition , make sure grade point equals or above 3. 8 in minimum one course .
Output: SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T2.gradepoint  >=  3.8
SQL: SELECT Sum ( followers ) , name FROM user_profiles GROUP BY name
Feedback: should replace name with uid
Output: SELECT count(*) FROM follows GROUP BY f1
SQL: SELECT dept_store_id FROM Departments GROUP BY dept_store_id ORDER BY Count ( * ) Asc LIMIT 1
Feedback: step 1 should find the number of rows of each value of department id in staff department assignments table
Output: SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) LIMIT 1
SQL: SELECT Count ( * ) FROM flight WHERE destination = "Los Angeles"
Feedback: Replace destination with origin and find flight number instead of the number of rows
Output: SELECT flno FROM Flight WHERE origin  =  "Los Angeles"
SQL: SELECT distance FROM flight ORDER BY distance Asc LIMIT 3
Feedback: Replace First "distance" word with airline id and remove " 3" in step 2.
Output: SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
SQL: SELECT Count ( DISTINCT Comptroller ) FROM party
Feedback: Replace comptroller with governor .
Output: SELECT count(DISTINCT Governor) FROM party
SQL: SELECT DISTINCT T2.Position FROM team AS T1 JOIN match_season AS T2 ON T1.Team_id = T2.Team WHERE T1.Name = "Duke" OR T1.Name = "UCLA"
Feedback: Replace name with college in both .
Output: SELECT DISTINCT POSITION FROM match_season WHERE College  =  "UCLA" OR College  =  "Duke"
SQL: SELECT Count ( * ) FROM actor
Feedback: Replace actor table with store table .
Output: SELECT count(*) FROM store
SQL: SELECT Name FROM Patient EXCEPT SELECT Name FROM Patient
Feedback: Replace name of patient patient table with name of medication medication equals Procrastin X in step 2.
Output: SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient  =  T1.SSN JOIN Medication AS T3 ON T2.Medication  =  T3.Code WHERE T3.name  =  'Procrastin-X'
SQL: SELECT supplier_id FROM Product_Suppliers GROUP BY product_id HAVING Avg ( total_value_purchased ) > 50000
Feedback: Replace total value purchased with total amount purchased , corresponding step 1 value should be greater than 50000 or less than 30000.
Output: SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(total_amount_purchased)  >  50000 OR avg(total_amount_purchased)  <  30000
SQL: SELECT School_name FROM School WHERE Enrollment > 495 OR Enrollment < 10
Feedback: Remove enrollment part and Make sure endowment's amount less than or quals to 10.
Output: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount)  <=  10
SQL: SELECT T2.Team FROM wrestler AS T1 JOIN Elimination AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T1.Name = "Orton" INTERSECT SELECT T2.Team FROM wrestler AS T1 JOIN Elimination AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T1.Name = "Benjamin"
Feedback: Replace name with eliminated by in all steps and replace "step 3" word with "step 1".
Output: SELECT Team FROM Elimination WHERE Eliminated_By  =  "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By  =  "Benjamin"
SQL: SELECT country FROM country GROUP BY country HAVING Count ( * ) > = 3
Feedback: Replace country in country table with city in city table in step 1.
Output: SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id  =  T2.country_id GROUP BY T2.country_id HAVING count(*)  >=  3
SQL: SELECT Count ( * ) FROM Player_Attributes
Feedback: Replace player attributes table with league table and make sure Country's name equals England .
Output: SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id  =  T2.country_id WHERE T1.name  =  "England"
SQL: SELECT dept_store_id FROM Departments GROUP BY dept_store_id ORDER BY Count ( * ) Desc LIMIT 2
Feedback: In step 2 , replace department store id of departments table with department store chain id in department stores table .
Output: SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2
SQL: SELECT Population FROM city WHERE Status ! = "Village"
Feedback: Replace population with census ranking .
Output: SELECT Census_Ranking FROM city WHERE Status !=  "Village"
SQL: SELECT eid , name FROM employee
Feedback: Make sure salary of employee is largest .
Output: SELECT eid ,  name FROM Employee ORDER BY salary DESC LIMIT 1
SQL: SELECT Count ( DISTINCT Official_native_language ) FROM country
Feedback: Make sure to find for those player's position equals Defender .
Output: SELECT count(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender"
SQL: SELECT Count ( * ) FROM Products WHERE product_name = "South"
Feedback: Replace products table and product name with department stores table and department store chain id of department store chain table respectively .
Output: SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id  =  T2.dept_store_chain_id WHERE T2.dept_store_chain_name  =  "South"
SQL: SELECT order_id , customer_id , customer_id FROM Customer_Orders WHERE order_status_code = "Cancelled" ORDER BY order_date Asc
Feedback: Remove one of the "customer id".
Output: SELECT order_id ,  customer_id FROM customer_orders WHERE order_status_code  =   "Cancelled" ORDER BY order_date
SQL: SELECT Count ( * ) FROM follows
Feedback: Replace follows table with tweets table , make sure users had posted tweets .
Output: SELECT count(DISTINCT UID) FROM tweets
SQL: SELECT Name , Count ( * ) FROM Physician GROUP BY Name
Feedback: Should corresponds to the number of patients treated by physician physician .
Output: SELECT T1.name ,  count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid
SQL: SELECT T1.Name FROM Physician AS T1 JOIN Nurse AS T2 JOIN Appointment AS T3 ON T1.EmployeeID = T3.Physician AND T3.PrepNurse = T2.EmployeeID WHERE T2.Position = "senior"
Feedback: Remove "Nurse's position equals senior" and add condition "Physician's position contains senior".
Output: SELECT name FROM physician WHERE POSITION LIKE '%senior%'
SQL: SELECT Name FROM wrestler WHERE Days_held = 100
Feedback: Make sure days held less than 100 instead of days held equals 100.
Output: SELECT Name FROM wrestler WHERE Days_held  <  100
SQL: SELECT DISTINCT BlockCode FROM Room
Feedback: Make sure rooms which are not reserved .
Output: SELECT DISTINCT blockcode FROM room WHERE unavailable  =  0
SQL: SELECT Name FROM channel EXCEPT SELECT Name FROM channel
Feedback: In step 2 , make sure owner equals CCTV .
Output: SELECT name FROM channel WHERE OWNER != 'CCTV'
SQL: SELECT product_id , product_name FROM Products WHERE product_price BETWEEN 900 AND 600
Feedback: Make sure product price Less than 600 or greater than 900 , remove Last part .
Output: SELECT product_id ,  product_name FROM products WHERE product_price  <  600 OR product_price  >  900
SQL: SELECT Avg ( Num_Employees ) FROM department WHERE Ranking < 15 OR Ranking < 10
Feedback: Replace "less than 10" with "greater than 10" and replace or with "and".
Output: SELECT avg(num_employees) FROM department WHERE ranking BETWEEN 10 AND 15
SQL: SELECT name FROM employee EXCEPT SELECT name FROM employee
Feedback: Need to make sure employees does not have certificate for aircraft's distance equals Boeing 737 800.
Output: SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
SQL: SELECT T2.Name FROM Physician AS T1 JOIN Nurse AS T2 JOIN Appointment AS T3 ON T1.EmployeeID = T3.Physician AND T3.PrepNurse = T2.EmployeeID GROUP BY T1.Position ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace Physician's position with Appointment's appointment id .
Output: SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid  =  T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM actor
Feedback: Make sure to find number of stock item in inventory table whose store id equals 1.
Output: SELECT count(*) FROM inventory WHERE store_id  =  1
SQL: SELECT id , name FROM mountain GROUP BY id HAVING Count ( * ) > = 2
Feedback: Replace mountain table with photos .
Output: SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id GROUP BY T1.id HAVING count(*)  >=  2
SQL: SELECT staff_name , staff_gender FROM Staff WHERE staff_name = "2016%"
Feedback: Replace staff name with date assigned from of staff department assignments table .
Output: SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.date_assigned_from LIKE "2016%"
SQL: SELECT product_id FROM Product_Suppliers GROUP BY product_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace product suppliers table with order items in step 1.
Output: SELECT product_id FROM order_items GROUP BY product_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Name FROM building WHERE Height_feet BETWEEN 20 AND 200
Feedback: Make sure height feet equals or greater than 200 and floors equals or greater than 20.
Output: SELECT name FROM building WHERE height_feet  >=  200 AND floors  >=  20
SQL: SELECT T1.School_name FROM School AS T1 JOIN endowment AS T2 ON T1.School_id = T2.School_id WHERE T2.amount > 8.5
Feedback: Also make sure that schools have greater than one donator .
Output: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.amount  >  8.5 GROUP BY T1.school_id HAVING count(*)  >  1