niryuu/sni-each-converted huggingface dataset:
SQL: SELECT start_date FROM trip WHERE duration BETWEEN 31 AND 30.3
Feedback: Replace start date of trip table with time of weather , replace longitude equals with mean sea level pressure inches .
Output: SELECT date FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
SQL: SELECT Count ( * ) FROM Allergy_Type
Feedback: Replace allergy type allergy type table with student table .
Output: SELECT count(DISTINCT advisor) FROM Student
SQL: SELECT Sum ( Adults ) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY"
Feedback: Need to replace adults with kids .
Output: SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY"
SQL: SELECT Headquarters FROM company EXCEPT SELECT Headquarters FROM company WHERE Company = "Banking"
Feedback: Need to make sure company not equals NULL , also company should be from banking industry .
Output: SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry  =  'Banking'
SQL: SELECT Count ( * ) FROM Participants WHERE Participant_Details = "Dr."
Feedback: Replace equals with contains .
Output: SELECT count(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID  =  T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'
SQL: SELECT first_name , last_name FROM employees GROUP BY state ORDER BY Count ( * ) Desc LIMIT 10
Feedback: Make sure to replace state with hire date . step 1 is unneeded
Output: SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10
SQL: SELECT Headquarters FROM company WHERE Main_Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Company = "Oil and gas"
Feedback: Replace company with main industry .
Output: SELECT headquarters FROM company WHERE main_industry  =  'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry  =  'Oil and gas'
SQL: SELECT start_date FROM trip
Feedback: Replace start date with installation date , need to make sure it has end station id .
Output: SELECT T1.id ,  T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id  =  T2.id
SQL: SELECT Sum ( milliseconds ) FROM tracks
Feedback: Make sure name of track is Fast As a Shark .
Output: SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark"
SQL: SELECT T2.start_station_id , T1.name , T2.subscription_type FROM station AS T1 JOIN trip AS T2
Feedback: Replace start station id with duration , subscription type of trip with latitude of station table , add end station id .
Output: SELECT T1.name ,  T1.lat ,  min(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.end_station_id GROUP BY T2.end_station_id
SQL: SELECT T1.hire_date FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id WHERE T2.last_name = "Lucas"
Feedback: Replace employees table with invoices , hire date with total of invoices , make sure customer's fullname equals Lucas Mancini .
Output: SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"
SQL: SELECT DISTINCT AllergyType FROM Allergy_Type
Feedback: Make sure allergy type allergy type quals to food .
Output: SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype  =  "food"
SQL: SELECT name FROM station WHERE long < 37.5
Feedback: Replace longitude with latitude .
Output: SELECT name FROM station WHERE lat  <  37.5
SQL: SELECT id , name FROM architect GROUP BY id HAVING Count ( * ) > = 3
Feedback: Replace architect table with bridge table and id with architect id in step 1
Output: SELECT T1.id ,  T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  >=  3
SQL: SELECT Firstname , Lastname FROM Band WHERE Firstname = "Le Pop"
Feedback: In last part , there should be title of songs instead of first name .
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  =  "Le Pop"
SQL: SELECT Count ( * ) FROM Ref_Document_Types
Feedback: There should be projects table instead of documents with expenses table .
Output: SELECT count(*) FROM Projects
SQL: SELECT T1.DName FROM Department AS T1 WHERE T1.DNO NOT IN ( SELECT T2.Major FROM Student AS T2 )
Feedback: Replace instructor with room , student table with minor in table .
Output: SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO  =  T2.DNO
SQL: SELECT Famous_Title FROM artist WHERE Famous_Release_date = "Triumfall"
Feedback: Replace famous release date with artist .
Output: SELECT Famous_Title FROM artist WHERE Artist  =  "Triumfall"
SQL: SELECT problem_id FROM Problem_Log WHERE log_entry_date > "1978-06-26"
Feedback: Replace log entry date with date problem reported .
Output: SELECT problem_id FROM problems WHERE date_problem_reported > "1978-06-26"
SQL: SELECT bedType , roomName FROM Rooms
Feedback: Make sure decor equals traditional .
Output: SELECT roomName ,  bedType FROM Rooms WHERE decor = "traditional"
SQL: SELECT T2.FIRST_NAME , T2.LAST_NAME FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 24000 AND T1.JOB_TITLE = "PU_MAN"
Feedback: Also find job title , employee id , Make sure salary greater than those employee whose job title equals PU MAN .
Output: SELECT employee_id ,  first_name ,  last_name ,  job_id FROM employees WHERE salary  >  ( SELECT max(salary) FROM employees WHERE job_id  =  'PU_MAN' )
SQL: SELECT Document_Type_Name , Document_Type_Name , Document_Type_Description FROM Ref_Document_Types
Feedback: Replace first document type name with document type code , also make sure to find for distinct documents .
Output: SELECT document_type_code ,  document_type_name ,  document_type_description FROM Ref_document_types
SQL: SELECT FIRST_NAME , LAST_NAME FROM employees EXCEPT SELECT FIRST_NAME , LAST_NAME FROM employees
Feedback: Also find salary of employees table , Make sure those employees does not pay for commission .
Output: SELECT first_name ,  last_name ,  salary FROM  employees WHERE commission_pct  =  "null"
SQL: SELECT Max ( Adults ) , Sum ( Kids ) FROM Reservations
Feedback: Find number of rows of summation of adults and kids whose max occupancy is maximum .
Output: SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T2.maxOccupancy  =  T1.Adults + T1.Kids
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: Make sure to add stage position of performance table equals back stage .
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" AND T1.StagePosition  =  "back"
SQL: SELECT Count ( * ) FROM Product WHERE product_name = "voluptatem"
Feedback: Need to find number of problems for "voluptatem".
Output: SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem"
SQL: SELECT Count ( * ) , T1.product_id FROM Product AS T1 JOIN Problems AS T2 ON T1.product_id = T2.product_id WHERE T2.date_problem_closed > "1986-11-13" GROUP BY T1.product_id
Feedback: Replace date problem closed with date problem reported .
Output: SELECT count(*) ,  T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id
SQL: SELECT T1.chargeable_amount FROM Parts AS T1 JOIN Assets AS T2 JOIN Asset_Parts AS T3 ON T1.part_id = T3.part_id AND T3.asset_id = T2.asset_id ORDER BY T2.asset_details Asc
Feedback: Also find asset make , asset model , asset details , remove chergeable amount and replace asset details with asset disposed date .
Output: SELECT asset_make ,  asset_model ,  asset_details FROM Assets ORDER BY asset_disposed_date ASC
SQL: SELECT Project_ID FROM Projects GROUP BY Project_ID HAVING Count ( * ) > = 2
Feedback: Replace projects table with documents table in step 1.
Output: SELECT project_id FROM Documents GROUP BY project_id HAVING count(*)  >=  2
SQL: SELECT T2.Name , T1.Name , T2.Hours FROM Scientists AS T1 JOIN Projects AS T2 JOIN AssignedTo AS T3 ON T1.SSN = T3.Scientist AND T3.Project = T2.Code ORDER BY T1.Name Asc
Feedback: Make sure find Projects's name before Scientists's name .
Output: SELECT T1.Name ,  T3.Name ,  T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name ,  T1.Name
SQL: SELECT Count ( * ) FROM Vocals WHERE Type = "Le Pop"
Feedback: Find number of type of vocals table and replace type with title of songs table .
Output: SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Le Pop"
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 = "Der Kapitan"
Feedback: Make sure that artist performed back stage .
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  =  "Der Kapitan" AND T1.StagePosition  =  "back"
SQL: SELECT T1.City FROM city AS T1 JOIN match AS T2 JOIN hosting_city AS T3 ON T1.City_ID = T3.Host_City AND T3.Match_ID = T2.Match_ID WHERE T2.Competition = "Friendly match" AND T2.Competition = "1994 FIFA World Cup qualification"
Feedback: Replace city with match id of hosting city and remove competition equals Friendly match".
Output: SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
SQL: SELECT Fname , LName FROM Student WHERE Major = "Bootup Baltimore"
Feedback: Replace major with club name of club table , and need to make sure major equals 600.
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.major  =  "600"
SQL: SELECT name FROM PersonFriend WHERE friend = "Bob"
Feedback: There should be person table instead of person friend table .
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Bob'
SQL: SELECT Count ( * ) FROM Products
Feedback: Replace products table with customers table . and find the total number of customers .
Output: SELECT count(*) FROM customers
SQL: SELECT gradepoint , gradepoint FROM Gradeconversion WHERE lettergrade LIKE "A"
Feedback: Replace grade point , grade point with "maximum and minimum of grade point , need to find for all letter grade .
Output: SELECT max(gradepoint) ,  min(gradepoint) FROM GRADECONVERSION
SQL: SELECT name FROM Person WHERE job = "Alice" AND gender = "female"
Feedback: Replace name of persontable and job with friend of person friend and name of Persontable respectively .
Output: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend WHERE T2.name  =  'Alice' AND T1.gender  =  'female'
SQL: SELECT * FROM employees AS T1 WHERE T1.EMPLOYEE_ID NOT IN ( SELECT T2.EMPLOYEE_ID FROM job_history AS T2 )
Feedback: Replace employee id of job history with department id of employees , step 2: condition should be "not result of step 1 .
Output: SELECT * FROM employees WHERE department_id  =  "null"
SQL: SELECT name FROM Person WHERE job = "Zach" AND gender = "female"
Feedback: Replace job with PersonFriend's friend .
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Zach' AND T1.gender  =  'female'
SQL: SELECT T1.log_entry_description FROM Problem_Log AS T1 JOIN Staff AS T2 ON T1.assigned_to_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop"
Feedback: Replace log entry description with problem id , Make sure to show log entry description .
Output: SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop"
SQL: SELECT T1.City FROM city AS T1 WHERE T1.City_ID > 1 EXCEPT SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008
Feedback: Step 1:replace last part with mar lower than dec of temperaturetable . Step 3:instead of last part add who have hosted .
Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
SQL: SELECT Count ( DISTINCT city ) FROM Person
Feedback: Replace city with job .
Output: SELECT count(DISTINCT job) FROM Person
SQL: SELECT Count ( * ) FROM Ref_Document_Types
Feedback: Need to count locations from reference locations table .
Output: SELECT count(*) FROM Ref_locations
SQL: SELECT T1.FIRST_NAME , T1.LAST_NAME , T2.STATE_PROVINCE FROM employees AS T1 JOIN locations AS T2
Feedback: Make sure to display department name , city .
Output: SELECT T1.first_name ,  T1.last_name ,  T2.department_name ,  T3.city ,  T3.state_province 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
SQL: SELECT Count ( * ) FROM Reservations WHERE CheckIn = "King"
Feedback: Replace reservations table with rooms table , check in with bed Type .
Output: SELECT count(*) FROM Rooms WHERE bedType  =  "King"
SQL: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T1.City = "Shanghai" AND T2.Year = 2008
Feedback: Remove year part , and find jan of temperature table .
Output: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
SQL: SELECT Count ( * ) FROM Person WHERE age > "engineer"
Feedback: Make sure to find the total number of people .
Output: SELECT count(*) FROM Person WHERE age  >  (SELECT max(age) FROM person WHERE job  =  'engineer')
SQL: SELECT T2.Instrument FROM Band AS T1 JOIN Instruments AS T2 ON T1.Id = T2.BandmateId WHERE T1.Lastname = "Heilo"
Feedback: Need to make Songs's title equals Badlands .
Output: SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId JOIN Instruments AS T4 ON T4.songid  =  T3.songid AND T4.bandmateid  =  T2.id WHERE T2.lastname  =  "Heilo" AND T3.title  =  "Badlands"
SQL: SELECT City FROM city WHERE Regional_Population > 10000000 OR Regional_Population < 5000000
Feedback: Replace 5000000 with 8000000 and 10000000 with 5000000.
Output: SELECT city FROM city WHERE regional_population  >  10000000 UNION SELECT city FROM city WHERE regional_population  <  5000000
SQL: SELECT Type , High_Estimate FROM film_market_estimation
Feedback: Replace type with low estimate .
Output: SELECT Low_Estimate ,  High_Estimate FROM film_market_estimation
SQL: SELECT DEPARTMENT_ID FROM departments GROUP BY DEPARTMENT_ID HAVING Count ( * ) > = 4
Feedback: Replace department id in departments table with manager id in employees table . find distinct value of department id .
Output: SELECT DISTINCT department_id FROM employees GROUP BY department_id ,  manager_id HAVING COUNT(employee_id)  >= 4
SQL: SELECT Count ( * ) FROM Student WHERE Major = "B"
Feedback: Make sure to count number of students , and replace major with Enrolled in's grade .
Output: SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade  =  "B"
SQL: SELECT Fname , Lname FROM Faculty ORDER BY Rank Desc LIMIT 3
Feedback: Make sure to find number of courses instead of rank .
Output: SELECT T2.Fname ,  T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor  =  T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 3
SQL: SELECT Count ( * ) FROM Ref_Document_Types
Feedback: Replace documents with expenses with reference document types . find the total of reference document types .
Output: SELECT count(*) FROM Documents_with_expenses
SQL: SELECT Count ( * ) FROM Person WHERE age > 30
Feedback: Make sure only to count number of engineers .
Output: SELECT count(*) FROM Person WHERE age  >  30 AND job  =  'engineer'
SQL: SELECT name , Count ( * ) FROM airport GROUP BY name
Feedback: Make sure to find operating companies in airline industry .
Output: SELECT T3.id ,  count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id JOIN airport AS T3 ON T2.airport_id  =  T3.id GROUP BY T3.id
SQL: SELECT T2.FIRST_NAME , T2.SALARY FROM departments AS T1 JOIN employees AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.DEPARTMENT_NAME = "Finance"
Feedback: Replace salary with job id .
Output: SELECT T1.first_name ,  T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id WHERE T2.department_name  =  'Finance'
SQL: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY < = "D" ORDER BY T1.MIN_SALARY Desc
Feedback: find information about employees whose first name contains D or S . Replace last min salary with salary .
Output: SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
SQL: SELECT Avg ( T2.Grade ) FROM Student AS T1 JOIN Enrolled_in AS T2 ON T1.StuID = T2.StuID WHERE T1.LName = "Smith"
Feedback: Replace enrolled in table with grade conversion table , grade with grade point .
Output: SELECT avg(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.LName  =  "Smith"
SQL: SELECT asset_id , asset_details , other_asset_details FROM Assets
Feedback: Remove other part details , add asset make and asset model .
Output: SELECT asset_id ,  asset_details ,  asset_make ,  asset_model FROM Assets
SQL: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = "Alice"
Feedback: Make sure friends are of all Alice's friends .
Output: SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name  =  T2.name JOIN PersonFriend AS T3 ON T1.friend  =  T3.name JOIN PersonFriend AS T4 ON T3.friend  =  T4.name WHERE T2.name  =  'Alice' AND T4.name != 'Alice'
SQL: SELECT T1.product_name FROM Product AS T1 JOIN Staff AS T2 JOIN Problems AS T3 ON T1.product_id = T3.product_id AND T3.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Champlin" AND T2.staff_first_name = "Lacey" INTERSECT SELECT T1.product_name FROM Product AS T1 JOIN Staff AS T2 JOIN Problems AS T3 ON T1.product_id = T3.product_id AND T3.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Kenton"
Feedback: In step 3 , replace step3 with step 1 , staff full name equals Lacey Bosco and Kenton Champlin .
Output: SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Lacey" AND T3.staff_last_name = "Bosco" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Kenton" AND T3.staff_last_name = "Champlin"
SQL: SELECT Count ( * ) , bedType FROM Rooms GROUP BY bedType
Feedback: Replace bed Type with decor , should be corresponding rows to each value of bed Type equals King .
Output: SELECT decor ,  count(*) FROM Rooms WHERE bedType = "King" GROUP BY decor
SQL: SELECT T2.Employee_Name , T1.Document_Name FROM All_Documents AS T1 JOIN Employees AS T2 JOIN Documents_to_be_Destroyed AS T3 ON T1.Document_ID = T3.Document_ID AND T3.Destroyed_by_Employee_ID = T2.Employee_ID
Feedback: Need to make sure employees authorised destruction and destroyed corresponding documents .
Output: SELECT T2.employee_name ,  T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id
SQL: SELECT T2.Employee_ID FROM Roles AS T1 JOIN Employees AS T2 ON T1.Role_Code = T2.Role_Code WHERE T1.Role_Name ! = "Human Resource"
Feedback: Make sure role name equals Human Resource or Manager .
Output: SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code  =  T2.role_code WHERE T2.role_name  =  "Human Resource" OR T2.role_name  =  "Manager"
SQL: SELECT T1.FIRST_NAME , T1.LAST_NAME , T1.HIRE_DATE FROM employees AS T1 JOIN locations AS T2 WHERE T2.CITY = "Clara"
Feedback: Replace city with first name .
Output: SELECT first_name ,  last_name ,  hire_date FROM employees WHERE department_id  =  (SELECT department_id FROM employees WHERE first_name  =  "Clara")
SQL: SELECT * FROM regions
Feedback: Need to find all the rows for managers .
Output: SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id WHERE T1.employee_id  =  T2.manager_id
SQL: SELECT Date_of_ceremony FROM music_festival GROUP BY Music_Festival HAVING Count ( * ) > 2
Feedback: Replace music festival with weeks on top , music festival table with volume table .
Output: SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume  =  T2.Volume_ID WHERE T2.Weeks_on_Top  >  2
SQL: SELECT T2.ClubName 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 T1.Fname = "Davis"
Feedback: Add last name equals Steven .
Output: SELECT 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  =  "Davis" AND t3.lname  =  "Steven"
SQL: SELECT T1.Employee_ID FROM Employees AS T1 EXCEPT SELECT T2.Destroyed_by_Employee_ID FROM Documents_to_be_Destroyed AS T2
Feedback: Replace destroyed by employee id with destruction authorised by employee id .
Output: SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
SQL: SELECT * FROM employees ORDER BY SALARY Asc LIMIT 2500
Feedback: Make sure salary in range of smallest salary to 2500 and remove 2nd step .
Output: SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500
SQL: SELECT name , age FROM Person ORDER BY gender Asc
Feedback: Should find only for male gender , replace gender with age .
Output: SELECT name FROM Person WHERE gender  =  'male' ORDER BY age
SQL: SELECT name FROM Person WHERE city = "new york city"
Feedback: There should be person friend table instead of person table .
Output: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend WHERE T1.city  =  'new york city'
SQL: SELECT T1.Fname , 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.DName = 520
Feedback: Replace department name with department number .
Output: SELECT T1.Fname ,  T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID  =  T2.FacID WHERE T2.DNO  =  520
SQL: SELECT T2.Volume FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume ORDER BY T1.Weeks_on_Top Desc LIMIT 1
Feedback: Replace volume with song .
Output: SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Student WHERE Fname = "Bootup Baltimore" AND Age > 18
Feedback: Replace first name with club name .
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  =  "Bootup Baltimore" AND t3.age  >  18
SQL: SELECT Lastname FROM Band GROUP BY Lastname ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Instead of last name in band table , it should be bandmate of performance table .
Output: SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1
SQL: SELECT name FROM Person EXCEPT SELECT name FROM Person
Feedback: Replace person table with person friend in step 2.
Output: SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend WHERE T1.job  =  'student'
SQL: SELECT FIRST_NAME , LAST_NAME FROM employees WHERE FIRST_NAME LIKE "z"
Feedback: Also find city of Location table .
Output: SELECT T1.first_name ,  T1.last_name ,  T3.city 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 WHERE T1.first_name LIKE '%z%'
SQL: SELECT Count ( * ) FROM Student WHERE Fname = "Tracy" AND LName = "Kim"
Feedback: Should count total number of clubs .
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  =  "Tracy" AND t3.lname  =  "Kim"
SQL: SELECT T1.FIRST_NAME , T1.LAST_NAME , T1.SALARY FROM employees AS T1 JOIN locations AS T2 WHERE T2.CITY = "London"
Feedback: Make sure employee working in departments .
Output: SELECT first_name ,  last_name ,  salary 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 WHERE  T3.city  =  'London'
SQL: SELECT Count ( DISTINCT Artist ) FROM artist
Feedback: Need to make sure artists have volumes .
Output: SELECT COUNT(DISTINCT Artist_ID) FROM volume
SQL: SELECT HIRE_DATE FROM employees WHERE FIRST_NAME ! = "M"
Feedback: There should be first name does not contains letter M instead of first name not equals M .
Output: SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%'
SQL: SELECT DEPARTMENT_NAME FROM departments GROUP BY DEPARTMENT_NAME HAVING Count ( * ) > = 1
Feedback: Need to make sure departments have one or more employee
Output: SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id
SQL: SELECT Count ( * ) FROM All_Documents WHERE Document_Type_Code = "CV"
Feedback: Also add "or document type code equals BK" at last .
Output: SELECT count(*) FROM All_documents WHERE document_type_code  =  "CV" OR document_type_code  =  "BK"
SQL: SELECT T2.Room FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T1.Rank = "Professor" AND T1.Building = "NEB"
Feedback: There should be Faculty's room instead of Department's room .
Output: SELECT Room FROM FACULTY WHERE Rank  =  "Professor" AND Building  =  "NEB"
SQL: SELECT City FROM city ORDER BY Regional_Population Desc LIMIT 1
Feedback: Replace city with gdp .
Output: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
SQL: SELECT Industry FROM Companies ORDER BY Industry Desc
Feedback: Replace "descending by Industry" with "descending by number of companies"
Output: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC
SQL: SELECT Document_ID FROM Documents WHERE Document_Description = "Government"
Feedback: Replace document description with budget type description .
Output: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code  =  T2.Budget_Type_code WHERE T2.budget_type_Description  =  "Government"
SQL: SELECT maintenance_contract_company_id , Count ( * ) FROM Maintenance_Contracts GROUP BY maintenance_contract_id
Feedback: Should find corresponding rows to each value of assets .
Output: SELECT count(*) ,  T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id  =  T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
SQL: SELECT EMAIL FROM employees WHERE SALARY > = 12000 AND SALARY < = 7000
Feedback: Make sure commission pct equals 0 and department id equals 50.
Output: SELECT email FROM employees WHERE commission_pct  =  "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50
SQL: SELECT * FROM jobs WHERE MIN_SALARY > 20000 INTERSECT SELECT JOB_TITLE FROM jobs WHERE MAX_SALARY > 12000
Feedback: Replace "greater than 20000" with "equals 12000" , step 2 should find all the rows
Output: SELECT * FROM  job_history AS T1 JOIN employees AS T2 ON T1.employee_id  =  T2.employee_id WHERE T2.salary  >=  12000
SQL: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.age > "engineer" GROUP BY T2.friend HAVING Count ( * ) > = 1
Feedback: The steps are completely unrelated to questions . Hence all the steps are defective .
Output: SELECT name FROM Person WHERE age  >  (SELECT min(age) FROM person WHERE job  =  'engineer') ORDER BY age
SQL: SELECT Title FROM Songs GROUP BY Title ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace title in songs table with type in vocals .
Output: SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid GROUP BY T1.songid ORDER BY count(*) DESC LIMIT 1
SQL: SELECT COUNTRY_ID , COUNTRY_NAME FROM countries
Feedback: Replace country id with employee id , make sure employees work in that country .
Output: SELECT 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 Author , Scores FROM submission
Feedback: Also find result of acceptance table instead of scores .
Output: SELECT T2.Author ,  T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID
SQL: SELECT Document_ID FROM Documents WHERE Document_Type_Code = "SF"
Feedback: Replace documents table with documents with expenses table , document type code with budget type code .
Output: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code  =  'SF'
SQL: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id ORDER BY T2.contract_end_date Asc LIMIT 1
Feedback: Replace contract end date with contract start date .
Output: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 1
SQL: SELECT Venue FROM match WHERE Competition = "Nanjing ( Jiangsu )" AND Score = "1994 FIFA World Cup qualification"
Feedback: Replace Nanjing(Jiangsu ) with 1994 FIFA World Cup qualification" and hosting city equals "Nanjing(Jiangsu )".
Output: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification"
SQL: SELECT Count ( * ) FROM Student
Feedback: Replace student table with course , find course whose credits greater than 2.
Output: SELECT count(*) FROM COURSE WHERE Credits  >  2
SQL: SELECT T2.Country , T3.Year FROM film AS T1 JOIN market AS T2 JOIN film_market_estimation AS T3 ON T1.Film_ID = T3.Film_ID AND T3.Market_ID = T2.Market_ID AND T1.Film_ID = T3.Film_ID WHERE T1.Title = "ET the Extra-Terrestrial"
Feedback: Remove title equals ET the Extra Terrestrial part .
Output: SELECT T2.Country ,  T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID
SQL: SELECT T2.Date_in_Locaton_To FROM Ref_Locations AS T1 JOIN Document_Locations AS T2 ON T1.Location_Code = T2.Location_Code WHERE T1.Location_Name = "Brazil" AND T1.Location_Name = "Robin CV"
Feedback: Replace reference locations with all documents , also find date in location from , replace location name with document name , remove location name equals Brazil
Output: SELECT T1.date_in_location_from ,  T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id  =  T2.document_id WHERE T2.document_name  =  "Robin CV"
SQL: SELECT Count ( DISTINCT Title ) FROM Songs
Feedback: Make sure they have shared vocals .
Output: SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE TYPE  =  "shared"
SQL: SELECT Host_City FROM hosting_city ORDER BY Year Desc
Feedback: Replace host city with venue , hosting city table with match table , year with date .
Output: SELECT venue FROM MATCH ORDER BY date DESC
SQL: SELECT Project_ID , Project_Details FROM Projects GROUP BY Project_ID HAVING Count ( * ) > 2
Feedback: Need to make sure project has more than two documents .
Output: SELECT T1.project_id ,  T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id HAVING count(*)  >  2
SQL: SELECT T2.Instrument FROM Band AS T1 JOIN Instruments AS T2 ON T1.Id = T2.BandmateId WHERE T1.Lastname = "Le Pop" AND T1.Lastname = "Heilo"
Feedback: Replace band with songs in step 1 , replace second "Lastname" with title in step 2.
Output: SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId JOIN Instruments AS T4 ON T4.songid  =  T3.songid AND T4.bandmateid  =  T2.id WHERE T2.lastname  =  "Heilo" AND T3.title  =  "Le Pop"
SQL: SELECT first_name , last_name FROM Maintenance_Engineers EXCEPT SELECT first_name , last_name FROM Maintenance_Engineers
Feedback: Make sure engineers did not visited to maintain the assets . remove step 2 and 3.
Output: SELECT first_name ,  last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)
SQL: SELECT name , Count ( * ) FROM Companies GROUP BY Industry
Feedback: Should find corresponding rows to each value of name .
Output: SELECT Industry ,  COUNT(*) FROM Companies GROUP BY Industry
SQL: SELECT FirstName , LastName FROM Reservations WHERE Rate > 0
Feedback: Make sure rate is greater than Rooms' base price .
Output: SELECT T1.firstname ,  T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T1.Rate - T2.basePrice  >  0
SQL: SELECT Count ( * ) FROM Ref_Document_Types
Feedback: Need to find summation of employees .
Output: SELECT count(*) FROM Employees
SQL: SELECT gender , Count ( * ) FROM Person GROUP BY gender
Feedback: Should ask to make sure that the age of person in below 40.
Output: SELECT count(*) ,  gender FROM Person WHERE age  <  40 GROUP BY gender
SQL: SELECT id , name , nationality FROM architect GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: There should be mill table instead of architect table in step 1.
Output: SELECT T1.id ,  T1.name ,  T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Fname FROM Student EXCEPT SELECT Fname FROM Student
Feedback: Replace first name with student id for both , step 2 student with enrolled in , find first name in step 3
Output: SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN)
SQL: SELECT T1.Day_Number , T2.Actual_Destruction_Date FROM Ref_Calendar AS T1 JOIN Documents_to_be_Destroyed AS T2 ON T1.Calendar_Date = T2.Planned_Destruction_Date
Feedback: Replace actual destruction date with date stored .
Output: SELECT T2.day_Number ,  T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored  =  T2.calendar_date
SQL: SELECT name FROM buildings GROUP BY name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace name of building table with company id of office locations in step 1.
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 ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT MIN_SALARY FROM jobs WHERE MAX_SALARY > 300
Feedback: Find job history's job id which are done more than once with duration more than 300 days
Output: SELECT job_id FROM job_history WHERE end_date - start_date  > 300 GROUP BY job_id HAVING COUNT(*) >= 2
SQL: SELECT EMPLOYEE_ID , FIRST_NAME , LAST_NAME FROM employees GROUP BY EMPLOYEE_ID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace employee id with salary , step 2:Replace employee id with department id and also find salary .
Output: SELECT first_name ,   last_name ,   salary ,  department_id ,  MAX(salary) FROM employees GROUP BY department_id
SQL: SELECT DISTINCT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id WHERE T2.length_feet > 80
Feedback: Replace architect's name and length feet with mill's name and length meters respectively .
Output: SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id  =  T2.id JOIN bridge AS T3 ON T3.architect_id  =  T2.id WHERE T3.length_meters  >  80
SQL: SELECT T1.Title FROM Songs AS T1 WHERE T1.SongId NOT IN ( SELECT T2.SongId FROM Tracklists AS T2 )
Feedback: Make sure song does not contain lead vocal .
Output: SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid WHERE TYPE  =  "lead"
SQL: SELECT Count ( * ) FROM workshop
Feedback: There should be submission table instead of workshop table .
Output: SELECT count(*) FROM submission
SQL: SELECT T1.roomName FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room ORDER BY T2.Adults Desc LIMIT 1
Feedback: Replace adults with max occupancy .
Output: SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1
SQL: SELECT Sum ( Kids ) FROM Reservations
Feedback: find the number of raws of rooms which are not reserved in this inn .
Output: SELECT count(*) FROM Rooms
SQL: SELECT T3.EMPLOYEE_ID , T2.JOB_TITLE FROM departments AS T1 JOIN jobs AS T2 JOIN employees AS T3 ON T1.DEPARTMENT_ID = T3.DEPARTMENT_ID AND T3.JOB_ID = T2.JOB_ID AND T1.DEPARTMENT_ID = T3.DEPARTMENT_ID WHERE T1.DEPARTMENT_NAME = 80
Feedback: Replace department name with department id .
Output: SELECT T1.employee_id ,  T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id  =  T2.job_id WHERE T1.department_id = 80
SQL: SELECT T1.Title FROM Songs AS T1 WHERE T1.SongId NOT IN ( SELECT T2.SongId FROM Tracklists AS T2 )
Feedback: Make sure that songs does not have a back vocal .
Output: SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid WHERE TYPE  =  "back"
SQL: SELECT Count ( * ) FROM Songs WHERE Title = "Badlands"
Feedback: Also , need to find the different instrument instruments from instrument instruments table .
Output: SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Badlands"
SQL: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > 8000 OR T1.MAX_SALARY < 12000
Feedback: Replace max salary with salary , ör"with änd " , which commission pct not null or department id not 40.
Output: SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != "null" OR  department_id != 40
SQL: SELECT Count ( * ) FROM flight WHERE Pilot ! = "Thompson"
Feedback: Need to count airports .
Output: SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot  =  'Thompson' )
SQL: SELECT T1.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: Need to find scientist not working on a project with maximum hours
Output: SELECT name FROM scientists EXCEPT SELECT 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 T1.EMPLOYEE_ID FROM employees AS T1 WHERE T1.SALARY > ( SELECT Avg ( T2.MIN_SALARY ) FROM jobs AS T2 )
Feedback: Replace min salary with salary .
Output: SELECT employee_id FROM employees WHERE salary  >  (SELECT AVG(salary) FROM employees)
SQL: SELECT T2.problem_id FROM Product AS T1 JOIN Problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem" AND T2.date_problem_closed > 1995
Feedback: Replace date problem closed with date problem reported .
Output: SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "voluptatem" AND T1.date_problem_reported > "1995"
SQL: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City ORDER BY T2.Year Desc LIMIT 1
Feedback: Replace city with city id .
Output: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Club WHERE ClubName = "Tennis Club"
Feedback: Make sure to find the total number of members in member of club table .
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  =  "Tennis Club"
SQL: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008 UNION SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008
Feedback: Make sure temperature is greater in February than June or city served as host cities
Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Feb  >  T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city
SQL: SELECT Document_Type_Name , Document_Type_Description FROM Ref_Document_Types
Feedback: Make sure document type code equals RV .
Output: SELECT document_type_name ,  document_type_description FROM Ref_document_types WHERE document_type_code  =  "RV"
SQL: SELECT T1.City FROM city AS T1 JOIN temperature AS T2 ON T1.City_ID = T2.City_ID GROUP BY T2.City_ID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace temperature table with hosting city in both and city id with host city .
Output: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Author , Count ( * ) FROM submission GROUP BY Author
Feedback: Should have corresponding rows to each value of workshop id of acceptance table .
Output: SELECT T2.Author ,  COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author
SQL: SELECT DISTINCT T1.name , T1.nationality FROM architect AS T1 WHERE T1.id NOT IN ( SELECT T2.architect_id FROM mill AS T2 )
Feedback: Remove "not one of the " part .
Output: SELECT DISTINCT T1.name ,  T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id  =  T2.architect_id
SQL: SELECT T1.FIRST_NAME , T1.LAST_NAME FROM employees AS T1 JOIN locations AS T2 WHERE T2.CITY = "Clara" AND T1.LAST_NAME = "Clara"
Feedback: Also find hire date , make sure only find for departments with Clara , and don't include Clara .
Output: SELECT first_name ,  last_name ,  hire_date FROM employees WHERE department_id  =  ( SELECT department_id FROM employees WHERE first_name  =  "Clara") AND first_name != "Clara"
SQL: SELECT T2.Location_Code FROM Ref_Locations AS T1 JOIN Document_Locations AS T2 ON T1.Location_Code = T2.Location_Code GROUP BY T1.Location_Code HAVING Count ( * ) > = 3
Feedback: replace Ref Locations's location code with Document Locations's location code
Output: SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*)  >=  3
SQL: SELECT T2.problem_id FROM Staff AS T1 JOIN Problems AS T2 ON T1.staff_id = T2.closure_authorised_by_staff_id WHERE T1.staff_first_name = "Lysanne" AND T1.staff_last_name = "Turcotte"
Feedback: Need to find the problem id which are reported prior to problem id reported in step 2.
Output: SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported  <  ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Lysanne" AND T4.staff_last_name = "Turcotte" )
SQL: SELECT Document_ID , Document_Description FROM Documents
Feedback: Replace document id with statement id , document description with statement details , documents table with statements table .
Output: SELECT STATEMENT_ID ,  statement_details FROM Statements
SQL: SELECT Famous_Title FROM artist EXCEPT SELECT Famous_Title FROM artist
Feedback: Make sure artists does not contain volume .
Output: SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)
SQL: SELECT T2.staff_first_name , T2.staff_last_name FROM Product AS T1 JOIN Staff AS T2 JOIN Problems AS T3 ON T1.product_id = T3.product_id AND T3.closure_authorised_by_staff_id = T2.staff_id WHERE T1.product_name ! = "aut"
Feedback: Also , need to find the problems reported for product name equals rem .
Output: SELECT T3.staff_first_name ,  T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "rem" EXCEPT SELECT T3.staff_first_name ,  T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "aut"
SQL: SELECT DISTINCT company_type FROM Third_Party_Companies
Feedback: Replace company type of third party companies table with asset model of assets .
Output: SELECT DISTINCT asset_model FROM Assets
SQL: SELECT Fname , LName FROM Student WHERE Major = 140
Feedback: Make sure to find Minor in's room equals 140 instead of instructor equals 140 .
Output: SELECT T2.Fname ,  T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID  =  T2.StuID WHERE T1.DNO  =  140
SQL: SELECT Location_Code FROM Ref_Locations GROUP BY Location_Code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: step 1: Replace reference locations table with document locations table .
Output: SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Document_Type_Code FROM Ref_Document_Types GROUP BY Document_Type_Code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace documents with expenses table with documents table for both .
Output: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1
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 = 2012
Feedback: Replace songs 's title with albums ' title .
Output: SELECT * FROM Albums WHERE YEAR  =  2012
SQL: SELECT Count ( * ) FROM Ref_Document_Types
Feedback: Replace reference document types table with roles table , Make sure to Find the total number all roles .
Output: SELECT count(*) FROM ROLES
SQL: SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year < = 2008 UNION SELECT T1.City FROM city AS T1 JOIN hosting_city AS T2 ON T1.City_ID = T2.Host_City WHERE T2.Year = 2008
Feedback: Make sure temperature's mar less than jul or greater than oct for a city
Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul OR T2.Mar  >  T2.Oct
SQL: SELECT T1.Document_Type_Name , T1.Document_Type_Name , T1.Document_Type_Description FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code WHERE T2.Document_Name = "King Book" OR T2.Document_Name = "Noel CV"
Feedback: Replace first document type name with document type code .
Output: SELECT document_type_code ,  document_name ,  document_description FROM Documents WHERE document_name  =  'Noel CV' OR document_name  =  'King Book'
SQL: SELECT Max ( T2.length_feet ) FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id WHERE T1.name = "Frank Lloyd Wright"
Feedback: Replace length feet with length meters , find architect's names for bridge , remove whole last part of step 2.
Output: SELECT max(T1.length_meters) ,  T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id  =  T2.id
SQL: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.age > 40 INTERSECT SELECT T1.name FROM Person AS T1 WHERE T1.age < 30
Feedback: step 2: find person name . step 2 and 3: Need to find person's friend age instead of person .
Output: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age  >  40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age  <  30)