niryuu/sni-each-converted huggingface dataset:
SQL: SELECT Count ( DISTINCT T2.Committee ) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District WHERE T1.Population > 50000
Feedback: Replace committee with delegate of election table .
Output: SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  >  50000
SQL: SELECT customer_name FROM Customers GROUP BY customer_name HAVING Count ( * ) > = 3
Feedback: Need to make sure customers have bought at least three distinct products .
Output: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id)  >=  3
SQL: SELECT Max ( Sheep_and_Goats ) , Min ( Sheep_and_Goats ) FROM farm
Feedback: Replace sheep and goats with cows .
Output: SELECT max(Cows) ,  min(Cows) FROM farm
SQL: SELECT DISTINCT Status FROM city ORDER BY Area_km_2 Asc
Feedback: Need to find frequency instead of Area km 2.
Output: SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC
SQL: SELECT T1.Comptroller FROM party AS T1 JOIN election AS T2 ON T1.Party_ID = T2.Party WHERE T2.Committee = 2 OR T2.Committee = 1
Feedback: Replace committee with district for both and make sure they are associated delegates .
Output: SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1 OR T1.District  =  2
SQL: SELECT text FROM tweets WHERE text = "intern"
Feedback: Make sure topic of text is intern .
Output: SELECT text FROM tweets WHERE text LIKE '%intern%'
SQL: SELECT DISTINCT Name FROM Physician
Feedback: Replace physician physician with patient patient , need to make sure they made an appointment appointment .
Output: SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn
SQL: SELECT Count ( * ) FROM follows
Feedback: Should find tweets .
Output: SELECT count(*) FROM tweets
SQL: SELECT Delegate FROM election WHERE Committee = 1
Feedback: Replace committee with district .
Output: SELECT Delegate FROM election WHERE District  =  1
SQL: SELECT T1.first_name FROM actor AS T1 JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Need to make sure the actors are most popular .
Output: SELECT first_name FROM actor GROUP BY first_name ORDER BY count(*) DESC LIMIT 1
SQL: SELECT DISTINCT customer_name FROM Customers ORDER BY customer_id Asc
Feedback: Also need to make sure Customer Orders's order status code equals pending for customers .
Output: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "Pending" ORDER BY T2.customer_id
SQL: SELECT T2.Name FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP WHERE T1.Name = "Surgery" INTERSECT SELECT T2.Name FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP WHERE T1.Name = "Psychiatry"
Feedback: Need to find Physician's name associated with both Surgery and Psychiatry block floor . Show their names .
Output: SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Psychiatry'
SQL: SELECT name FROM aircraft GROUP BY name HAVING Count ( * ) > = 2
Feedback: Replace distance with airline id in step 1 , aircraft table with flight table in step 1.
Output: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid HAVING count(*)  >= 2
SQL: SELECT Avg ( price ) FROM flight WHERE destination = "Los Angeles"
Feedback: Make sure whose employee id equals LA , arrival date equals Honolulu instead of Los Angeles .
Output: SELECT avg(price) FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"
SQL: SELECT T1.Name FROM Physician AS T1 JOIN Department AS T2 ON T1.EmployeeID = T2.Head WHERE T2.Name = "Psychiatry" OR T2.Name = "Surgery"
Feedback: Make sure that the Physicians need to affiliated with relevant department department .
Output: SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Surgery' OR T3.name  =  'Psychiatry'
SQL: SELECT T2.player_name FROM Player_Attributes AS T1 JOIN Player AS T2 ON T1.player_fifa_api_id = T2.player_fifa_api_id WHERE T1.overall_rating > 80
Feedback: Also find number of right footed and left footed Players .
Output: SELECT preferred_foot ,  count(*) FROM Player_Attributes WHERE overall_rating  >  80 GROUP BY preferred_foot
SQL: SELECT Institution , Count ( * ) FROM Institution GROUP BY Institution
Feedback: Should find corresponding rows to number of proteins .
Output: SELECT T1.institution ,  count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id GROUP BY T1.institution_id
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 ORDER BY T2.Name Desc LIMIT 1
Feedback: Replace Nurse's name with Prescribes's dose .
Output: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1
SQL: SELECT Party , Count ( * ) FROM party GROUP BY Party
Feedback: Should corresponds to each value of delegates from that party .
Output: SELECT T2.Party ,  COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID GROUP BY T1.Party
SQL: SELECT Count ( * ) FROM channel WHERE Name = "Night"
Feedback: Replace channel table with broadcast's program id , and name with time of day . Make sure find a different programs .
Output: SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day  =  'Night'
SQL: SELECT County_name , Count ( * ) FROM county GROUP BY County_name
Feedback: Should find the number of corresponding rows of delegate in election table for each county .
Output: SELECT T1.County_name ,  COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District GROUP BY T1.County_id
SQL: SELECT name FROM club ORDER BY Start_year Desc LIMIT 1
Feedback: There should be smallest value instead of largest value .
Output: SELECT name FROM club ORDER BY Start_year ASC
SQL: SELECT T1.Name FROM wrestler AS T1 JOIN Elimination AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID GROUP BY T2.Wrestler_ID ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Replace wrestler id with days held .
Output: SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1
SQL: SELECT T1.Owner FROM program AS T1 JOIN broadcast AS T2 ON T1.Program_ID = T2.Program_ID WHERE T2.Time_of_day = "Morning" INTERSECT SELECT T3.Owner FROM channel AS T3 JOIN broadcast AS T2 ON T3.Channel_ID = T2.Channel_ID WHERE T2.Time_of_day = "Night"
Feedback: Replace channel with program in step 4.
Output: SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Morning" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Night"
SQL: SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.destination ORDER BY Count ( * ) Asc LIMIT 1
Feedback: replace name with destination . only use flight table
Output: SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
SQL: SELECT * FROM county
Feedback: Replace county table with election table .
Output: SELECT * FROM election
SQL: SELECT T1.Name FROM Physician AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.Physician GROUP BY T2.Physician ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace appointment appointment table with procedures procedures , physician physician with cost in step 2 , Make sure find Physician's name in step 3.
Output: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment ORDER BY T3.cost DESC LIMIT 1
SQL: SELECT T1.Name FROM team AS T1 JOIN match_season AS T2 ON T1.Team_id = T2.Team GROUP BY T2.College HAVING Count ( * ) > = 2
Feedback: remove team table , replace name with college and order should be in descending .
Output: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC
SQL: SELECT Count ( * ) FROM Appointment WHERE ExaminationRoom = 112
Feedback: Replace appointment appointment with stay stay , examination room with room room , count number of patients staying in it .
Output: SELECT count(patient) FROM stay WHERE room  =  112
SQL: SELECT name FROM user_profiles WHERE followers > ( SELECT Max ( followers ) FROM user_profiles WHERE name = "Tyler Swift" )
Feedback: Remove maximum and find total number of followers in step 1.
Output: SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 WHERE T1.name  =  'Tyler Swift')
SQL: SELECT name FROM category
Feedback: Make sure to find it for film's title equals HUNGER ROOF .
Output: SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id  =  T2.category_id JOIN film AS T3 ON T2.film_id  =  T3.film_id WHERE T3.title  =  'HUNGER ROOF'
SQL: SELECT T1.Name , T1.Phone FROM Patient AS T1 JOIN Appointment AS T2 ON T1.SSN = T2.Patient GROUP BY T2.Physician HAVING Count ( * ) > 1
Feedback: Replace physician physician with appointment id .
Output: SELECT name ,  phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn GROUP BY T1.patient HAVING count(*)  >  1
SQL: SELECT T1.arrival_date , T1.departure_date FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Los Angeles"
Feedback: Replace name with origin , also make sure destination equals Honolulu .
Output: SELECT departure_date ,  arrival_date FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"
SQL: SELECT Count ( * ) FROM Patient AS T1 WHERE T1.SSN NOT IN ( SELECT T2.Medication FROM Prescribes AS T2 )
Feedback: Replace medication medication of prescribes with name equals Procrastin X of medication medication and remove "SSN".
Output: SELECT count(*) FROM patient WHERE SSN NOT IN ( SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication  =  T2.Code WHERE T2.name  =  'Procrastin-X' )
SQL: SELECT catalog_name FROM Catalogs
Feedback: Replace catalog name of catalogs table with catalog entry name of catalog contents .
Output: SELECT distinct(catalog_entry_name) FROM catalog_contents
SQL: SELECT T1.catalog_name FROM Catalogs AS T1 JOIN Catalog_Structure AS T2 ON T1.catalog_id = T2.catalog_id JOIN Catalog_Contents AS T3 ON T2.catalog_level_number = T3.catalog_level_number WHERE T3.price_in_pounds = 8
Feedback: Replace catalog name with catalog entry name , and price in pounds with catalog level number .
Output: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.catalog_level_number  =  "8"
SQL: SELECT Type FROM Institution WHERE Enrollment > 1000 INTERSECT SELECT Type FROM Institution WHERE Enrollment < 1990
Feedback: enrollment greater than or equals 1000 step1 , founded greater than 1990 instead enrollment less than 1990 step 2.
Output: SELECT TYPE FROM institution WHERE founded  >  1990 AND enrollment  >=  1000
SQL: SELECT EmployeeID FROM Nurse
Feedback: Need to find the Physician's employee id and department department íd along with primary affiliation .
Output: SELECT physician ,  department FROM affiliated_with WHERE primaryaffiliation  =  1
SQL: SELECT T1.Attorney_General FROM party AS T1 JOIN election AS T2 ON T1.Party_ID = T2.Party GROUP BY T2.District ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Need to find governor elected for highest times .
Output: SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT T2.name , T1.uid FROM tweets AS T1 JOIN user_profiles AS T2 ON T1.uid = T2.uid GROUP BY T1.uid HAVING Count ( * ) > 2
Feedback: In step 3 , replace tweets's email with user profiles partition id and replace "greater" with "less".
Output: SELECT T1.name ,  T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  <  2
SQL: SELECT T1.Name , T2.born_state , T1.Num_Employees FROM department AS T1 JOIN head AS T2 JOIN management AS T3 ON T1.Department_ID = T3.department_ID AND T3.head_ID = T2.head_ID ORDER BY T2.age Asc
Feedback: Replace name with name , num employees with age .
Output: SELECT name ,  born_state ,  age FROM head ORDER BY age
SQL: SELECT T2.Name , T1.Name FROM Physician AS T1 JOIN Medication AS T2 JOIN Prescribes AS T3 ON T1.EmployeeID = T3.Physician AND T3.Medication = T2.Code
Feedback: Replace prescribes table and Medication's name with department department table and Department's name respectively , remove medication medication table .
Output: SELECT T1.name ,  T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T2.PrimaryAffiliation  =  1
SQL: SELECT price , distance FROM flight ORDER BY price Desc LIMIT 1
Feedback: Replace airline id with airline id .
Output: SELECT flno ,  distance FROM Flight ORDER BY price DESC LIMIT 1
SQL: SELECT Avg ( Silver ) , Avg ( Gold ) FROM club_rank
Feedback: no need to find average of silver .
Output: SELECT avg(Gold) FROM club_rank
SQL: SELECT supplier_name FROM Suppliers GROUP BY supplier_name HAVING Count ( * ) > = 2
Feedback: In step 1 , replace supplier name in suppliers with distinct customer id of customer orders , step 2 , replace supplier namein suppliers with product name of products .
Output: SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id  =  T2.order_id JOIN products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id)  >=  2
SQL: SELECT Count ( * ) FROM mountain AS T1 WHERE T1.id NOT IN ( SELECT T2.mountain_id FROM photos AS T2 )
Feedback: Replace mountain id with camera lens id in step 1 , mountain with camera lens for both in step 2.
Output: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )
SQL: SELECT Count ( * ) FROM member
Feedback: Replace member table with performance table .
Output: SELECT count(*) FROM performance
SQL: SELECT * FROM department GROUP BY Department_ID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace department id with creation .
Output: SELECT creation FROM department GROUP BY creation ORDER BY count(*) DESC LIMIT 1
SQL: SELECT DISTINCT T2.Season , T1.Name , T1.Name FROM team AS T1 JOIN match_season AS T2 ON T1.Team_id = T2.Team
Feedback: Replace 2nd name with player .
Output: SELECT T1.Season ,  T1.Player ,  T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id
SQL: SELECT aid , name FROM aircraft
Feedback: Make sure aircraft should correspond to maximum distance .
Output: SELECT aid ,  name FROM Aircraft ORDER BY distance DESC LIMIT 1
SQL: SELECT T1.first_name , T1.last_name FROM actor AS T1 JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace film actor's actor id with actor's first name and last name .
Output: SELECT first_name ,  last_name FROM actor GROUP BY first_name ,  last_name ORDER BY count(*) DESC LIMIT 1
SQL: SELECT name , Count ( * ) FROM photos GROUP BY camera_lens_id ORDER BY Count ( * ) Asc
Feedback: Replace camera lens id with id in step 1 , and camera lens id in photos table with name in camera lens .
Output: SELECT T1.name ,  count(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id  =  T2.camera_lens_id GROUP BY T1.id ORDER BY count(*)
SQL: SELECT T1.Party FROM party AS T1 WHERE T1.Comptroller = "Appropriations" INTERSECT SELECT T1.Party FROM party AS T1 JOIN election AS T2 ON T1.Party_ID = T2.Party WHERE T2.Committee = "Economic Matters"
Feedback: In step 1 , replace comptroller with committee , interchange step1 and step 2. In step 3 , replace "step 2" word with step1.
Output: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.Committee  =  "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.Committee  =  "Economic Matters"
SQL: SELECT catalog_entry_name FROM Catalog_Contents WHERE length > 5 OR length < 3
Feedback: Replace 3 with 5 , replace 5 with 3.
Output: SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH  <  3 OR width  >  5
SQL: SELECT Max ( followers ) , Avg ( followers ) FROM user_profiles
Feedback: Replace average followers with summation of followers .
Output: SELECT max(followers) ,  sum(followers) FROM user_profiles
SQL: SELECT T2.Name FROM program AS T1 JOIN channel AS T2 JOIN broadcast AS T3 ON T1.Program_ID = T3.Program_ID AND T3.Channel_ID = T2.Channel_ID ORDER BY T1.Launch Desc LIMIT 1
Feedback: Replace channel's name with program's name .
Output: SELECT name FROM program ORDER BY launch DESC LIMIT 1
SQL: SELECT Country_name , Count ( * ) FROM country GROUP BY Country_name
Feedback: Should find number of players belonging to each country .
Output: SELECT Country_name ,  COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country GROUP BY T1.Country_name
SQL: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District WHERE T1.Population > 100000
Feedback: Replace population greater than 100000" with population smaller than 100000".
Output: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  <  100000
SQL: SELECT name FROM photos WHERE name LIKE "Digital"
Feedback: Replace photos table with camera lens table .
Output: SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
SQL: SELECT T1.Name , T1.Position FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP WHERE T2.Name = "X"
Feedback: Replace Patient's name and Patienttable with Medication's brand and medication medication table respectively , physician physician had prescribed medication medication .
Output: SELECT DISTINCT T1.name ,  T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand  =  "X"
SQL: SELECT height FROM Catalog_Contents ORDER BY price_in_dollars Asc LIMIT 1
Feedback: Replace height with catalog level name , catalog contents with catalog structure .
Output: SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number  =  t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1
SQL: SELECT Count ( * ) FROM follows
Feedback: Replace follows table with user profiles table .
Output: SELECT count(*) FROM user_profiles
SQL: SELECT Lieutenant_Governor FROM party WHERE Party = "Democratic" AND Comptroller = "Carl McCall"
Feedback: Should also find comptroller ahead of lieutenant governor , remove "and comptroller equals Carl McCall" part .
Output: SELECT Lieutenant_Governor ,  Comptroller FROM party WHERE Party  =  "Democratic"
SQL: SELECT T2.product_id FROM Products AS T1 JOIN Product_Suppliers AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id HAVING Avg ( T1.product_price ) > 2
Feedback: Replace product suppliers with products table , step 3:corresponding value is greater than step 2 and Make sure whose supplier id is 2.
Output: SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  2 AND T2.product_price  >  (SELECT avg(product_price) FROM products)
SQL: SELECT donator_name FROM endowment WHERE amount < 9
Feedback: Replace "less than" with "greater than or equals".
Output: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount  <  9
SQL: SELECT T1.rating , Max ( T1.rental_rate ) FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace inventory's film id with film's rental rate for step 2 and 3 , replace rental rate with title .
Output: SELECT title ,  rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1
SQL: SELECT Avg ( Sheep_and_Goats ) FROM farm WHERE Total_Horses > 5000
Feedback: Replace sheep and goats with working horses .
Output: SELECT avg(Working_Horses) FROM farm WHERE Total_Horses  >  5000
SQL: SELECT district FROM address WHERE address = 1
Feedback: Replace district with address , address with store's store id .
Output: SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE store_id  =  1
SQL: SELECT Pigs , Sum ( Sheep_and_Goats ) FROM farm GROUP BY Farm_ID ORDER BY Sum ( Total_Horses ) Asc
Feedback: Replace sheep and goats with total horses . Remove "summation" word .
Output: SELECT Total_Horses FROM farm ORDER BY Total_Horses ASC
SQL: SELECT name , name FROM Country
Feedback: Remove one of the "name" , should also find League's name ahead .
Output: SELECT T1.name ,  T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id  =  T2.country_id
SQL: SELECT T3.Player FROM team AS T1 JOIN match_season AS T2 ON T2.Team = T1.Team_id JOIN player AS T3 ON T1.Team_id = T3.Team ORDER BY T2.Season Asc
Feedback: Replace player's player and season with match season's player and college respectively .
Output: SELECT player FROM match_season ORDER BY College ASC
SQL: SELECT County_name FROM county GROUP BY County_name HAVING Count ( * ) > = 2
Feedback: Replace county name in county table with delegate of election table in step 1.
Output: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District GROUP BY T1.County_id HAVING COUNT(*)  >=  2
SQL: SELECT T1.staff_id , T1.staff_gender FROM Staff AS T1 JOIN Departments AS T2 JOIN Staff_Department_Assignments AS T3 ON T1.staff_id = T3.staff_id AND T3.department_id = T2.department_id WHERE T2.department_name = "Department Manager"
Feedback: Replace department name with job title code .
Output: SELECT T1.staff_id ,  T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Department Manager"
SQL: SELECT Sum ( Share_in_percent ) FROM channel
Feedback: Make sure whose owner equals CCTV .
Output: SELECT sum(Share_in_percent) FROM channel WHERE OWNER  =  'CCTV'
SQL: SELECT T1.Name FROM team AS T1 JOIN match_season AS T2 ON T1.Team_id = T2.Team GROUP BY T2.College HAVING Count ( * ) > = 2
Feedback: Should make sure college has two or more players .
Output: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2
SQL: SELECT DISTINCT Committee FROM election
Feedback: Replace committee with district .
Output: SELECT DISTINCT District FROM election
SQL: SELECT name FROM aircraft GROUP BY name ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Replace name in aircraft table with employee id in certificate table .
Output: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1
SQL: SELECT payment_date FROM payment
Feedback: Should find for the smallest value of payment date .
Output: SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1
SQL: SELECT Reign FROM wrestler WHERE Days_held > 50
Feedback: Replace reign of wrestler table with time of elimination table .
Output: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID WHERE T2.Days_held  >  50
SQL: SELECT DISTINCT T1.Creation FROM department AS T1 JOIN management AS T2 ON T1.Department_ID = T2.department_ID WHERE T2.temporary_acting = "Alabama"
Feedback: Replace temporary acting with born state , make sure only to find for secretary managing department .
Output: SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id  =  T2.department_id JOIN head AS T3 ON T2.head_id  =  T3.head_id WHERE T3.born_state  =  'Alabama'
SQL: SELECT name FROM photos GROUP BY name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Should make sure to find camera lens's name only for mountainous photos
Output: SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT name FROM language WHERE name = "AIRPORT POLLOCK"
Feedback: Replace 2nd name with title .
Output: SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id  =  T2.language_id WHERE T1.title  =  'AIRPORT POLLOCK'
SQL: SELECT Physician FROM Trained_In ORDER BY CertificationDate Desc LIMIT 1
Feedback: Replace physician physician with patient patient , trained in with stay stay , certification date with stay start , find for room room equals 111.
Output: SELECT patient FROM stay WHERE room  =  111 ORDER BY staystart DESC LIMIT 1
SQL: SELECT Avg ( overall_rating ) FROM Player_Attributes
Feedback: Make sure find for preferred foot right and left .
Output: SELECT preferred_foot ,  avg(overall_rating) FROM Player_Attributes GROUP BY preferred_foot
SQL: SELECT DISTINCT T1.customer_id FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_date < "Cancelled"
Feedback: Remove last part and make sure orders are reordered after for those order status code equals Cancelled .
Output: SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date  >  (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code  =  "Cancelled")
SQL: SELECT T1.flno , T1.origin , T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid ORDER BY T1.destination Asc
Feedback: Replace name with destination , replace destination with origin .
Output: SELECT flno ,  origin ,  destination FROM Flight ORDER BY origin
SQL: SELECT T1.id FROM Player AS T1 WHERE T1.height > 180 INTERSECT SELECT T2.player_api_id FROM Player_Attributes AS T2 JOIN Player AS T1 ON T2.player_fifa_api_id = T1.player_fifa_api_id WHERE T1.height < 85
Feedback: height greater than or equals to 180 , Replace Player Attributes's player api id with Player's id , overall rating should be greater than 85.
Output: SELECT player_api_id FROM Player WHERE height  >=  180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating  >  85
SQL: SELECT Enrollment FROM School WHERE Mascot = "Glenn"
Feedback: Make sure to find number of rows of endowment table and replace mascot with school name .
Output: SELECT count(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  "Glenn"
SQL: SELECT T1.Name FROM department AS T1 JOIN head AS T2 JOIN management AS T3 ON T1.Department_ID = T3.department_ID AND T3.head_ID = T2.head_ID WHERE T2.born_state ! = "California"
Feedback: Make sure to find name of head table .
Output: SELECT name FROM head WHERE born_state != 'California'
SQL: SELECT T1.School_name , T2.total_budget_percent_budgeted , T2.Year FROM School AS T1 JOIN budget AS T2 ON T1.School_id = T2.School_id WHERE T2.Year > 2002
Feedback: Replace total budget percent budgeted with budgeted , 1st year with invested , make sure year greater than or equals to 2002.
Output: SELECT T2.school_name ,  T1.budgeted ,  T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.year  >=  2002
SQL: SELECT Party FROM party WHERE Comptroller = 1
Feedback: Replace comptroller with district and make sure they were served as governor .
Output: SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1
SQL: SELECT first_name , last_name , customer_id FROM customer GROUP BY customer_id HAVING Count ( * ) > = 1
Feedback: Replace customer table with payment table in step 1 and make sure customer has spent lowest amount .
Output: SELECT T1.first_name ,  T1.last_name ,  T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY sum(amount) ASC LIMIT 1
SQL: SELECT * FROM Prescribes AS T1 WHERE T1.Physician = "John Wen" EXCEPT SELECT T3.Name FROM Procedures AS T2 JOIN Nurse AS T3 JOIN Undergoes AS T4 ON T2.Code = T4.Procedures AND T4.AssistingNurse = T3.EmployeeID WHERE T2.Cost > 1000
Feedback: Make sure to find block code name for which John Wen is not Trained in .
Output: SELECT name FROM procedures WHERE cost  >  1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
SQL: SELECT Name , Event FROM wrestler
Feedback: Remove event , and instead find elimination move of elimination table .
Output: SELECT T2.Name ,  T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID
SQL: SELECT Max ( customer_phone ) , Min ( customer_phone ) FROM Customers
Feedback: Replace customer phone with customer code .
Output: SELECT max(customer_code) ,  min(customer_code) FROM Customers
SQL: SELECT Name FROM channel
Feedback: Make sure time of day equals Morning .
Output: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Morning'
SQL: SELECT player_name , birthday FROM Player GROUP BY birthday ORDER BY Count ( * ) Desc LIMIT 5
Feedback: Replace birthday with potential and player with player attributes in step 1.
Output: SELECT DISTINCT T1.player_name ,  T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id  =  T2.player_api_id ORDER BY potential DESC LIMIT 5
SQL: SELECT player_name FROM Player ORDER BY height Desc LIMIT 1
Feedback: Replace height with Player Attributes's dribbling .
Output: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling  =  ( SELECT max(overall_rating) FROM Player_Attributes)
SQL: SELECT T1.Name FROM Patient AS T1 JOIN Room AS T2 JOIN Stay AS T3 ON T1.SSN = T3.Patient AND T3.Room = T2.RoomNumber WHERE T2.BlockFloor = 111
Feedback: Replace room room with undergoes , block floor with roomnumber , make sure patient patient are present in undergoes table .
Output: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay  =  T3.StayID WHERE T3.room  =  111
SQL: SELECT Count ( * ) FROM department
Feedback: Need to find distinct temporary acting status in management table .
Output: SELECT count(DISTINCT temporary_acting) FROM management
SQL: SELECT T1.first_name FROM customer AS T1 EXCEPT SELECT T1.first_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.return_date > "2005-08-23 02:06:01"
Feedback: Replace return date with rental date .
Output: SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date  >  '2005-08-23 02:06:01' )
SQL: SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid ORDER BY T1.price Desc LIMIT 3
Feedback: Replace "descending by price" with "ascending by distance".
Output: SELECT name FROM Aircraft ORDER BY distance LIMIT 3
SQL: SELECT T2.player_name FROM Player_Attributes AS T1 JOIN Player AS T2 ON T1.player_fifa_api_id = T2.player_fifa_api_id WHERE T1.overall_rating > 90
Feedback: Replace overall rating with crossing and make sure preferred foot equals right .
Output: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing  >  90 AND T2.preferred_foot  =  "right"
SQL: SELECT DISTINCT age FROM head
Feedback: Make sure to find only for the one with acting .
Output: SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id  =  T2.head_id WHERE T2.temporary_acting  =  'Yes'
SQL: SELECT T1.Name FROM Patient AS T1 JOIN Appointment AS T2 ON T1.SSN = T2.Patient WHERE T2.ExaminationRoom = 111
Feedback: Replace patient patient , appointment appointment and examination room with medication medication , stay stay and room room respectively .
Output: SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient  =  T2.SSN JOIN Prescribes AS T3 ON T3.Patient  =  T2.SSN JOIN Medication AS T4 ON T3.Medication  =  T4.Code WHERE room  =  111
SQL: SELECT DISTINCT Year FROM party WHERE Comptroller = "Eliot Spitzer"
Feedback: Replace comptroller with governor .
Output: SELECT DISTINCT YEAR FROM party WHERE Governor  =  "Eliot Spitzer"
SQL: SELECT T1.Name FROM editor AS T1 WHERE T1.Editor_ID NOT IN ( SELECT T2.Editor_ID FROM journal_committee AS T2 WHERE T2.Journal_ID = 13 )
Feedback: Remove "for which journal id equals 13" part from step 1.
Output: SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee)
SQL: SELECT customer_name , customer_id FROM Customers WHERE customer_address = "TN"
Feedback: Replace customer address equals TN with customer address contains TN
Output: SELECT customer_name ,  customer_id FROM customers WHERE customer_address LIKE "%TN%"
SQL: SELECT first_name , last_name FROM actor WHERE last_update > 30
Feedback: Remove last update greater than 30" , make sure actors have work in more than 30 films .
Output: SELECT T2.first_name ,  T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id  =  T2.actor_id GROUP BY T2.actor_id HAVING count(*)  >  30
SQL: SELECT T1.title , T2.actor_id , T1.description FROM film AS T1 JOIN film_actor AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace actor id with film id .
Output: SELECT T2.title ,  T2.film_id ,  T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Name FROM channel ORDER BY Name Asc
Feedback: Replace name of channel with origin of program and remove "by Name".
Output: SELECT origin FROM program ORDER BY origin
SQL: SELECT Count ( * ) FROM journal
Feedback: Replace journal table with editor table and make sure the editors are distinct .
Output: SELECT count(*) FROM editor
SQL: SELECT T1.Name FROM Physician AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.Physician ORDER BY T2.End Desc LIMIT 1
Feedback: Replace physician physician table with patient patient table and end with start of appointment appointment table .
Output: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1
SQL: SELECT name FROM user_profiles GROUP BY name HAVING Count ( * ) > 1
Feedback: Replace name in user profiles table with id in tweets .
Output: SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  >  1
SQL: SELECT Count ( * ) FROM flight
Feedback: Replace flight table with employee table .
Output: SELECT count(*) FROM Employee
SQL: SELECT Count ( DISTINCT T2.color ) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.Country = "Ethiopia"
Feedback: Need to find number of rows of camera lens id without repetition .
Output: SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id WHERE T1.country  =  'Ethiopia'
SQL: SELECT Count ( * ) FROM city
Feedback: Replace city table with farm table .
Output: SELECT count(*) FROM farm
SQL: SELECT T1.Name , T1.Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 GROUP BY T2.Institution HAVING Count ( * ) > = 2
Feedback: Remove "and greater than" and also add founded year is greater than 1880.
Output: SELECT T1.name ,  T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id WHERE T2.founded  >  1880 GROUP BY T1.building_id HAVING count(*)  >=  2
SQL: SELECT Name FROM Nurse
Feedback: Make sure to find only for nurses on call .
Output: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID  =  T2.nurse
SQL: SELECT City_ID , Avg ( Population ) FROM city GROUP BY City_ID
Feedback: Replace city id with status .
Output: SELECT Status ,  avg(Population) FROM city GROUP BY Status
SQL: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < "Clerical Staff"
Feedback: Make sure customer address less than that of whose customer phone equals Clerical staff .
Output: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to  <  (SELECT max(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code  =  'Clerical Staff')
SQL: SELECT destination FROM flight GROUP BY destination ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace both destination with origin .
Output: SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T2.Time FROM wrestler AS T1 JOIN Elimination AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T1.Name = "Orton" OR T1.Name = "Punk"
Feedback: Replace both name with eliminated by .
Output: SELECT TIME FROM elimination WHERE Eliminated_By  =  "Punk" OR Eliminated_By  =  "Orton"
SQL: SELECT DISTINCT Name FROM Patient ORDER BY Name Asc
Feedback: Replace patient table with medication table .
Output: SELECT DISTINCT name FROM medication ORDER BY name
SQL: SELECT Count ( * ) FROM club_rank WHERE Gold < 10
Feedback: Replace gold with total .
Output: SELECT count(*) FROM club_rank WHERE Total  <  10
SQL: SELECT name , email FROM user_profiles GROUP BY email HAVING Count ( * ) > 1
Feedback: Remove email in user profiles table , and make sure that user have follower is greater than 1.
Output: SELECT T1.name ,  T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  1
SQL: SELECT T2.total_budget_percent_budgeted , T3.donator_name FROM School AS T1 JOIN budget AS T2 ON T2.School_id = T1.School_id JOIN endowment AS T3 ON T1.School_id = T3.School_id ORDER BY T3.amount Desc LIMIT 1
Feedback: Replace total budget percent budgeted with amount .
Output: SELECT amount ,  donator_name FROM endowment ORDER BY amount DESC LIMIT 1
SQL: SELECT title FROM film
Feedback: Make sure rating equals to R .
Output: SELECT title FROM film WHERE rating  =  'R'
SQL: SELECT Physician FROM Trained_In ORDER BY CertificationDate Desc LIMIT 1
Feedback: Replace physician physician of trained in table with patient patient of undergoes , and also replace certification date with date undergoes .
Output: SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
SQL: SELECT catalog_name FROM Catalogs WHERE catalog_name LIKE "2%"
Feedback: Replace catalog name contains 2% with Catalog Contents's product stock number equals 2%
Output: SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"
SQL: SELECT T2.Name , T3.Season , T1.Country_name FROM country AS T1 JOIN team AS T2 JOIN match_season AS T3 ON T1.Country_id = T3.Country AND T3.Team = T2.Team_id AND T1.Country_id = T3.Country
Feedback: Replace name with player .
Output: SELECT T2.Season ,  T2.Player ,  T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country
SQL: SELECT T2.Name , T2.Owner , T1.Owner FROM program AS T1 JOIN channel AS T2 JOIN broadcast AS T3 ON T1.Program_ID = T3.Program_ID AND T3.Channel_ID = T2.Channel_ID
Feedback: Replace channel with program at both places in step 2.
Output: SELECT name ,  origin ,  OWNER FROM program
SQL: SELECT Count ( * ) FROM mountain WHERE Height > 15
Feedback: Replace mountain with camera lens , height with focal length mm .
Output: SELECT count(*) FROM camera_lens WHERE focal_length_mm  >  15
SQL: SELECT T1.Name FROM channel AS T1 JOIN broadcast AS T2 ON T1.Channel_ID = T2.Channel_ID GROUP BY T2.Channel_ID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace channel and broadcast's channel id with program and broadcast's program id . name should be of program table .
Output: SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id GROUP BY t2.program_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T2.College FROM team AS T1 JOIN match_season AS T2 ON T2.Team = T1.Team_id JOIN player AS T3 ON T1.Team_id = T3.Team WHERE T3.Player = "Midfielder" INTERSECT SELECT T2.College FROM team AS T1 JOIN match_season AS T2 ON T2.Team = T1.Team_id JOIN player AS T3 ON T1.Team_id = T3.Team WHERE T3.Player = "Defender"
Feedback: Replace player's player with match season's position for step 2 and 3 , "3" with " 1" in step 3
Output: SELECT College FROM match_season WHERE POSITION  =  "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION  =  "Defender"
SQL: SELECT product_name FROM Products WHERE product_description = "white"
Feedback: it is color description not product description
Output: SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code WHERE t2.color_description  =  "white"
SQL: SELECT customer_name FROM Customers ORDER BY payment_method Desc LIMIT 1
Feedback: Replace payment method with order quantity
Output: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id WHERE t3.order_quantity  =  ( SELECT max(order_quantity) FROM order_items)
SQL: SELECT Name FROM Manufacturers EXCEPT SELECT Name FROM Manufacturers
Feedback: In step 2 , the manufacturer should have a Product with the name DVD drive
Output: SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive'
SQL: SELECT Name , Main_Services FROM station GROUP BY Station_ID ORDER BY Count ( * ) Desc LIMIT 3
Feedback: in step 2 , order by total passengers
Output: SELECT name ,  main_services FROM station ORDER BY total_passengers DESC LIMIT 3
SQL: SELECT DISTINCT Name FROM wine WHERE Price > ( SELECT Max ( Price ) FROM wine WHERE Winery = "John Anthony" )
Feedback: should be minimum in step 1
Output: SELECT DISTINCT Name FROM WINE WHERE Price  >  (SELECT min(Price) FROM wine WHERE Winery  =  "John Anthony")
SQL: SELECT Count ( * ) FROM Customer_Orders WHERE order_status = "Cancelled"
Feedback: should find the number of different customer id not the number of rows
Output: SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status  =  "Cancelled"
SQL: SELECT amenity_name FROM Dorm_amenity GROUP BY amenity_name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: step 1 should have amenity id instead of amenity name and has amenity instead of dorm amenity
Output: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid  =  T2.amenid GROUP BY T2.amenid ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Sum ( T1.enr ) , T2.cName FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName GROUP BY T2.cName
Feedback: find the number of rows of each college name instead of enrollment summation . also order by that count .
Output: SELECT count(*) ,  cName FROM tryout GROUP BY cName ORDER BY count(*) DESC
SQL: SELECT Name , Revenue FROM Manufacturers GROUP BY Headquarter ORDER BY Count ( * ) Desc LIMIT 1
Feedback: order by revenues .
Output: SELECT name ,  max(revenue) ,  Headquarter FROM manufacturers GROUP BY Headquarter
SQL: SELECT * FROM roller_coaster WHERE Height > 100 OR Height > 3300
Feedback: Use length greater than 3300 instead of height greater than 3300 and only find status not the whole row
Output: SELECT Status FROM roller_coaster WHERE LENGTH  >  3300 OR Height  >  100
SQL: SELECT T1.characteristic_type_description FROM Ref_Characteristic_Types AS T1 JOIN Characteristics AS T2 ON T1.characteristic_type_code = T2.characteristic_type_code GROUP BY T2.characteristic_type_code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace reference characteristic types table with reference colors , characteristics table with products , Characteristics's characteristic type code with color code , characteristic type description with color description
Output: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code GROUP BY t2.color_description ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T2.customer_name FROM Addresses AS T1 JOIN Customers AS T2 JOIN Customer_Addresses AS T3 ON T1.address_id = T3.address_id AND T3.customer_id = T2.customer_id WHERE T1.city = "Colorado"
Feedback: state province county should be Colorado not city
Output: SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t3.state_province_county  =  "Colorado"
SQL: SELECT T1.dorm_name FROM Dorm AS T1 JOIN Dorm_amenity AS T2 JOIN Has_amenity AS T3 ON T1.dormid = T3.dormid AND T3.amenid = T2.amenid WHERE T2.amenity_name ! = "TV Lounge"
Feedback: need to make sure that none of the amenities of each dorm is TV Lounge
Output: SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge'
SQL: SELECT cName , enr FROM College WHERE enr > 10000 OR state = "LA"
Feedback: should be and instead of or
Output: SELECT cName ,  enr FROM College WHERE enr  >  10000 AND state = "LA"
SQL: SELECT Name FROM station GROUP BY Station_ID HAVING Count ( * ) > = 2
Feedback: use train station table instead in step 1
Output: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id  =  T2.station_id GROUP BY T1.station_id HAVING count(*)  >=  2
SQL: SELECT Name FROM wine WHERE Year > 2008
Feedback: Replace wine's name with appellations's appelation and make sure Appelation's area does not equals Central Coast .
Output: SELECT Appelation FROM WINE WHERE YEAR  >  2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area  =  "Central Coast"
SQL: SELECT T1.characteristic_type_description FROM Ref_Characteristic_Types AS T1 JOIN Characteristics AS T2 ON T1.characteristic_type_code = T2.characteristic_type_code WHERE T2.characteristic_name LIKE "t"
Feedback: Need to replace reference characteristic types with reference product categories , characteristics with products , characteristic type description with product category description , characteristic name with product description .
Output: SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code  =  T2.product_category_code WHERE T2.product_description LIKE '%t%'
SQL: SELECT T2.Name FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer WHERE T1.Revenue > ( SELECT Avg ( T1.Revenue ) FROM Manufacturers AS T1 )
Feedback: Use name of companies instead of Products' name .
Output: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)
SQL: SELECT Avg ( Price ) , Manufacturer FROM Products GROUP BY Manufacturer
Feedback: Make sure to find name of manufacturers along with average price of products for each .
Output: SELECT avg(T1.price) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
SQL: SELECT T2.pName FROM College AS T1 JOIN Player AS T2 JOIN Tryout AS T3 ON T1.cName = T3.cName AND T3.pID = T2.pID ORDER BY T1.enr Desc LIMIT 1
Feedback: Only need to find for players whose player id is present in tryout table .
Output: SELECT T2.pName FROM  tryout AS T1 JOIN player AS T2 ON T1.pID  =  T2.pID WHERE T1.cName  =  (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)
SQL: SELECT Count ( * ) FROM Player WHERE pName = "goalie"
Feedback: Replace player name with player position .
Output: SELECT count(*) FROM tryout WHERE pPos  =  'goalie'
SQL: SELECT T2.Name , Avg ( T1.Speed ) FROM roller_coaster AS T1 JOIN country AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Country_ID
Feedback: Find country's name in place of country id in step 2.
Output: SELECT T1.Name ,  avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name
SQL: SELECT Rank FROM captain EXCEPT SELECT Rank FROM captain
Feedback: In step 2 , make sure tu find class equals to Third rate ship of the line .
Output: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS  =  'Third-rate ship of the line'