niryuu/sni-each-converted huggingface dataset:
SQL: SELECT Name FROM captain ORDER BY age Asc
Feedback: Replace ascending with descending .
Output: SELECT name FROM captain ORDER BY age DESC
SQL: SELECT Name , Score FROM wine WHERE Appelation = "White"
Feedback: Need to replace appelation with grapes's color .
Output: SELECT T2.Name ,   T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "White"
SQL: SELECT DISTINCT state FROM College
Feedback: Make sure only for find for corresponding training hours present in tryout table .
Output: SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName
SQL: SELECT date_became_customer FROM Customers WHERE customer_name LIKE "Tillman Ernser"
Feedback: Replace date became customer with channel code , customers with customer contact channels , customer name with Customers's customer name .
Output: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "Tillman Ernser"
SQL: SELECT cName FROM College ORDER BY enr Asc LIMIT 1
Feedback: Make sure to find for each state .
Output: SELECT cName ,  state ,  min(enr) FROM college GROUP BY state
SQL: SELECT T2.Name , T1.Name FROM member AS T1 JOIN branch AS T2 JOIN membership_register_branch AS T3 ON T1.Member_ID = T3.Member_ID AND T3.Branch_ID = T2.Branch_ID AND T1.Member_ID = T3.Member_ID WHERE T3.Register_Year > 2015
Feedback: Replace member's name with branch's branch id , register year with open year .
Output: SELECT T2.name ,  count(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id WHERE T1.register_year  >  2015 GROUP BY T2.branch_id
SQL: SELECT Name FROM Products WHERE Price > 240 OR Price < 200
Feedback: Replace "greater than" with "equals" and " 240" with " 200".
Output: SELECT name FROM products WHERE price  <=  200
SQL: SELECT name FROM swimmer GROUP BY name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace name in swimmer table with id in record table in step 1.
Output: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( DISTINCT state ) FROM College
Feedback: There should be college name instead of state .
Output: SELECT count(*) FROM College
SQL: SELECT Product_Name FROM Products WHERE Product_Price < 1000000
Feedback: Make sure to find average product price instead of product price .
Output: SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price)  <  1000000
SQL: SELECT T1.staff_name , T1.staff_gender FROM Staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code ! = "Clerical Staff"
Feedback: Also need to make sure job title code equals Sales Person in step 2.
Output: SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Sales Person" EXCEPT SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Clerical Staff"
SQL: SELECT Grape , Winery , Year FROM wine WHERE Price > 100 ORDER BY Price Desc
Feedback: Replace "descending by Price" with ascending by year .
Output: SELECT Grape ,  Winery ,  YEAR FROM WINE WHERE Price  >   100 ORDER BY YEAR
SQL: SELECT Name , Headquarter FROM Manufacturers ORDER BY Revenue Asc
Feedback: It should be descending instead ascending .
Output: SELECT name ,  headquarter FROM manufacturers ORDER BY revenue DESC
SQL: SELECT dorm_name , Count ( * ) FROM Dorm GROUP BY dorm_name
Feedback: Need to corresponds rows of Has amenity's amenity id .
Output: SELECT count(*) ,  T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid WHERE T1.student_capacity  >  100 GROUP BY T1.dormid
SQL: SELECT product_name , typical_selling_price FROM Products
Feedback: Replace typical selling price with typical buying price .
Output: SELECT product_name ,  typical_buying_price FROM products
SQL: SELECT T1.Customer_Name FROM Performers AS T1 JOIN Bookings AS T2 JOIN Performers_in_Bookings AS T3 ON T1.Performer_ID = T3.Performer_ID AND T3.Order_ID = T2.Booking_ID WHERE T2.Status_Code = "stop"
Feedback: Make sure to add drama workshop groups table in step 1 and in step 2 , replace customer name with store name .
Output: SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID  =  T2.Workshop_Group_ID WHERE T1.Status_Code  =  "stop"
SQL: SELECT name FROM stadium GROUP BY ID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace stadium table with event table .
Output: SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id  =  t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM country AS T1 WHERE T1.Country_ID NOT IN ( SELECT T2.Country_ID FROM roller_coaster AS T2 WHERE T2.Height > 3000 )
Feedback: There should be length instead of height .
Output: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  3000 )
SQL: SELECT customer_name FROM Customers GROUP BY customer_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace customers table with customer orders table .
Output: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Characteristics WHERE characteristic_data_type = "flax"
Feedback: Replace characteristic data type with Products' product name .
Output: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id WHERE t1.product_name  =  "flax"
SQL: SELECT Count ( * ) FROM book_club
Feedback: Need to find distinct director from movie table .
Output: SELECT COUNT (DISTINCT director) FROM movie
SQL: SELECT Built , Location FROM railway
Feedback: Replace built with wheels .
Output: SELECT Wheels ,  LOCATION FROM railway
SQL: SELECT Type , Count ( * ) FROM culture_company GROUP BY Type
Feedback: Replace type in culture company with category of book club , need to find number of rows in book club .
Output: SELECT category ,  count(*) FROM book_club GROUP BY category
SQL: SELECT Count ( * ) FROM Student
Feedback: Replace student table with has amenity table .
Output: SELECT count(DISTINCT dormid) FROM has_amenity
SQL: SELECT Name FROM event ORDER BY Year Desc LIMIT 1
Feedback: Need to list all names in descending order of year .
Output: SELECT name FROM event ORDER BY YEAR DESC
SQL: SELECT Count ( * ) FROM Student WHERE Age < 25
Feedback: Make sure sex equals F .
Output: SELECT count(*) FROM student WHERE sex  =  'F' AND age  <  25
SQL: SELECT Starting_Year FROM technician WHERE Team = "CLE" OR Team = "CWS"
Feedback: starting year should be used by technician from both teams
Output: SELECT Starting_Year FROM technician WHERE Team  =  "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team  =  "CWS"
SQL: SELECT T1.document_status_description FROM Ref_Document_Status AS T1 JOIN Documents AS T2 ON T1.document_status_code = T2.document_status_code JOIN Documents_Mailed AS T3 ON T2.document_id = T3.document_id WHERE T3.document_id = 1
Feedback: don't use documents mailed in step 1
Output: SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1
SQL: SELECT T1.shipping_agent_name FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T1.shipping_agent_code = T2.shipping_agent_code JOIN Documents_Mailed AS T3 ON T2.document_id = T3.document_id WHERE T3.document_id = 2
Feedback: don't use documents mailed in step 1
Output: SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2
SQL: SELECT DISTINCT city FROM Addresses
Feedback: only consider the addresses used in people addresses
Output: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id
SQL: SELECT Name , Dates_active , Number_Deaths FROM storm GROUP BY Storm_ID HAVING Count ( * ) > = 1
Feedback: use number deaths instead of step 1 result
Output: SELECT name ,  dates_active ,  number_deaths FROM storm WHERE number_deaths  >=  1
SQL: SELECT T1.Nominee FROM musical AS T1 JOIN actor AS T2 WHERE T2.Name = "Tony Award" INTERSECT SELECT T1.Nominee FROM musical AS T1 JOIN actor AS T2 WHERE T2.Name = "Drama Desk Award"
Feedback: Replace actor's name with musical's award .
Output: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award  =  "Drama Desk Award"
SQL: SELECT Count ( * ) FROM Accounts
Feedback: count the number of different customer id
Output: SELECT count(DISTINCT customer_id) FROM Accounts
SQL: SELECT name , dept_name FROM student GROUP BY dept_name ORDER BY Sum ( tot_cred ) Asc
Feedback: order by course id not by the results of step 1
Output: SELECT name ,  dept_name FROM student ORDER BY tot_cred
SQL: SELECT dept_name FROM student GROUP BY dept_name ORDER BY Sum ( tot_cred ) Desc LIMIT 1
Feedback: only use course table and replace total credits with credits
Output: SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1
SQL: SELECT Max ( Milliseconds ) , Min ( Milliseconds ) FROM Track
Feedback: Make sure find result for Genre's name equals pop .
Output: SELECT max(Milliseconds) ,  min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Pop"
SQL: SELECT employee_id , Count ( * ) FROM Circulation_History GROUP BY employee_id
Feedback: use document id instead of employee id
Output: SELECT document_id ,  count(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id
SQL: SELECT Team_Name FROM basketball_match ORDER BY Team_Name Desc
Feedback: ordered descending by all home instead of team name .
Output: SELECT team_name FROM basketball_match ORDER BY All_Home DESC
SQL: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN Customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.first_name = "good" INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN Customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.first_name = "bad"
Feedback: In step 2 and 3 replace first name with good or bad customer from customer table .
Output: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id  =  T2.coupon_id WHERE T2.good_or_bad_customer  =  'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id  =  T2.coupon_id WHERE T2.good_or_bad_customer  =  'bad'
SQL: SELECT Max ( T3.positionText ) FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId JOIN constructorStandings AS T3 ON T2.raceId = T3.raceId WHERE T1.country = "Monaco Grand Prix"
Feedback: Replace circuits table with results table(in step 1) , position text with fastest Lap Speed , country with name of races for year equals 2008 .
Output: SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
SQL: SELECT country FROM circuits ORDER BY country Asc
Feedback: Substitute country of circuits table with name of races table , and order descending by name .
Output: SELECT DISTINCT name FROM races ORDER BY name DESC
SQL: SELECT T1.Company FROM entrepreneur AS T1 EXCEPT SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Name = "Rachel Elnaugh"
Feedback: Find name of people table who are entrepreneur in step 1 , Replace company with name , name with investor(step 3)
Output: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor != "Rachel Elnaugh"
SQL: SELECT Avg ( Milliseconds ) , Avg ( Milliseconds ) FROM Track
Feedback: Remove last milliseconds part , and find(average length ) for Track's name equals Latin and Track's name equals pop .
Output: SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Latin" OR T1.Name  =  "Pop"
SQL: SELECT student_id FROM Student_Course_Registrations
Feedback: Make sure only student id whose course id is equal to 305 is listed .
Output: SELECT student_id FROM student_course_attendance WHERE course_id  =  301
SQL: SELECT Name , Count ( * ) FROM actor GROUP BY Name
Feedback: Replace actor table with musical table . corresponding rows to each value of musical id , make sure that musical id present in actor table .
Output: SELECT T2.Name ,  COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID
SQL: SELECT first_name , last_name FROM People
Feedback: And make sure they are candidate .
Output: SELECT T2.first_name ,  T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id
SQL: SELECT constructorStandingsId , constructorId FROM constructorStandings ORDER BY constructorId Desc LIMIT 1
Feedback: Replace constructor standings id with driver id , driver reference with duration , constructor standings id table with drivers table , 2nd constructor id with lap times in milliseconds .
Output: SELECT T1.driverid ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
SQL: SELECT id , name FROM browser GROUP BY id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Substitue id in browser table with browser id in accelerator compatible browser table in step 1
Output: SELECT T1.id ,  T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id  =  T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT School FROM university WHERE Founded = "Public" OR Founded < 1850
Feedback: Replace founded equals 1850 with founded less than 1850 , ( 2nd)Founded with affiliation , and "less than" with "equals".
Output: SELECT school FROM university WHERE founded  >  1850 OR affiliation  =  'Public'
SQL: SELECT DISTINCT country FROM circuits WHERE circuitRef BETWEEN 2017 AND 2014
Feedback: Exchange country of circuits table with name of races table , circuit Reference with year from races table .
Output: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
SQL: SELECT Count ( * ) FROM mountain
Feedback: Substitute mountain table with climber table
Output: SELECT count(*) FROM climber
SQL: SELECT DISTINCT T1.FirstName FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.BillingCountry = "Brazil"
Feedback: Replace billing address with track id and make sure whose customer ID present in invoice table .
Output: SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "Brazil"
SQL: SELECT T1.cmi_cross_ref_id FROM CMI_Cross_References AS T1 EXCEPT SELECT T2.cmi_cross_ref_id FROM Rent_Arrears AS T2
Feedback: Replace rent arrears table with parking fines table .
Output: SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines
SQL: SELECT Avg ( Damage_millions_USD ) , Max ( Damage_millions_USD ) FROM storm WHERE Max_speed > = 1000
Feedback: Need to find max speed greater than 1000.
Output: SELECT avg(damage_millions_USD) ,  max(damage_millions_USD) FROM storm WHERE max_speed  >  1000
SQL: SELECT country FROM circuits WHERE lat > 2017 AND circuitRef = "Spain"
Feedback: Replace country with name ,  circuits with races table , latitude with year ,  circuit reference with country .
Output: SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
SQL: SELECT Company FROM entrepreneur GROUP BY Investor ORDER BY Count ( * ) Desc LIMIT 1
Feedback: find weight in people table in step 1 , Replace company of entrepreneur with name of people , make sure they are entrepreneur .
Output: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
SQL: SELECT Character , Name FROM actor
Feedback: As opposed to character find corresponding name in musical
Output: SELECT T1.Name ,  T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
SQL: SELECT Count ( DISTINCT Region_code ) FROM region
Feedback: Replace region code with region id in affected region table instead of region table
Output: SELECT count(DISTINCT region_id) FROM affected_region
SQL: SELECT Investor FROM entrepreneur ORDER BY Money_Requested Desc
Feedback: Place weight of people table instead of investor of entrepreneur table .
Output: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested DESC
SQL: SELECT product_description FROM Products_for_Hire WHERE product_name = 102.76
Feedback: Substitute booked amount with product name from products booked table .
Output: SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id  =  T2.product_id WHERE T1.booked_amount  =  102.76
SQL: SELECT T1.Membership_card FROM member AS T1 WHERE T1.Address = "Hartford" INTERSECT SELECT T1.Membership_card FROM shop AS T2 JOIN member AS T1 WHERE T2.Address = "Waterbury"
Feedback: Use member in place of shop in step 3.
Output: SELECT membership_card FROM member WHERE address  =  'Hartford' INTERSECT SELECT membership_card FROM member WHERE address  =  'Waterbury'
SQL: SELECT T3.positionText , T1.country FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId AND T1.circuitId = T2.circuitId JOIN constructorStandings AS T3 ON T2.raceId = T3.raceId WHERE T2.time = "Chinese Grand Prix" AND T1.country ! = "Australian Grand Prix"
Feedback: In step 2 substitute forename , surname respectively with position text and country and time and country with name .
Output: SELECT T3.forename ,  T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename ,  T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
SQL: SELECT name , Location , Product FROM enzyme WHERE name LIKE "inhibitor"
Feedback: Need to find interaction type equals inhibitor instead of name contains inhibitor .
Output: SELECT DISTINCT T1.name ,  T1.location ,  T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id  =  T1.id WHERE T2.interaction_type  =  'inhibitor'
SQL: SELECT Enrollment , School FROM university ORDER BY Enrollment Desc LIMIT 1
Feedback: Replace school with primary conference and largest value of enrollment with smallest value of founded .
Output: SELECT enrollment ,  primary_conference FROM university ORDER BY founded LIMIT 1
SQL: SELECT Count ( * ) FROM Genre WHERE Name = "Rock"
Feedback: Replace genre with track table , and make sure Genre's name equals Rock .
Output: SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Rock"
SQL: SELECT name FROM instructor EXCEPT SELECT name FROM instructor
Feedback: In step 2 find the name of instructor whose id is present in teaches table
Output: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches)
SQL: SELECT T1.student_details FROM Students AS T1 WHERE T1.student_id NOT IN ( SELECT T2.student_id FROM Student_Course_Attendance AS T2 )
Feedback: Make sure student details who are not registered in course .
Output: SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)
SQL: SELECT qualifyId , Count ( * ) FROM qualifying GROUP BY qualifyId
Feedback: Replace qualify id in qualifying table with constructor Standings table's constructor id , and find corresponding rows to each value of race id .
Output: SELECT count(*) ,  constructorid FROM constructorStandings GROUP BY constructorid
SQL: SELECT driverRef , Count ( * ) FROM drivers GROUP BY driverRef
Feedback: Find the number of rows of each distinct value of nationality in constructors table .
Output: SELECT count(*) ,  nationality FROM constructors GROUP BY nationality
SQL: SELECT country FROM circuits ORDER BY lat Desc LIMIT 1
Feedback: Replace country , circuits table and latitude with name , races table and date respectively .
Output: SELECT name FROM races ORDER BY date DESC LIMIT 1
SQL: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Visits_Restaurant AS T2 ON T1.StuID = T2.StuID GROUP BY T2.ResID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: step 2 find the number of rows of each value of student id in visits restaurant table .
Output: SELECT Student.Fname , Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Fname , LName FROM Student WHERE Sex = "F" AND Age > 18
Feedback: Make sure major does not equals 600.
Output: SELECT Fname , Lname FROM Student WHERE Age  >  18 AND Major != 600 AND Sex = 'F'
SQL: SELECT T1.Competition , T1.stadium_id FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.Injury = "Knee problem" OR T2.Injury = "Foot injury"
Feedback: Add stadium table in step 1 , replace competition , stadium id with season , name respectively in step 2.
Output: SELECT T1.season ,  T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id WHERE T3.injury  =  'Foot injury' OR T3.injury  =  'Knee problem'
SQL: SELECT DISTINCT T1.Carrier FROM phone AS T1 JOIN phone_market AS T2 ON T1.Phone_ID = T2.Phone_ID WHERE T2.Num_of_stock > 32
Feedback: In step 2 need to make sure memory in g should be greater than 32 instead of num of stock .
Output: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G  >  32
SQL: SELECT course_id FROM takes WHERE year = 2010 AND semester = "Spring"
Feedback: Make sure semester equals Fall , year equals 2009 and semester equals Spring , year equals 2010
Output: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 INTERSECT SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
SQL: SELECT role_code FROM Employees WHERE employee_name = "Koby"
Feedback: Need to find Roles's role description instead of role code .
Output: SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby"
SQL: SELECT Entrepreneur_ID FROM entrepreneur GROUP BY Investor ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 2 , need to find investor instead of entrepreneur id .
Output: SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM circuits WHERE circuitRef = 2009 AND circuitRef = "Australian Grand Prix"
Feedback: Replace circuits table with results table , circuit reference(first ) with races's name , circuit reference(second ) with races's year .
Output: SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
SQL: SELECT Name , Max_speed FROM storm GROUP BY Name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace name in storm table with storm id of affected region table .
Output: SELECT T1.name ,  T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Party FROM people ORDER BY Age Desc LIMIT 1
Feedback: It should be smallest in place of largest .
Output: SELECT Party FROM people ORDER BY Age ASC LIMIT 1
SQL: SELECT T1.Name FROM phone AS T1 JOIN phone_market AS T2 ON T1.Phone_ID = T2.Phone_ID WHERE T2.Num_of_stock > 2000 ORDER BY T1.Name Desc
Feedback: In step 2 need to find by descending order of num of stock and not by name .
Output: SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID  =  T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock)  >=  2000 ORDER BY sum(T1.Num_of_stock) DESC
SQL: SELECT Sponsor_name FROM player WHERE Residence = "Brandon" OR Sponsor_name = "Birtle"
Feedback: Need to replace sponsor name equals Birtle" with "Residence equals Birtle"
Output: SELECT Sponsor_name FROM player WHERE Residence  =  "Brandon" OR Residence  =  "Birtle"
SQL: SELECT Name FROM people EXCEPT SELECT Name FROM people
Feedback: Make sure people has chosen affirmative side of debate people table in step 2.
Output: SELECT Name FROM people WHERE People_id NOT IN (SELECT Affirmative FROM debate_people)
SQL: SELECT Avg ( transaction_amount ) FROM Financial_Transactions
Feedback: Make sure to find summation of transaction amount .
Output: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions
SQL: SELECT name , Client FROM Web_client_accelerator WHERE Connection ! = "Broadband"
Feedback: Make sure to replace client with operating system .
Output: SELECT name ,  operating_system FROM web_client_accelerator WHERE CONNECTION != 'Broadband'
SQL: SELECT T2.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name GROUP BY T2.dept_name ORDER BY Sum ( T1.budget ) Desc LIMIT 1
Feedback: Remove step 2 , count number of row to each value of department name for each table .
Output: SELECT dept_name FROM student GROUP BY dept_name ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T1.Connection , T1.name FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.accelerator_id ORDER BY T2.compatible_since_year Desc
Feedback: In step 1 Add browser Table and Replace connection with name of browser table .
Output: SELECT T2.name ,  T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id  =  T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id  =  T3.id ORDER BY T1.compatible_since_year DESC
SQL: SELECT Count ( * ) FROM Customers_Cards AS T1 WHERE T1.customer_id NOT IN ( SELECT T2.customer_id FROM Accounts AS T2 )
Feedback: In step 2 , replace customers cards table with customers table at both places .
Output: SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
SQL: SELECT Count ( * ) , budget FROM department GROUP BY building
Feedback: Replace building with department name , should find number of corresponding rows of student table for each department .
Output: SELECT count(*) ,  dept_name FROM student GROUP BY dept_name
SQL: SELECT T1.Address FROM Customer AS T1 WHERE T1.Country = "Brazil" INTERSECT SELECT T1.Address FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.BillingCountry = "Germany"
Feedback: Make sure country equals Germany , Replace billing country equals Germany with for each customer of invoice .
Output: SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "Germany"
SQL: SELECT country FROM circuits WHERE circuitRef = 2017
Feedback: Need to replace country with name ,  circuits table with races table ,  circuit reference with year .
Output: SELECT name FROM races WHERE YEAR = 2017
SQL: SELECT T1.name FROM Web_client_accelerator AS T1 JOIN browser AS T2 JOIN accelerator_compatible_browser AS T3 ON T1.id = T3.accelerator_id AND T3.browser_id = T2.id ORDER BY T2.market_share Desc
Feedback: It should be browser's name instead of web client accelerator name .
Output: SELECT name FROM browser ORDER BY market_share DESC
SQL: SELECT Company FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Company FROM entrepreneur WHERE Money_Requested < 120000
Feedback: Replace company with investor .
Output: SELECT Investor FROM entrepreneur WHERE Money_Requested  >  140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested  <  120000
SQL: SELECT Name FROM people ORDER BY Weight Desc LIMIT 1
Feedback: Make sure people id of that people is present in perpetrator table .
Output: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Weight DESC LIMIT 1
SQL: SELECT T1.customer_id , T1.customer_first_name FROM Customers AS T1 JOIN Customers_Cards AS T2 WHERE T2.card_number ! = "Credit"
Feedback: Need to make sure card type code not equals credit in step 2 instead of card number .
Output: SELECT customer_id ,  customer_first_name FROM Customers EXCEPT SELECT T1.customer_id ,  T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE card_type_code  =  "Credit"
SQL: SELECT ID FROM instructor
Feedback: Make sure prerequisite did not teach in any student .
Output: SELECT id FROM instructor EXCEPT SELECT id FROM teaches
SQL: SELECT title , credits , dept_name FROM course GROUP BY dept_name HAVING Count ( * ) > 1
Feedback: Find number of rows of each value of course id in prerequisite table in step 1.
Output: SELECT T1.title ,  T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id  =  T2.course_id GROUP BY T2.course_id HAVING count(*)  >  1
SQL: SELECT Weight FROM people GROUP BY Weight ORDER BY Count ( * ) Asc LIMIT 1
Feedback: In step 2 replace weight with height .
Output: SELECT Weight FROM people ORDER BY Height ASC LIMIT 1
SQL: SELECT customer_id , customer_first_name , customer_last_name FROM Customers GROUP BY customer_id HAVING Count ( * ) > = 2
Feedback: Should find number of rows of each value of customer id in customers cards table in step 1.
Output: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2
SQL: SELECT T1.title FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id JOIN takes AS T3 ON T2.year = T3.year WHERE T3.year = 2010 AND T3.semester = "Chandler"
Feedback: Replace Chandler with Fall , make sure it is offered in chandler .
Output: SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id  =  T2.course_id WHERE building  =  'Chandler' AND semester  =  'Fall' AND YEAR  =  2010
SQL: SELECT Count ( * ) , dept_name FROM instructor GROUP BY dept_name
Feedback: Need to find summation of students as well as instructor for each department .
Output: SELECT count(DISTINCT T2.id) ,  count(DISTINCT T3.id) ,  T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name  =  T2.dept_name JOIN instructor AS T3 ON T1.dept_name  =  T3.dept_name GROUP BY T3.dept_name
SQL: SELECT Membership_card FROM member WHERE Membership_card > 5
Feedback: Need to make sure more than 5 members have that membership card .
Output: SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*)  >  5
SQL: SELECT name FROM instructor GROUP BY name HAVING Count ( * ) > 1
Feedback: Use student id in advisor table instead of name in instructor table in step 1.
Output: SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id  =  T2.i_id GROUP BY T2.i_id HAVING count(*)  >  1
SQL: SELECT T1.address_details FROM Addresses AS T1 JOIN Documents_Mailed AS T2 ON T1.address_id = T2.mailed_to_address_id WHERE T2.document_id = 7
Feedback: Place document drafts table instead of documents mailed table and replace address details with draft details .
Output: SELECT draft_details FROM Document_Drafts WHERE document_id = 7
SQL: SELECT T1.name FROM student AS T1 JOIN time_slot AS T2 WHERE T2.day = 2010 INTERSECT SELECT T1.name FROM student AS T1 JOIN time_slot AS T2 WHERE T2.day = 2009
Feedback: Replace time slot table with takes classes table , There should be year instead of day in both step .
Output: SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id  =  T2.id WHERE YEAR  =  2009 OR YEAR  =  2010
SQL: SELECT T1.cell_mobile_number FROM People AS T1 JOIN Candidates AS T2 ON T1.person_id = T2.candidate_id JOIN Candidate_Assessments AS T3 ON T2.candidate_id = T3.candidate_id WHERE T3.qualification = "Fail"
Feedback: In step 2 it should check for asessment outcome code equals Fail and not qualification .
Output: SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail"
SQL: SELECT Name FROM mountain EXCEPT SELECT Name FROM mountain WHERE Prominence = 5885
Feedback: In step 2 , find name of mountain table where corresponding mountain id is ( also)present in climber table .
Output: SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
SQL: SELECT title , title , credits FROM course ORDER BY title Asc
Feedback: Only find title , credits of course table ordered ascending by title instead of "title , title , credits"
Output: SELECT title FROM course ORDER BY title ,  credits
SQL: SELECT Count ( * ) FROM musical
Feedback: Replace musical table with actor table .
Output: SELECT count(*) FROM actor
SQL: SELECT T1.name , T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T2.year = 2008 ORDER BY T1.name Asc
Feedback: Also correspond course table , Also find title and Replace 2nd name with title .
Output: SELECT T1.title ,  T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id  =  T2.course_id JOIN instructor AS T3 ON T2.id  =  T3.id WHERE YEAR  =  2008 ORDER BY T1.title
SQL: SELECT Count ( * ) FROM race
Feedback: Change race table with track table .
Output: SELECT count(*) FROM track
SQL: SELECT name FROM student
Feedback: Make sure student has taken course whose course 's department name equals Statistics department .
Output: SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id  =  T2.course_id JOIN student AS T3 ON T2.id  =  T3.id WHERE T1.dept_name  =  'Statistics'
SQL: SELECT candidate_id FROM Candidates WHERE candidate_details = "stanley.monahan@example.org"
Feedback: Replace candidate details with email address .
Output: SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = "stanley.monahan@example.org"
SQL: SELECT name FROM instructor EXCEPT SELECT name FROM instructor
Feedback: make sure they are teaching in Spring course id in step 2.
Output: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester  =  'Spring')
SQL: SELECT Name , Date FROM race
Feedback: Also need to find corresponding track's name for each race .
Output: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
SQL: SELECT name FROM instructor
Feedback: Make sure instructor taught course whose title equals C Programming .
Output: SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id  =  T2.id JOIN course AS T3 ON T2.course_id  =  T3.course_id WHERE T3.title  =  'C Programming'
SQL: SELECT T1.Name FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T2.Storm_ID HAVING Count ( * ) > = 10
Feedback: Replace storm id with number city affected , Remove "greater than or "" , make sure it covered at least two regions .
Output: SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id HAVING count(*)  >=  2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id HAVING sum(T2.number_city_affected)  >=  10
SQL: SELECT Name FROM actor ORDER BY age Desc
Feedback: Replace name with character .
Output: SELECT Character FROM actor ORDER BY age DESC
SQL: SELECT Primary_conference FROM university ORDER BY Enrollment Asc LIMIT 1
Feedback: Replace enrollment with acc percent .
Output: SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1
SQL: SELECT source_system_code , master_customer_id FROM CMI_Cross_References
Feedback: Make sure to find each value related to cmi cross reference id of parking fines table .
Output: SELECT T1.source_system_code ,  T1.master_customer_id ,  T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id
SQL: SELECT customer_first_name , customer_last_name FROM Customers
Feedback: Make sure to corresponds with accounts table .
Output: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
SQL: SELECT name FROM instructor ORDER BY salary Asc LIMIT 1
Feedback: Make sure for that department name equals Statistics .
Output: SELECT name FROM instructor WHERE dept_name  =  'Statistics' ORDER BY salary LIMIT 1
SQL: SELECT T1.positionText FROM constructorStandings AS T1 JOIN results AS T2 WHERE T1.position = 1 AND T2.milliseconds > 1
Feedback: Find distinct status 's constructor id whose constructor results 's position equals 1 and q2 greater than 20
Output: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
SQL: SELECT title FROM course WHERE dept_name = "International Finance"
Feedback: Take care that title of International finance course is of prerequisite class .
Output: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id  =  T2.course_id WHERE T2.title  =  'International Finance')
SQL: SELECT T2.document_id , T2.document_type_code FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T1.shipping_agent_code = T2.shipping_agent_code WHERE T1.shipping_agent_name = "done" INTERSECT SELECT T2.document_id , T2.document_type_code FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T1.shipping_agent_code = T2.shipping_agent_code WHERE T1.shipping_agent_name = "USPS"
Feedback: Remove both document type code , replace shipping agent name with document status code in step 2 , Add document type code equals Paper in step2.
Output: SELECT document_id FROM Documents WHERE document_status_code  =  "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
SQL: SELECT country FROM circuits WHERE lat > 2000 AND circuitRef = "Spain"
Feedback: Replace country of circuits , latitude and circuit reference with different name of races , year and country of circuits .
Output: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
SQL: SELECT Count ( * ) FROM Addresses
Feedback: Make sure course name equals English and replace addresses table with student course attendance .
Output: SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English"
SQL: SELECT Count ( DISTINCT source_system_code ) FROM CMI_Cross_References WHERE source_system_code = "Rent"
Feedback: Need to remove "whose source system code equals Rent" phrase .
Output: SELECT count(DISTINCT source_system_code) FROM CMI_cross_references
SQL: SELECT year FROM takes GROUP BY year ORDER BY Count ( * ) Desc LIMIT 1
Feedback: find the number of different course id in step 1
Output: SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) , name FROM enzyme GROUP BY name
Feedback: Replace enzyme table with medicine table , should corresponds rows to each value of trade name .
Output: SELECT trade_name ,  count(*) FROM medicine GROUP BY trade_name
SQL: SELECT T2.semester , T1.year FROM section AS T1 JOIN takes AS T2 ON T1.year = T2.year GROUP BY T2.semester ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Need to find takes's semester and year for smallest number of students enrolled in it .
Output: SELECT semester ,  YEAR FROM takes GROUP BY semester ,  YEAR ORDER BY count(*) LIMIT 1
SQL: SELECT T1.dept_name , T2.dept_name FROM department AS T1 JOIN instructor AS T2 ON T1.dept_name = T2.dept_name WHERE T1.budget > ( SELECT Avg ( T1.budget ) FROM department AS T1 )
Feedback: In step 3 find department's budget instead of instructor's department name .
Output: SELECT dept_name ,  budget FROM department WHERE budget  >  (SELECT avg(budget) FROM department)
SQL: SELECT id , Score , Date FROM game GROUP BY stadium_id HAVING Count ( * ) > = 2
Feedback: Replace stadium id in game table with injury accident's game id .
Output: SELECT T1.id ,  T1.score ,  T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
SQL: SELECT T1.Team_Name , T2.Founded FROM basketball_match AS T1 JOIN university AS T2 ON T1.School_ID = T2.School_ID ORDER BY T2.Founded Desc LIMIT 1
Feedback: Replace first founded in step 2 with acc regular season , and largest value with smallest value .
Output: SELECT t2.team_name ,  t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t1.founded LIMIT 1
SQL: SELECT Count ( * ) FROM Customers WHERE customer_first_name = "Art" AND customer_last_name = "Turcotte"
Feedback: Need to find total number of customers cards for that specific customer .
Output: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Art" AND T2.customer_last_name  =  "Turcotte"
SQL: SELECT Count ( * ) FROM classroom
Feedback: Find total count of distinct student id in advisor table .
Output: SELECT count(DISTINCT s_id) FROM advisor
SQL: SELECT course_id FROM Student_Course_Attendance WHERE student_id = 121 OR student_id = 121
Feedback: Need to make sure student course attendance table's student id equals 121 or student course registrations student id equals 121.
Output: SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
SQL: SELECT name FROM medicine GROUP BY id HAVING Count ( * ) > 2
Feedback: In step 1 replace id with medicine id , medicine with medicine enzyme interaction , in step 2 also find id
Output: SELECT T1.id ,  T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
SQL: SELECT student_id FROM Student_Course_Attendance GROUP BY student_id ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Replace student course attendance table with student course registrations table
Output: SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1
SQL: SELECT FirstName , EmployeeId FROM Employee GROUP BY EmployeeId HAVING Count ( * ) > = 10
Feedback: Need to make sure listed employees worked for minimum 10 customers .
Output: SELECT T1.FirstName ,  T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  >=  10
SQL: SELECT T1.Party_Theme , T1.Location FROM party AS T1 JOIN host AS T2 JOIN party_host AS T3 ON T1.Party_ID = T3.Party_ID AND T3.Host_ID = T2.Host_ID ORDER BY T2.Age Asc
Feedback: It should be host's name in place of party theme .
Output: SELECT T3.Location ,  T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID  =  T2.Host_ID JOIN party AS T3 ON T1.Party_ID  =  T3.Party_ID ORDER BY T2.Age
SQL: SELECT T2.positionText , T1.name FROM races AS T1 JOIN constructorStandings AS T2 ON T1.raceId = T2.raceId JOIN lapTimes AS T3 ON T1.raceId = T3.raceId WHERE T3.milliseconds < 93000
Feedback: Find distinct drivers's forename ,  surname whose lap times in milliseconds less than 93000.
Output: SELECT DISTINCT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
SQL: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Registrations AS T2 ON T1.course_id = T2.course_id JOIN Student_Course_Attendance AS T3 ON T2.course_id = T3.course_id GROUP BY T3.course_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 2 , need to replace student course attendance with student course registrations .
Output: SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT account_id , customer_id , account_name , account_name FROM Accounts
Feedback: Remove second "account name". No need to find it two times .
Output: SELECT account_id ,  customer_id ,  account_name FROM Accounts
SQL: SELECT Count ( * ) FROM people
Feedback: Need to change people table with debate table .
Output: SELECT count(*) FROM debate
SQL: SELECT Count ( * ) FROM game WHERE Season > 2010
Feedback: Need to find different injuries caused for season greater than 2010.
Output: SELECT count(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id  =  T2.id WHERE T2.season  >  2010
SQL: SELECT Year_Opened FROM track WHERE Seating > 5000 OR Seating > 4000
Feedback: Replace "greater than 4000" with equals 5000 , add seating equals or less than 4000 opened .
Output: SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
SQL: SELECT Count ( * ) FROM Type_Of_Restaurant WHERE ResTypeID = "Sandwich"
Feedback: Replace type of restaurant table and restaurant type id with restaurant and restaurant type name respectively .
Output: SELECT count(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID =  Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'
SQL: SELECT T1.url , T1.time FROM races AS T1 JOIN lapTimes AS T2 ON T1.raceId = T2.raceId WHERE T2.milliseconds > 100000
Feedback: Need to find distinct driver id , nationality of drivers table whose lap times in millisecond is greater than 100000.
Output: SELECT DISTINCT T1.driverid ,  T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds >  100000
SQL: SELECT T2.name FROM department AS T1 JOIN instructor AS T2 ON T2.dept_name = T1.dept_name JOIN student AS T3 ON T1.dept_name = T3.dept_name GROUP BY T2.name ORDER BY Sum ( T3.tot_cred ) Desc LIMIT 1
Feedback: Make sure instructor is advising student with largest number of total credits .
Output: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id ORDER BY T3.tot_cred DESC LIMIT 1
SQL: SELECT T1.sec_id FROM section AS T1 JOIN takes AS T2 ON T1.year = T2.year WHERE T2.year = 2010 OR T2.semester = "Spring"
Feedback: Replace section's section id and "or"with takes'course id and and , add"or takes's year equals 2009 and semester equals fall"
Output: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 UNION SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
SQL: SELECT DISTINCT Name FROM mountain WHERE Country = "West Germany"
Feedback: Maker sure to check for climber's country for the mountain .
Output: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID WHERE T1.Country  =  "West Germany"
SQL: SELECT Sum ( budget ) FROM department WHERE dept_name = "Marketing"
Feedback: Find for prerequisite id equals Marketing and prerequisite id equals Finance .
Output: SELECT sum(budget) FROM department WHERE dept_name  =  'Marketing' OR dept_name  =  'Finance'
SQL: SELECT T2.Time FROM Student AS T1 JOIN Visits_Restaurant AS T2 ON T1.StuID = T2.StuID WHERE T1.Fname = "Linda" AND T1.LName = "Smith"
Feedback: Add restaurant table in step 1 , make sure restaurant id equals Subway .
Output: SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway"
SQL: SELECT Avg ( UnitPrice ) FROM Track
Feedback: Make sure to only find for rock tracks .
Output: SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Rock"
SQL: SELECT title FROM course
Feedback: Make sure it has two prerequisites .
Output: SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id  =  T2.course_id GROUP BY T2.course_id HAVING count(*)  =  2
SQL: SELECT Count ( * ) FROM Accounts
Feedback: Replace accounts table with customers cards table .
Output: SELECT count(*) FROM Customers_cards