niryuu/sni-each-converted huggingface dataset:
SQL: SELECT name , name FROM employee WHERE salary > 5000 GROUP BY name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Change salary with distance and name , name with name , salary , find number of rows that correspond of certificate .
Output: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.distance  >  5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T1.School_name FROM School AS T1 JOIN budget AS T2 ON T1.School_id = T2.School_id WHERE T2.total_budget_percent_budgeted > 100 OR T1.Enrollment > 10
Feedback: Find correspondence in endowment table , ensure budgeted greater than 100 or amount greater than 10.
Output: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id JOIN endowment AS T3 ON T2.school_id  =  T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted)  >  100 OR sum(T3.amount)  >  10
SQL: SELECT Count ( * ) FROM flight WHERE distance > 2000
Feedback: There should be flight number to be found not the number of rows of table .
Output: SELECT flno FROM Flight WHERE distance  >  2000
SQL: SELECT T1.ID FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T2.year ! = 2010
Feedback: Ensure that semester equals Fall , year equals 2009 but semester not equals Spring , year not equals 2010.
Output: SELECT id FROM teaches WHERE semester  =  'Fall' AND YEAR  =  2009 EXCEPT SELECT id FROM teaches WHERE semester  =  'Spring' AND YEAR  =  2010
SQL: SELECT Winery , Name , Score FROM wine WHERE Score > 93 ORDER BY Score Asc
Feedback: Take grape and appelation instead of winery and score , Ensure that ordered ascending by name .
Output: SELECT Grape ,  Appelation ,  Name FROM WINE WHERE Score  >  93 ORDER BY Name
SQL: SELECT Count ( * ) FROM takes WHERE year = 2010
Feedback: Use teaches table in place of takes classes table , Ensure semester equals Spring .
Output: SELECT COUNT (DISTINCT ID) FROM teaches WHERE semester  =  'Spring' AND YEAR  =  2010
SQL: SELECT Count ( * ) , year FROM takes GROUP BY year
Feedback: Need to find number of rows in section table for each semester and each year .
Output: SELECT count(*) ,  semester ,  YEAR FROM SECTION GROUP BY semester ,  YEAR
SQL: SELECT Count ( * ) FROM repair
Feedback: Put technician table . The repair table is wrong .
Output: SELECT count(*) FROM technician
SQL: SELECT Avg ( Age ) , city_code FROM Student WHERE Sex = "M" GROUP BY city_code
Feedback: For each city code need to find average age where Student's sex equals M .
Output: SELECT count(*) ,  avg(age) ,  city_code FROM student WHERE sex  =  'M' GROUP BY city_code
SQL: SELECT name FROM stadium WHERE Country = "Australia"
Feedback: Substitute country with swimmer's nationality .
Output: SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id JOIN event AS t3 ON t2.event_id  =  t3.id JOIN stadium AS t4 ON t4.id  =  t3.stadium_id WHERE t1.nationality  =  'Australia'
SQL: SELECT customer_name , customer_phone , customer_email FROM Customers GROUP BY customer_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Exchange customers table with customer orders table in step 1.
Output: SELECT T1.customer_name ,  T1.customer_phone ,  T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T2.customer_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( DISTINCT transaction_type ) FROM Financial_Transactions
Feedback: Replace transaction type , financial transactions table with card type code , customers cards table .
Output: SELECT count(DISTINCT card_type_code) FROM Customers_Cards
SQL: SELECT candidate_id FROM Candidate_Assessments GROUP BY candidate_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 1 , need to find assessment date for each candidate id .
Output: SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1
SQL: SELECT name , salary FROM instructor WHERE dept_name = "Math"
Feedback: Assure that instructor's id present in advisor table .
Output: SELECT T2.name ,  T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id WHERE T3.dept_name  =  'Math'
SQL: SELECT T1.shipping_agent_name , Count ( * ) FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T1.shipping_agent_code = T2.shipping_agent_code GROUP BY T2.shipping_agent_code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Use reference shipping agents shipping agent name on behalf of Documents's shipping agent code in step 3.
Output: SELECT Ref_Shipping_Agents.shipping_agent_name , count(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY count(Documents.document_id) DESC LIMIT 1
SQL: SELECT Name FROM member WHERE Hometown = "Louisville ,  Kentucky" INTERSECT SELECT Name FROM member WHERE Hometown = "Hiram ,  Georgia"
Feedback: In step 1 and 2 replace member with branch .
Output: SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id JOIN member AS T3 ON T1.member_id  =  T3.member_id WHERE T3.Hometown  =  'Louisville ,  Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id JOIN member AS T3 ON T1.member_id  =  T3.member_id WHERE T3.Hometown  =  'Hiram ,  Georgia'
SQL: SELECT catalog_entry_name , height FROM Catalog_Contents WHERE price_in_euros > 700
Feedback: Substitute capacity and price in dollars in place of height and price in euros .
Output: SELECT catalog_entry_name ,  capacity FROM Catalog_Contents WHERE price_in_dollars  >  700
SQL: SELECT T1.SSN FROM Physician AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.Physician GROUP BY T2.Physician ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Find employee id of physician physician who is head of department department with smallest number of employee .
Output: SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1
SQL: SELECT T1.School_name , T1.Location , T2.donator_name FROM School AS T1 JOIN endowment AS T2 ON T1.School_id = T2.School_id
Feedback: Change donator name with mascot in step 2.
Output: SELECT school_name ,  LOCATION ,  mascot FROM school
SQL: SELECT id FROM Player WHERE height BETWEEN 190 AND 180
Feedback: Omit "equals or" and add "is". Also Mention player attributes preferred foot equals left .
Output: SELECT player_api_id FROM Player WHERE height  >=  180 AND height  <=  190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot  =  "left"
SQL: SELECT Award FROM musical GROUP BY Award HAVING Count ( * ) > 2
Feedback: Modify award with nominee in both step .
Output: SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2
SQL: SELECT Count ( * ) , Manufacturer FROM Products GROUP BY Manufacturer
Feedback: Need each name of manufacturer and number of corresponding rows in products table .
Output: SELECT count(*) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name
SQL: SELECT Count ( * ) FROM enzyme WHERE Porphyria ! = "No"
Feedback: find the number of rows in medicine table whose fda approved equals No .
Output: SELECT count(*) FROM medicine WHERE FDA_approved  =  'No'
SQL: SELECT T3.department_name , T2.store_name FROM Department_Store_Chain AS T1 JOIN Department_Stores AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id AND T1.dept_store_chain_id = T2.dept_store_chain_id JOIN Departments AS T3 ON T2.dept_store_id = T3.dept_store_id WHERE T1.dept_store_chain_name = "marketing" INTERSECT SELECT T3.department_name , T2.store_name FROM Department_Store_Chain AS T1 JOIN Department_Stores AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id AND T1.dept_store_chain_id = T2.dept_store_chain_id JOIN Departments AS T3 ON T2.dept_store_id = T3.dept_store_id WHERE T1.dept_store_chain_name = "managing"
Feedback: Exchange department name with department id and department store chain name with department name in both steps .
Output: SELECT T2.dept_store_id ,  T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id  =  T2.dept_store_id WHERE T1.department_name  =  "marketing" INTERSECT SELECT T2.dept_store_id ,  T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id  =  T2.dept_store_id WHERE T1.department_name  =  "managing"
SQL: SELECT Nominee FROM musical GROUP BY Award ORDER BY Count ( * ) Desc LIMIT 1
Feedback: award is wrong use nominee instead of that .
Output: SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT Avg ( T3.lap ) FROM circuits AS T1 JOIN races AS T2 ON T1.circuitId = T2.circuitId JOIN lapTimes AS T3 ON T2.raceId = T3.raceId WHERE T1.country = 2008 AND T1.country = "Monaco Grand Prix"
Feedback: Add results table , Interchange lap with fastest lap speed , 1st country with races's name and 2nd country with year .
Output: SELECT avg(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 T1.product_name FROM Products AS T1 JOIN Complaints AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Change product id with customer id in step 2.
Output: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id  =  t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1
SQL: SELECT Sum ( total ) FROM invoices WHERE billing_city = "Chicago"
Feedback: also make sure billing state equals IL
Output: SELECT sum(total) FROM invoices WHERE billing_city  =  "Chicago" AND billing_state  =  "IL"
SQL: SELECT AllergyType , Count ( * ) FROM Allergy_Type GROUP BY AllergyType
Feedback: should find the number of corresponding rows in has allergy table
Output: SELECT T2.allergytype ,  count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy  =  T2.allergy GROUP BY T2.allergytype
SQL: SELECT Count ( * ) FROM company
Feedback: need to find the number of station id of each company
Output: SELECT T2.company ,  count(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id GROUP BY T1.company_id
SQL: SELECT T1.name , T2.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid ORDER BY T2.balance Asc LIMIT 1
Feedback: in step 1 , it should be checking instead of savings
Output: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T3.balance LIMIT 1
SQL: SELECT T1.Customer_ID FROM Customers AS T1 EXCEPT SELECT T2.Customer_ID FROM Policies AS T2
Feedback: should show customer details instead of customer id as they question is asking about the names
Output: SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id
SQL: SELECT name , Count ( * ) FROM genres GROUP BY name ORDER BY Count ( * ) Desc LIMIT 5
Feedback: should find genres of tracks
Output: SELECT T1.name ,  COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id  =  T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5
SQL: SELECT T1.Customer_Details FROM Customers AS T1 JOIN Policies AS T2 ON T1.Customer_ID = T2.Customer_ID JOIN Claim_Headers AS T3 ON T2.Policy_ID = T3.Policy_ID GROUP BY T1.Customer_ID ORDER BY Sum ( T3.Amount_Claimed ) Desc LIMIT 1
Feedback: in step 2 , remove the summation of amount claimed
Output: SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id  =  t2.policy_id JOIN customers AS t3 ON t2.customer_id  =  t3.customer_id WHERE t1.amount_claimed  =  (SELECT max(amount_claimed) FROM claim_headers)
SQL: SELECT milliseconds FROM tracks
Feedback: should find unit price of tracks whose name equals Fast As a Shark
Output: SELECT unit_price FROM tracks WHERE name = "Fast As a Shark"
SQL: SELECT title FROM albums ORDER BY title Asc
Feedback: make sure title starts with A
Output: SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title
SQL: SELECT Sum ( duration ) , Sum ( duration ) FROM trip WHERE bike_id = 636
Feedback: Replace second "summation of duration" with "maximum duration".
Output: SELECT sum(duration) ,  max(duration) FROM trip WHERE bike_id  =  636
SQL: SELECT Avg ( long ) , Avg ( long ) FROM station WHERE city = "San Jose"
Feedback: It should be latitude in place of one of the longitude .
Output: SELECT avg(lat) ,  avg(long) FROM station WHERE city  =  "San Jose"
SQL: SELECT Rank , Market_Value , Profits_billion FROM company WHERE Sales_billion = "Banking" ORDER BY Sales_billion Asc
Feedback: Replace profits billion with company , first sales billion with main industry , also add profits billion with sales billion .
Output: SELECT rank ,  company ,  market_value FROM company WHERE main_industry  =  'Banking' ORDER BY sales_billion ,  profits_billion
SQL: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id WHERE T2.first_name = "Nancy" AND T2.last_name = "Edwards"
Feedback: Discard the last part and add reports to equal Nancy Edwards .
Output: SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards"
SQL: SELECT zip_code FROM weather WHERE zip_code = 94107 GROUP BY zip_code ORDER BY Count ( * ) Desc LIMIT 3
Feedback: Replace zip code with cloud cover in step 2.
Output: SELECT cloud_cover FROM weather WHERE zip_code  =  94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3
SQL: SELECT Avg ( Age ) FROM Student WHERE Sex = "F" AND Sex = "F"
Feedback: Replace Last sex equals F with sex equals M .
Output: SELECT avg(age) ,  sex FROM Student GROUP BY sex
SQL: SELECT Pilot_name , Count ( * ) FROM pilot GROUP BY Pilot_name
Feedback: Make sure to count number of pilot's records too .
Output: SELECT T2.Pilot_name ,  COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID  =  T2.pilot_ID GROUP BY T2.Pilot_name
SQL: SELECT T2.Claim_Status_Description FROM Claim_Headers AS T1 JOIN Claims_Processing_Stages AS T2 WHERE T1.Claim_Status_Code = "Open"
Feedback: Replace claim status code with claim status name .
Output: SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name  =  "Open"
SQL: SELECT start_date FROM trip EXCEPT SELECT start_date FROM trip WHERE zip_code = 94107
Feedback: Replace start date with date of weather , step 1 events equal foggy or rained , step 3 replace butnot with and .
Output: SELECT date FROM weather WHERE zip_code  =  94107 AND EVENTS != "Fog" AND EVENTS != "Rain"
SQL: SELECT Count ( * ) FROM aircraft
Feedback: Replace aircraft table with pilot table .
Output: SELECT count(*) FROM pilot
SQL: SELECT Avg ( T2.duration ) FROM station AS T1 JOIN trip AS T2 WHERE T1.city ! = "Palo Alto"
Feedback: Replace trip table with status table , duration with bikes available .
Output: SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city  =  "Palo Alto")
SQL: SELECT zip_code FROM weather GROUP BY zip_code ORDER BY Avg ( min_humidity ) Asc LIMIT 1
Feedback: Replace min humidity with mean sea level pressure inches .
Output: SELECT zip_code FROM weather GROUP BY zip_code ORDER BY avg(mean_sea_level_pressure_inches) LIMIT 1
SQL: SELECT name , city , long FROM station ORDER BY long Asc LIMIT 1
Feedback: Replace events with date for both .
Output: SELECT name ,  lat ,  city FROM station ORDER BY lat LIMIT 1
SQL: SELECT T1.name , T2.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid ORDER BY T2.balance Asc LIMIT 1
Feedback: Make sure to find CHECKING's balance .
Output: SELECT T2.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T3.balance LIMIT 1
SQL: SELECT T1.title , T1.phone , T1.hire_date FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id WHERE T1.first_name = "Nancy" AND T2.last_name = "Edwards"
Feedback: In step 2 , replace customers with employees .
Output: SELECT title ,  phone ,  hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"
SQL: SELECT name , Count ( * ) FROM ACCOUNTS GROUP BY custid
Feedback: Replace customer id with name , also need to find corresponding checking accounts from checking table .
Output: SELECT count(*) ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid GROUP BY T1.name
SQL: SELECT * FROM candidate
Feedback: Replace candidate table with people table .
Output: SELECT * FROM people
SQL: SELECT Company , Main_Industry FROM company EXCEPT SELECT Company , Main_Industry FROM company
Feedback: Make sure it does not have gas station
Output: SELECT company ,  main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)
SQL: SELECT T1.roomName , T2.LastName , T2.CheckIn FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room ORDER BY T2.Rate Desc LIMIT 1
Feedback: Need to use rate instead of last name , also need to find check out .
Output: SELECT T2.roomName ,  T1.Rate ,  T1.CheckIn ,  T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1
SQL: SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING Avg ( T2.bikes_available ) > 14
Feedback: Or make sure stations must have installed bikes in December .
Output: SELECT T1.name ,  T1.id FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available)  >  14 UNION SELECT name ,  id FROM station WHERE installation_date LIKE "12/%"
SQL: SELECT Count ( * ) FROM Allergy_Type
Feedback: There should be student table instead of allergy name table .
Output: SELECT count(*) FROM Student
SQL: SELECT name FROM station WHERE long < -121.90178200000001 AND city = "San Jose" UNION SELECT name FROM station WHERE long > 10 AND city = "San Jose"
Feedback: Need to find bikes available instead of longitude and city does not equals San Jose .
Output: SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available)  >  10 EXCEPT SELECT name FROM station WHERE city  =  "San Jose"
SQL: SELECT Min ( Company ) , Max ( Market_Value ) , Avg ( Market_Value ) FROM company
Feedback: Replace minimum company with minimum market value .
Output: SELECT min(market_value) ,  max(market_value) ,  avg(market_value) FROM company
SQL: SELECT T1.name , T2.start_station_id FROM station AS T1 JOIN trip AS T2 WHERE T2.start_date = "8/%" GROUP BY T2.start_station_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace name with start station name and start date equals August .
Output: SELECT start_station_name ,  start_station_id FROM trip WHERE start_date LIKE "8/%" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT roomName FROM Rooms WHERE basePrice < 2 INTERSECT SELECT roomName FROM Rooms WHERE basePrice > 160
Feedback: Replace base price with beds in step 1 , replace greater with smaller
Output: SELECT roomName FROM Rooms WHERE basePrice  <  160 AND beds =  2 AND decor  =  'modern'
SQL: SELECT name FROM tracks EXCEPT SELECT name FROM tracks
Feedback: In step 1 , name of tracks whose playlists is movies and step 2 , whose playlists is music .
Output: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Music'
SQL: SELECT Count ( * ) FROM invoices WHERE billing_city = "Chicago"
Feedback: also add billing city equals IL .
Output: SELECT COUNT(*) FROM invoices WHERE billing_city  =  "Chicago" AND billing_state  =  "IL"
SQL: SELECT T2.Name , T2.Sex FROM candidate AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Unsure_rate Desc LIMIT 1
Feedback: It should be support rate in place of unsure rate .
Output: SELECT t1.name ,  t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id ORDER BY t2.support_rate DESC LIMIT 1
SQL: SELECT T1.Customer_Details FROM Customers AS T1 JOIN Policies AS T2 ON T1.Customer_ID = T2.Customer_ID JOIN Claim_Headers AS T3 ON T2.Policy_ID = T3.Policy_ID WHERE T3.Claim_Status_Code = "Deputy"
Feedback: Replace claim status code to policy type code .
Output: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "Deputy"
SQL: SELECT first_name , last_name FROM employees
Feedback: also need to find total number of people reporting to them .
Output: SELECT T2.first_name , T2.last_name ,  count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1
SQL: SELECT Sex FROM Student GROUP BY Sex ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace sex in Students table with allergy of has allergy table .
Output: SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1
SQL: SELECT zip_code FROM weather GROUP BY zip_code HAVING Avg ( min_sea_level_pressure_inches ) < 10
Feedback: Replace min sea level pressure inches with mean visibility miles .
Output: SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_visibility_miles)  <  10
SQL: SELECT Sex , Count ( * ) FROM Student GROUP BY Sex
Feedback: Need to find number of students with allergy
Output: SELECT Allergy ,  count(*) FROM Has_allergy GROUP BY Allergy
SQL: SELECT start_date , duration FROM trip ORDER BY duration Asc LIMIT 1
Feedback: Find day when gap of max min temperature is smallest , also note difference of temperature .
Output: SELECT date ,  max_temperature_f - min_temperature_f FROM weather ORDER BY max_temperature_f - min_temperature_f LIMIT 1
SQL: SELECT bike_id FROM trip GROUP BY bike_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: consider only trips in zip code equals 94002.
Output: SELECT bike_id FROM trip WHERE zip_code  =  94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM sqlite_sequence WHERE seq = "Billy Cobham"
Feedback: Need to find albums released by Billy Cobam
Output: SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Billy Cobham"
SQL: SELECT Major FROM Student WHERE Age > 20
Feedback: Find stuid instead of major .
Output: SELECT StuID FROM Student WHERE age  >  20
SQL: SELECT Avg ( Age ) , Max ( Age ) FROM artist WHERE Country = "United States"
Feedback: Need to replace maximum with minimum .
Output: SELECT avg(age) ,  min(age) FROM artist WHERE country  =  'United States'
SQL: SELECT DISTINCT Fname , city_code FROM Student WHERE Sex = "Cat" OR Sex = "Milk"
Feedback: Need to replace sex with first name for both of has allergy table .
Output: SELECT DISTINCT T1.fname ,  T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid  =  T2.stuid WHERE T2.Allergy  =  "Milk" OR T2.Allergy  =  "Cat"
SQL: SELECT T1.name FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid WHERE T2.balance > 200000
Feedback: make sure checking customer id greater than savings customer id .
Output: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T2.balance  >  T3.balance
SQL: SELECT Dependent_name FROM dependent
Feedback: Make sure to find names of dependent with spouse employee relation .
Output: SELECT Dependent_name FROM dependent WHERE relationship  =  'Spouse'
SQL: SELECT T1.id , T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING Count ( * ) > 12
Feedback: Replace station id with bikes available .
Output: SELECT DISTINCT T1.id ,  T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id WHERE T2.bikes_available  >  12
SQL: SELECT Major FROM Student ORDER BY Age Asc LIMIT 1
Feedback: Replace major with stuid , replace smallest with largest .
Output: SELECT StuID FROM Student WHERE age  =  (SELECT max(age) FROM Student)
SQL: SELECT T1.name FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid WHERE T2.balance > ( SELECT Avg ( T2.balance ) FROM SAVINGS AS T2 )
Feedback: step 2 , checking table instead of savings table . Step 3 , balance of checking table instead of name .
Output: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  >  (SELECT avg(balance) FROM savings))
SQL: SELECT T2.Name FROM candidate AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Unsure_rate < 0.2
Feedback: There should be support rate instead of unsure rate and oppose rate instead of 0. 2.
Output: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t2.support_rate  <  t2.oppose_rate
SQL: SELECT Sum ( T2.Adults ) FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room WHERE T1.roomName = "2010-10-23" AND T2.LastName = "SELBIG" AND T2.LastName = "CONRAD"
Feedback: There should be check in date instead of room name and first name equals SELBIG .
Output: SELECT Adults FROM Reservations WHERE CheckIn  =  "2010-10-23" AND FirstName  =  "CONRAD" AND LastName  =  "SELBIG"
SQL: SELECT T3.Fname , T3.Sex FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T1.Allergy = "Cat" AND T1.AllergyType = "Milk"
Feedback: Make sure allergy not equals Cat , replace allergy type allergy type with allergy .
Output: SELECT fname ,  sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy  =  "Cat")
SQL: SELECT custid , name FROM ACCOUNTS WHERE name < "Brown"
Feedback: Remove last part . and make sure customer checking balance is not more than highest checking balance .
Output: SELECT T1.custid ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  <  (SELECT max(balance) FROM checking)
SQL: SELECT title FROM albums
Feedback: Need to make sure those albums are of Aerosmith .
Output: SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Aerosmith"
SQL: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock"
Feedback: Also need to make sure that the media type equals MPEG .
Output: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file"
SQL: SELECT Count ( * ) , zip_code FROM trip GROUP BY zip_code
Feedback: Make sure to find number of rows when max wind speed mph equals 25.
Output: SELECT zip_code , count(*) FROM weather WHERE max_wind_Speed_mph  >=  25 GROUP BY zip_code
SQL: SELECT Count ( * ) FROM Reservations WHERE LastName = "ROY"
Feedback: Replace last name with first name , also need to add last name equals SWEAZY with "and".
Output: SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY"
SQL: SELECT T1.name , T2.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid ORDER BY T2.balance Desc
Feedback: Make sure only top 3 accounts are needed .
Output: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T2.balance DESC LIMIT 3
SQL: SELECT Name , Count ( * ) FROM artist GROUP BY Name
Feedback: In place of name in artist table , there should be exhibition id in exhibition table .
Output: SELECT T2.name ,  count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id
SQL: SELECT start_date FROM trip ORDER BY duration Desc LIMIT 1
Feedback: Replace start date with id , duration with dock count .
Output: SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id  =  T2.id ORDER BY T2.dock_count DESC LIMIT 1
SQL: SELECT T2.Name , Count ( * ) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID GROUP BY T1.Representative_ID
Feedback: Also need to find party name .
Output: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party
SQL: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Movies" INTERSECT SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Music"
Feedback: Replace genres's name with playlists's name in both step 2 and 4.
Output: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id  =  T2.track_id JOIN playlists AS T3 ON T2.playlist_id  =  T3.id WHERE T3.name  =  'Music'
SQL: SELECT Count ( * ) FROM Student WHERE Sex = "Cat"
Feedback: Replace student with has allergy , replace sex with allergy .
Output: SELECT count(*) FROM Has_allergy WHERE Allergy  =  "Cat"
SQL: SELECT Fname , LName FROM Student WHERE Sex = "F"
Feedback: Also need to find ages for student .
Output: SELECT Fname ,  Lname ,  Age FROM Student WHERE Sex  =  'F'
SQL: SELECT T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T2.genre_id HAVING Sum ( T2.milliseconds ) > 100
Feedback: Need to find playlist list .
Output: SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id)  >  100
SQL: SELECT start_date FROM trip WHERE duration > 384 AND duration > 60
Feedback: Replace start date with id , duration with average mean temperature of weather , include zip code and omit last part .
Output: SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code  =  T2.zip_code GROUP BY T2.zip_code HAVING avg(T2.mean_temperature_f)  >  60
SQL: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id WHERE T2.name LIKE "Led"
Feedback: Need to make sure name is from artist table .
Output: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%'
SQL: SELECT T1.name FROM station AS T1 EXCEPT SELECT T1.name FROM station AS T1 JOIN trip AS T2 WHERE T1.city = "Palo Alto" AND T2.duration > 100
Feedback: Remove step 4 , and replace duration with end station name , end station name less than or equal to 100.
Output: SELECT name FROM station WHERE city  =  "Palo Alto" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING count(*)  >  100
SQL: SELECT T1.Theme FROM exhibition AS T1 JOIN exhibition_record AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Attendance > 100 INTERSECT SELECT T1.Theme FROM exhibition AS T1 JOIN exhibition_record AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Attendance < 500
Feedback: step 2: attendance less than 100 and step 4:Attendance greater than 500.
Output: SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  <  100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  500
SQL: SELECT T2.Name , T2.Sex FROM candidate AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Oppose_rate > 0.43
Feedback: Need to find oppose rate of candidate . No need of greater than part .
Output: SELECT t1.name ,  t1.sex ,  min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id GROUP BY t1.sex
SQL: SELECT T1.title FROM albums AS T1 JOIN media_types AS T2 JOIN tracks AS T3 ON T1.id = T3.album_id AND T3.media_type_id = T2.id WHERE T2.name = "Balls to the Wall"
Feedback: Replace "media types's name" with "tracks's name".
Output: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall"
SQL: SELECT Company , Sales_billion FROM company ORDER BY Sales_billion Desc LIMIT 1
Feedback: Replace sales billion with main industry and find largest value of market value instead of sales billion .
Output: SELECT main_industry ,  count(*) FROM company GROUP BY main_industry ORDER BY sum(market_value) DESC LIMIT 1
SQL: SELECT Major FROM Student GROUP BY Major HAVING Count ( * ) > = 2
Feedback: Replace major with stuid , and find allergy in has allergy instead of major in student table .
Output: SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*)  >=  2
SQL: SELECT city , Max ( long ) FROM station GROUP BY city
Feedback: Replace longitude with latitude .
Output: SELECT city ,  max(lat) FROM station GROUP BY city
SQL: SELECT T1.decor FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room WHERE T2.CheckIn = "TRACHSEL" AND T2.LastName = "SELBIG" INTERSECT SELECT T1.decor FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room WHERE T2.FirstName = "2010-09-21" AND T2.LastName = "DAMIEN"
Feedback: Find kids instead of decor , check in equals 2010 09 21 , whose full name equals DAMIEN TRACHSEL .
Output: SELECT Kids FROM Reservations WHERE CheckIn  =  "2010-09-21" AND FirstName  =  "DAMIEN" AND LastName  =  "TRACHSEL"
SQL: SELECT T1.roomName , T1.decor FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room WHERE T1.basePrice > 160 AND T2.Adults > 2
Feedback: There should be room id instead of decor .
Output: SELECT roomName ,  RoomId FROM Rooms WHERE basePrice  >  160 AND maxOccupancy  >  2
SQL: SELECT T2.Location , T2.Representative_Name FROM company AS T1 JOIN gas_station AS T2 JOIN station_company AS T3 ON T1.Company_ID = T3.Company_ID AND T3.Station_ID = T2.Station_ID ORDER BY T1.Market_Value Desc LIMIT 3
Feedback: Replace market value by assets billion .
Output: SELECT T3.location ,  T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3
SQL: SELECT T1.name , T1.name , T2.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid ORDER BY T2.balance Desc
Feedback: Show balance of saving and checking . Order descending with summation of checking and savings balances
Output: SELECT T2.balance ,  T3.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance + T3.balance DESC
SQL: SELECT Count ( * ) FROM trip WHERE start_date = "Mountain View" AND end_date = "Palo Alto"
Feedback: Make sure start point is Mountain View name and end point is Palo Alto name .
Output: SELECT count(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id  =  T2.start_station_id AND T2.id  =  T4.id AND T3.id  =  T4.end_station_id WHERE T1.city  =  "Mountain View" AND T3.city  =  "Palo Alto"
SQL: SELECT billing_state , Count ( * ) FROM invoices GROUP BY billing_state
Feedback: Make sure to find number of rows of invoices .
Output: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state
SQL: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock"
Feedback: Make sure they are on MPEG audio files .
Output: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" AND T3.name = "MPEG audio file"
SQL: SELECT Claim_Outcome_Code FROM Claims_Processing GROUP BY Claim_Outcome_Code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace claim outcome code with claim status name in claims processing stages for both .
Output: SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id  =  t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T1.id FROM station AS T1 WHERE T1.long > 37.4 INTERSECT SELECT T2.station_id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T1.long < 7
Feedback: Replace longitude with latitude , step 3: Replace longitude with bikes available , make sure more than or quals 7 bike available .
Output: SELECT id FROM station WHERE lat  >  37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available)  <  7
SQL: SELECT DISTINCT T1.first_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id WHERE T2.first_name = "Eduardo" AND T2.last_name = "Martins"
Feedback: Replace employees's first name with customers's company .
Output: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"
SQL: SELECT Count ( * ) FROM Allergy_Type
Feedback: Need to count number of students , also make sure allergy name equals food .
Output: SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy  =  T2.allergy WHERE T2.allergytype  =  "food"
SQL: SELECT zip_code , min_dew_point_f FROM weather WHERE min_visibility_miles > 80
Feedback: Replace min dew point f with date and min visibility miles greater than 80" with max temperature f equals 80".
Output: SELECT date ,  zip_code FROM weather WHERE max_temperature_f  >=  80
SQL: SELECT Avg ( duration ) , start_date FROM trip GROUP BY zip_code
Feedback: Replace trip table with weather table and duration with mean temperature f , Make sure specific for august .
Output: SELECT zip_code  ,  avg(mean_temperature_f) FROM weather WHERE date LIKE "8/%" GROUP BY zip_code
SQL: SELECT * , T2.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid WHERE T1.name = "Brown"
Feedback: Also need to add checking table with savings .
Output: SELECT T2.balance ,  T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T1.name  =  'Brown'
SQL: SELECT T1.Customer_Details FROM Customers AS T1 JOIN Policies AS T2 ON T1.Customer_ID = T2.Customer_ID ORDER BY T2.End_Date Desc LIMIT 1
Feedback: Replace end date with start date .
Output: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.start_date  =  (SELECT max(start_date) FROM policies)
SQL: SELECT LName , Age FROM Student WHERE Sex = "Milk" INTERSECT SELECT LName , Age FROM Student WHERE Sex = "Cat"
Feedback: Replace sex with allergy in both steps .
Output: SELECT lname ,  age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy  =  "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy  =  "Cat")
SQL: SELECT Count ( * ) FROM exhibition WHERE Year > 2004 OR Year > 2005
Feedback: There should be year equals 2005 instead of greater than 2004.
Output: SELECT count(*) FROM exhibition WHERE YEAR  >=  2005
SQL: SELECT first_name , last_name FROM employees GROUP BY first_name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace first name in employees table with support rep id in customers .
Output: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id  =  T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Name FROM people WHERE Height > 190 OR Height > 200
Feedback: Replace "Height greater than 190" with "Height less than 190".
Output: SELECT name FROM people WHERE height  >  200 OR height  <  190
SQL: SELECT Count ( * ) FROM Rooms
Feedback: Make sure to find number of beds for which bed Type equals king .
Output: SELECT sum(beds) FROM Rooms WHERE bedtype  =  'King'
SQL: SELECT T1.decor FROM Rooms AS T1 JOIN Reservations AS T2 ON T1.RoomId = T2.Room GROUP BY T2.Room ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Need to find highest number of reservations instead of decor .
Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T1.name , T2.start_station_name FROM station AS T1 JOIN trip AS T2 GROUP BY T2.start_station_id ORDER BY Count ( * ) Asc LIMIT 3
Feedback: Replace name with the end station name .
Output: SELECT start_station_name ,  end_station_name FROM trip ORDER BY id LIMIT 3
SQL: SELECT Company FROM company
Feedback: In place of company , it should be main industry .
Output: SELECT DISTINCT main_industry FROM company
SQL: SELECT DISTINCT Participant_ID FROM Participants_in_Events
Feedback: Make sure participants attended at least one event .
Output: SELECT count(DISTINCT participant_id) FROM participants_in_Events
SQL: SELECT * FROM Allergy_Type AS T1 EXCEPT SELECT T2.StuID FROM Student AS T2
Feedback: Replace allergy name table with has allergy table and interchange words step 1 and step 2 in step 3.
Output: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy
SQL: SELECT balance FROM SAVINGS ORDER BY balance Desc LIMIT 1
Feedback: Make sure the highest balance should be of checking table .
Output: SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance DESC LIMIT 1
SQL: SELECT start_station_id FROM trip ORDER BY duration Asc LIMIT 1
Feedback: Replace start station id with id .
Output: SELECT id FROM trip ORDER BY duration LIMIT 1
SQL: SELECT name , Count ( * ) FROM genres GROUP BY name
Feedback: Make sure to find total number of tracks .
Output: SELECT count(*) ,  T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name
SQL: SELECT Count ( * ) FROM Claim_Headers WHERE Claim_Type_Code = "Handphone Subsidy"
Feedback: Need to find total number of claim stage id in claims processing stages instead of claim type code equals Handphone Subsidy .
Output: SELECT count(*) FROM claims_processing_stages
SQL: SELECT billing_state FROM invoices GROUP BY billing_state ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Make sure state is one of the US country .
Output: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT T1.Customer_ID FROM Customers AS T1 JOIN Policies AS T2 ON T1.Customer_ID = T2.Customer_ID JOIN Claim_Headers AS T3 ON T2.Policy_ID = T3.Policy_ID WHERE T3.Claim_Status_Code = "Uniform" OR T3.Claim_Status_Code = "Deputy"
Feedback: Replace customer id with customer details and claim status code of claim headers with policy type code of policies table .
Output: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "Deputy" OR t1.policy_type_code  =  "Uniform"
SQL: SELECT Candidate_ID , Unsure_rate , Oppose_rate FROM candidate ORDER BY Unsure_rate Asc
Feedback: Replace candidate id with support rate , unsure rate with consider rate .
Output: SELECT Support_rate ,  Consider_rate ,  Oppose_rate FROM candidate ORDER BY unsure_rate
SQL: SELECT T1.name , Avg ( T2.duration ) FROM station AS T1 JOIN trip AS T2 GROUP BY T2.start_station_id
Feedback: need to final longitude of station as well
Output: SELECT T1.name ,  T1.long ,  avg(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id GROUP BY T2.start_station_id
SQL: SELECT Count ( * ) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T2.StuID = T3.StuID WHERE T3.Sex = "F" OR T1.AllergyType = "Milk"
Feedback: Replace "or" between sex and allergy name with "and" , make sure allergy name equals Milk or egg
Output: SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.sex  =  "F" AND T1.allergy  =  "Milk" OR T1.allergy  =  "Eggs"
SQL: SELECT date FROM weather ORDER BY min_humidity Desc LIMIT 5
Feedback: There should be cloud cover instead of min humidity and also find cloud cover rates .
Output: SELECT date ,  cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5
SQL: SELECT T1.seq FROM sqlite_sequence AS T1 JOIN tracks AS T2 WHERE T2.name = "Fast As a Shark"
Feedback: Need to replace name with composer .
Output: SELECT composer FROM tracks WHERE name = "Fast As a Shark"
SQL: SELECT Count ( DISTINCT Sex ) FROM Student
Feedback: Replace sex with first name , student table with allergy name table .
Output: SELECT count(DISTINCT allergytype) FROM Allergy_type
SQL: SELECT city , Count ( * ) FROM employees WHERE city = "IT Staff" GROUP BY city
Feedback: Replace city with title in 1st step , also need to find numbers of employees .
Output: SELECT count(*) ,  city FROM employees WHERE title  =  'IT Staff' GROUP BY city
SQL: SELECT T1.name , T3.balance FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid JOIN CHECKING AS T3 ON T1.custid = T3.custid ORDER BY T2.balance Asc LIMIT 1
Feedback: Remove CHECKING's customer id and make sure to find addition of SAVING's and CHECKING's customer id .
Output: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance + T3.balance LIMIT 1
SQL: SELECT roomName , decor FROM Rooms ORDER BY basePrice Asc LIMIT 1
Feedback: Replace decor with base price .
Output: SELECT roomName ,  basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1
SQL: SELECT date FROM weather WHERE min_temperature_f > 85
Feedback: Replace min temperature f with max temperature f .
Output: SELECT date FROM weather WHERE max_temperature_f  >  85
SQL: SELECT T2.Location FROM company AS T1 JOIN gas_station AS T2 JOIN station_company AS T3 ON T1.Company_ID = T3.Company_ID AND T3.Station_ID = T2.Station_ID WHERE T1.Sales_billion > 100
Feedback: Replace sales billion with market value .
Output: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id  =  T2.company_id JOIN gas_station AS T3 ON T1.station_id  =  T3.station_id WHERE T2.market_value  >  100
SQL: SELECT DISTINCT name FROM station EXCEPT SELECT DISTINCT name FROM station
Feedback: Remove step 2 and 3 , and make sure station had or have 7 bikes available .
Output: SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id WHERE T2.bikes_available  =  7
SQL: SELECT Position FROM pilot WHERE Join_Year > 2000 INTERSECT SELECT Position FROM pilot WHERE Join_Year < 2005
Feedback: Make sure join year less than 2000 and greater than 2005.
Output: SELECT POSITION FROM pilot WHERE Join_Year	 <  2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year	 >  2005
SQL: SELECT Count ( * ) FROM Student WHERE Age > 18 AND Sex = "food" EXCEPT SELECT Sex FROM Student WHERE Age > 18
Feedback: find allergy name not quals to food or animal instead of sex , remove step 2 and 3.
Output: SELECT count(*) FROM Student WHERE age  >  18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy  =  T2.Allergy WHERE T2.allergytype  =  "food" OR T2.allergytype  =  "animal")
SQL: SELECT name FROM tracks
Feedback: Replace tracks with playlists .
Output: SELECT name FROM playlists
SQL: SELECT T1.id , T1.name FROM station AS T1 JOIN trip AS T2 WHERE T2.duration > = 200
Feedback: Replace station with trip , name with start station name .
Output: SELECT start_station_id ,  start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*)  >=  200
SQL: SELECT Customer_Details FROM Customers GROUP BY Customer_Details ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Make sure the customer has maximum number of policies .
Output: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Event_ID , Event_Details FROM Events GROUP BY Event_ID HAVING Count ( * ) > 1
Feedback: Replace event id in events table with event id in participants in events .
Output: SELECT T1.event_id ,  T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID  =  T2.Event_ID GROUP BY T1.Event_ID HAVING count(*)  >  1
SQL: SELECT Count ( * ) FROM Allergy_Type
Feedback: Make sure it has allergy type equal to animal .
Output: SELECT count(*) FROM Allergy_type WHERE allergytype  =  "animal"
SQL: SELECT Sum ( total ) , Sum ( total ) FROM invoices
Feedback: Replace "summation of total with number of rows of invoices table .
Output: SELECT billing_state ,  COUNT(*) ,  SUM(total) FROM invoices WHERE billing_state  =  "CA"