niryuu/sni-each-converted huggingface dataset:
SQL: SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING Count ( * ) > 3 UNION SELECT product_id FROM Product_Suppliers WHERE total_value_purchased < 80000
Feedback: In step 1 swap product suppliers with order items , in step 3 total amount purchased should be greater than 80000.
Output: SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*)  >  3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased)  >  80000
SQL: SELECT cName FROM College WHERE enr > 13000 INTERSECT SELECT cName FROM College WHERE enr < 15000
Feedback: Step 1 greater than 15000 with state equals LA , step 2 less than 13000 with state equals AZ .
Output: SELECT cName FROM College WHERE enr  <  13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr  >  15000 AND state = "LA"
SQL: SELECT title FROM film WHERE title LIKE "Deleted Scenes"
Feedback: It should be special features contains Deleted Scenes" instead of "title contains Deleted Scenes".
Output: SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'
SQL: SELECT T2.Name FROM program AS T1 JOIN channel AS T2 JOIN broadcast AS T3 ON T1.Program_ID = T3.Program_ID AND T3.Channel_ID = T2.Channel_ID WHERE T1.Origin ! = "Beijing"
Feedback: The "channel's Name" is wrong . Use "program's Name" instead .
Output: SELECT name FROM program WHERE origin != 'Beijing'
SQL: SELECT Count ( * ) , Brand FROM Medication GROUP BY Brand
Feedback: It should corresponds to number of rows of each value of medication medication in prescribes table .
Output: SELECT count(*) ,  T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
SQL: SELECT attribute_name , attribute_id FROM Attribute_Definitions
Feedback: Make sure attribute value equals 0.
Output: SELECT t1.attribute_name ,  t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id  =  t2.attribute_id WHERE t2.attribute_value  =  0
SQL: SELECT country FROM circuits WHERE lat > "09:00:00" OR lat < "12:00:00"
Feedback: Substitute altitude with status , circuits with races , both "lat" with "time".
Output: SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
SQL: SELECT customer_name , customer_address FROM Customers GROUP BY customer_id HAVING Count ( * ) = "New" INTERSECT SELECT customer_name , customer_address FROM Customers GROUP BY customer_id HAVING Count ( * ) < "Pending"
Feedback: Search Customers' supplier name and product type code for which date assigned from equals New and Pending both .
Output: SELECT T1.customer_name ,  T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "New" INTERSECT SELECT T1.customer_name ,  T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "Pending"
SQL: SELECT T2.dept_name FROM department AS T1 JOIN course AS T2 ON T1.dept_name = T2.dept_name ORDER BY T1.budget Desc LIMIT 3
Feedback: In step 2 find number of rows of each value of course 's department name in descending order .
Output: SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3
SQL: SELECT Count ( * ) FROM budget WHERE Invested > 8.5
Feedback: Find number of rows endowment for which school id appears more than once . Replace invested with amount .
Output: SELECT count(*) FROM (SELECT * FROM endowment WHERE amount  >  8.5 GROUP BY school_id HAVING count(*)  >  1)
SQL: SELECT Name FROM Genre GROUP BY Name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 1 exchange name with genre id , and genre table with track table .
Output: SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT state_province_county , country FROM Addresses WHERE zip_postcode = "4%"
Feedback: Be sure that zip postcode starting with 4.
Output: SELECT state_province_county ,  country FROM addresses WHERE zip_postcode LIKE "4%"
SQL: SELECT T2.product_name , T1.other_characteristic_details , T2.product_description FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T2.product_category_code = "Herbs"
Feedback: Rather than product characteristics table use reference colors table in step 1 , Instead of other characteristic details use color description in step 2.
Output: SELECT T1.product_name ,  T2.color_description ,  T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code  =  T2.color_code WHERE product_category_code  =  "Herbs"
SQL: SELECT Name , Price FROM Products ORDER BY Price Desc LIMIT 1
Feedback: Ensure to find for each manufacturer along with Manufacturers's name ahead of name , price .
Output: SELECT T1.Name ,  max(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name
SQL: SELECT Fname FROM Student WHERE city_code = "Smith Hall"
Feedback: first name should be Smith Hall , not student id .
Output: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.dorm_name  =  'Smith Hall'
SQL: SELECT Count ( * ) FROM flight
Feedback: Find number of rows of distinct price in certificate table .
Output: SELECT count(DISTINCT eid) FROM Certificate
SQL: SELECT Avg ( distance ) , Avg ( price ) FROM flight
Feedback: Confirming that origin equals Los Angeles .
Output: SELECT avg(distance) ,  avg(price) FROM Flight WHERE origin  =  "Los Angeles"
SQL: SELECT customer_id , other_customer_details FROM Customers ORDER BY date_became_customer Asc LIMIT 1
Feedback: Exchange customer id , other customer details , customers table with channel code , contact number , customer contact channels and find largest value of difference between active from date and active to date .
Output: SELECT channel_code ,  contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date  =  (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
SQL: SELECT Count ( * ) FROM actor
Feedback: Find number of rows of distinct language id in film table .
Output: SELECT count(DISTINCT language_id) FROM film
SQL: SELECT student_id FROM Students
Feedback: Ensure student id should be present in student course attendance table or student course registrations table .
Output: SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
SQL: SELECT Service_Type_Description , Service_Type_Code FROM Ref_Service_Types GROUP BY Service_Type_Code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 1 replace service type code with service id , drama workshop groups table with Service table .
Output: SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code  =  T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Accounts
Feedback: Remove accounts table and Use customers table instead of it .
Output: SELECT count(*) FROM Customers
SQL: SELECT T1.catalog_name FROM Catalogs AS T1 JOIN Catalog_Structure AS T2 ON T1.catalog_id = T2.catalog_id JOIN Catalog_Contents AS T3 ON T2.catalog_level_number = T3.catalog_level_number ORDER BY T3.height Asc LIMIT 1
Feedback: Put capacity in place of height .
Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1
SQL: SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY Count ( * ) Desc LIMIT 3
Feedback: In step 1 and 2 replace supplier id with product id .
Output: SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3
SQL: SELECT Party FROM party GROUP BY Party ORDER BY Count ( * ) Desc LIMIT 1
Feedback: There should be governor , not party in step 1.
Output: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT T1.Name FROM program AS T1 WHERE T1.Program_ID NOT IN ( SELECT T2.Program_ID FROM broadcast_share AS T2 )
Feedback: In step 1 Substitute broadcast share table with broadcast table and for which time of day equals morning .
Output: SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Morning"
SQL: SELECT T1.dorm_name FROM Dorm AS T1 EXCEPT SELECT T1.dorm_name FROM Dorm AS T1 JOIN Dorm_amenity AS T2 JOIN Has_amenity AS T3 ON T1.dormid = T3.dormid AND T3.amenid = T2.amenid WHERE T2.amenity_name = "Study Room"
Feedback: Ensure amenity name equals TV Lounge in step 1.
Output: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'
SQL: SELECT DISTINCT customer_name FROM Customers
Feedback: Also add Products' product name equals keyboard which purchased by customers .
Output: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id JOIN products AS T4 ON T3.product_id  =  T4.product_id WHERE T4.product_name  =  "keyboard"
SQL: SELECT Major , Count ( * ) FROM Student GROUP BY Major
Feedback: Need to find number of distinct major and distinct city code for each student .
Output: SELECT count(DISTINCT major) ,  count(DISTINCT city_code) FROM student
SQL: SELECT T1.characteristic_type_description FROM Ref_Characteristic_Types AS T1 JOIN Characteristics AS T2 ON T1.characteristic_type_code = T2.characteristic_type_code WHERE T2.characteristic_name = "catnip"
Feedback: Change reference characteristic types table , characteristics table , characteristic type description , characteristic name to products table , reference colors table , color description and product name .
Output: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code WHERE t1.product_name  =  "catnip"
SQL: SELECT T2.product_type_code , T2.product_name , T2.product_price FROM Suppliers AS T1 JOIN Products AS T2 JOIN Product_Suppliers AS T3 ON T1.supplier_id = T3.supplier_id AND T3.product_id = T2.product_id WHERE T1.supplier_name = 3
Feedback: Use supplier id rather than supplier name in step 2.
Output: SELECT T2.product_type_code ,  T2.product_name ,  T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  3
SQL: SELECT customer_name FROM Customers WHERE payment_method = "Latte" INTERSECT SELECT customer_name FROM Customers WHERE payment_method = "Americano"
Feedback: Both payment method are to be replaced by product details , verify that customer has bought Latte and Americano .
Output: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id JOIN products AS t4 ON t3.product_id  =  t4.product_id WHERE t4.product_details  =  'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id JOIN products AS t4 ON t3.product_id  =  t4.product_id WHERE t4.product_details  =  'Americano'
SQL: SELECT Avg ( student_capacity ) , Min ( student_capacity ) FROM Dorm WHERE gender = "X"
Feedback: Replace " minimum student capacity with "total student capacity".
Output: SELECT avg(student_capacity) ,  sum(student_capacity) FROM dorm WHERE gender  =  'X'
SQL: SELECT characteristic_name FROM Characteristics GROUP BY characteristic_data_type ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Replace characteristic data type , characteristics table with characteristic id , product characteristics in step 1.
Output: SELECT t3.characteristic_name 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 GROUP BY t3.characteristic_name ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Ref_Characteristic_Types
Feedback: Exchange reference characteristic types with characteristics .
Output: SELECT count(*) FROM CHARACTERISTICS
SQL: SELECT Park FROM roller_coaster ORDER BY Height Desc LIMIT 1
Feedback: Exchange height with speed .
Output: SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
SQL: SELECT Event FROM wrestler GROUP BY Event ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Use reign in place of event In step 1 and 2.
Output: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT name FROM student ORDER BY tot_cred Desc LIMIT 1
Feedback: Make sure department name equals History .
Output: SELECT name FROM student WHERE dept_name  =  'History' ORDER BY tot_cred DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Characteristics WHERE characteristic_name = "red"
Feedback: Ensure for the product corresponding Ref Colors's color description equals red and product characteristics product characteristic value equals slow .
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 JOIN ref_colors AS t4 ON t1.color_code  =  t4.color_code WHERE t4.color_description  =  "red" AND t3.characteristic_name  =  "slow"
SQL: SELECT T2.name FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid GROUP BY T1.src_apid ORDER BY Count ( * ) Desc LIMIT 10
Feedback: Instead of airports table use airlines table in step 1. Replace source airport with airline in step 2.
Output: SELECT T1.name ,  T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10
SQL: SELECT T3.Name FROM Playlist AS T1 JOIN PlaylistTrack AS T2 ON T1.PlaylistId = T2.PlaylistId JOIN Track AS T3 ON T2.TrackId = T3.TrackId WHERE T1.Name LIKE "you"
Feedback: In step 2 supersede playlist with track .
Output: SELECT Name FROM TRACK WHERE Name LIKE '%you%'
SQL: SELECT Count ( DISTINCT name ) FROM instructor
Feedback: Be sure that instructor's id should be present in teaches table .
Output: SELECT COUNT (DISTINCT id) FROM teaches
SQL: SELECT Count ( * ) FROM storm
Feedback: Assure that number deaths doesn't have null value .
Output: SELECT count(*) FROM storm WHERE Number_Deaths  >  0
SQL: SELECT name , Count ( * ) FROM aircraft GROUP BY name
Feedback: It should display number of corresponding rows for each airline id in flight table .
Output: SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid
SQL: SELECT T1.Location FROM party AS T1 JOIN party_host AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T2.Party_ID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: It should be party 's number of hosts in place of party host 's party id in step 2.
Output: SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
SQL: SELECT T2.Name , T2.Position FROM Physician AS T1 JOIN Nurse AS T2 JOIN Appointment AS T3 ON T1.EmployeeID = T3.Physician AND T3.PrepNurse = T2.EmployeeID GROUP BY T1.Position ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Check for department 's head who has smallest number of physician and nurse working under him or her .
Output: SELECT T2.name ,  T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head  =  T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1
SQL: SELECT T1.name FROM student AS T1 EXCEPT SELECT T1.name FROM department AS T2 JOIN course AS T3 ON T3.dept_name = T2.dept_name JOIN student AS T1 ON T2.dept_name = T1.dept_name WHERE T3.dept_name = "Biology"
Feedback: Change department table with takes classes table in Step 2.
Output: SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id  =  T2.course_id WHERE T2.dept_name  =  'Biology')
SQL: SELECT T1.semester FROM section AS T1 JOIN takes AS T2 ON T1.year = T2.year WHERE T2.year ! = 2010
Feedback: Substitute semester with course id , Ensure it equals semester fall and year 2009 , not equals semester Spring .
Output: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 EXCEPT SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
SQL: SELECT Governor , Count ( * ) FROM party GROUP BY Comptroller ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 2 , Only need to find comptroller not each value of comptroller .
Output: SELECT Comptroller ,  COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT T1.Code , T2.Name , T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID
Feedback: Exchange second name with fate in step 2.
Output: SELECT T1.Code ,  T1.Fate ,  T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID  =  T2.Ship_ID
SQL: SELECT BlockCode , Count ( * ) FROM Room GROUP BY BlockCode
Feedback: Find different Room's block code with number of corresponding rows to each value in room room table .
Output: SELECT count(*) ,  T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockcode
SQL: SELECT DISTINCT Name FROM Nurse
Feedback: Change nurse nurse table with department department table and Verify it's corresponding value of primary affiliation equals 1.
Output: SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation  =  1
SQL: SELECT catalog_entry_name FROM Catalog_Contents ORDER BY price_in_pounds Desc LIMIT 1
Feedback: The required parameter is price in dollars , not price in pounds .
Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1
SQL: SELECT product_id , product_description FROM Products GROUP BY product_id HAVING Count ( * ) > = 2
Feedback: Exchange products table with product characteristics table in step 1 , and need to find color description not product description .
Output: SELECT t1.product_id ,  t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code JOIN product_characteristics AS t3 ON t1.product_id  =  t3.product_id GROUP BY t1.product_id HAVING count(*)  >=  2
SQL: SELECT Comptroller , Party FROM party
Feedback: Swap comptroller with election's delegate .
Output: SELECT T1.Delegate ,  T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID
SQL: SELECT T2.product_name FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T1.characteristic_name = "red"
Feedback: Put reference colors instead of product characteristics table , replace characteristic name with color description , mention that characteristic name equals fast .
Output: SELECT product_name 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 JOIN ref_colors AS t4 ON t1.color_code  =  t4.color_code WHERE t4.color_description  =  "red" AND t3.characteristic_name  =  "fast"
SQL: SELECT T1.County FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T2.State ORDER BY Count ( * ) Desc LIMIT 1
Feedback: wine's state is wrong . Take appellations's county in place of it in step 3.
Output: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T2.Score  >  90 GROUP BY T1.County ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T1.FacID FROM Faculty AS T1 EXCEPT SELECT T2.FacID FROM Faculty_Participates_in AS T2
Feedback: In step 2 ensure corresponding value of is faculty id present under Student's advisor .
Output: SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student
SQL: SELECT Count ( * ) FROM MediaType WHERE Name = "MPEG audio file" AND Name = "AAC audio file"
Feedback: Find number of rows in track table whose corresponding MediaType's name equals AAC audio file .
Output: SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId  =  T2.MediaTypeId WHERE T1.Name  =  "AAC audio file"
SQL: SELECT Count ( * ) FROM people WHERE Height > 1.84
Feedback: Calculate summation of killed of perpetrator table for people id whose height greater than 1. 84.
Output: SELECT sum(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Height  >  1.84
SQL: SELECT cName FROM College ORDER BY cName Asc
Feedback: Find player name of player table in ascending ordered whose player id present in tryout table .
Output: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID ORDER BY T1.pName
SQL: SELECT T1.card_type_code , Count ( * ) FROM Customers_Cards AS T1 JOIN Financial_Transactions AS T2 ON T1.card_id = T2.card_id GROUP BY T2.transaction_type
Feedback: Change transaction type with card type code , Ensure that number of corresponding rows to each value of customers cards table .
Output: SELECT card_type_code ,  count(*) FROM Customers_cards GROUP BY card_type_code
SQL: SELECT catalog_entry_name FROM Catalog_Contents WHERE parent_entry_id > 8
Feedback: Supersede parent entry id with next entry id .
Output: SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id  >  8
SQL: SELECT Name FROM member EXCEPT SELECT Name FROM member
Feedback: Find the name of member table whose member id present in membership register branch table in step 2.
Output: SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch)
SQL: SELECT T1.role_description FROM Roles AS T1 JOIN Users AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Specify that users ' user login equals 1.
Output: SELECT role_description FROM ROLES WHERE role_code  =  (SELECT role_code FROM users WHERE user_login  =  1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)
SQL: SELECT Count ( * ) FROM program
Feedback: Ensure to find distinct channel's owner instead of program table .
Output: SELECT count(DISTINCT OWNER) FROM channel
SQL: SELECT product_type_code FROM Products WHERE product_price > ( SELECT Avg ( product_price ) FROM Products )
Feedback: In step 2 find product type code whose average product price larger than step 1 's results .
Output: SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_price)  >  (SELECT avg(product_price) FROM products)
SQL: SELECT eid , salary FROM employee
Feedback: Be certain name equals Mark Young .
Output: SELECT eid ,  salary FROM Employee WHERE name  =  'Mark Young'
SQL: SELECT City FROM branch WHERE Open_year = 100 INTERSECT SELECT City FROM branch WHERE membership_amount > 2001
Feedback: Find city which membership amount greater than 100 and open year equals 2001.
Output: SELECT city FROM branch WHERE open_year  =  2001 AND membership_amount  >  100
SQL: SELECT T1.supplier_name , T1.supplier_phone FROM Suppliers AS T1 JOIN Products AS T2 JOIN Product_Suppliers AS T3 ON T1.supplier_id = T3.supplier_id AND T3.product_id = T2.product_id ORDER BY T2.product_name Asc
Feedback: Change product suppliers table , products table and product name to addresses table , supplier addresses table and date supplied to respectively .
Output: SELECT T1.supplier_name ,  T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN addresses AS T3 ON T2.address_id  =  T3.address_id ORDER BY T3.address_details
SQL: SELECT name FROM enzyme WHERE Chromosome ! = "Heme"
Feedback: Exchange chromosome with product .
Output: SELECT name FROM enzyme WHERE product != 'Heme'
SQL: SELECT * FROM Procedures WHERE Cost > 5000
Feedback: Find name of physician physician who trained in a procedure which cost greater than 5000.
Output: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T3.cost  >  5000
SQL: SELECT email , last_update FROM customer WHERE first_name = "LINDA" AND last_name = "SMITH"
Feedback: Omit last update and last name equals SMITH . Not only find email but also find address , address 2 , district .
Output: SELECT T2.address ,  T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id  =  T1.address_id WHERE T1.first_name  =  'LINDA'
SQL: SELECT Days_held FROM wrestler GROUP BY Days_held ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Substitute days held , wrestler table with time , elimination table in step 2.
Output: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1
SQL: SELECT product_category_code , typical_selling_price FROM Products WHERE typical_buying_price = "cumin"
Feedback: Add typical buying price and Take product name equals cumin instead of typical buying price equals cumin".
Output: SELECT product_category_code ,  typical_buying_price FROM products WHERE product_name  =  "cumin"
SQL: SELECT characteristic_name FROM Characteristics WHERE characteristic_type_code = "sesame"
Feedback: product name should be sesame not characteristic type code . Verify that characteristic type code equals 'Grade' as well .
Output: SELECT t3.characteristic_name 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  =  "sesame" AND t3.characteristic_type_code  =  "Grade"
SQL: SELECT Count ( DISTINCT Party_Theme ) FROM party
Feedback: Find the number of rows in party table .
Output: SELECT count(*) FROM party
SQL: SELECT Name FROM Physician WHERE Name = "Thesisin"
Feedback: Find name of physician physician table who prescribes medication medication for which name equals Thesisin .
Output: SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name  =  "Thesisin"
SQL: SELECT Season , Competition , Home_team FROM game
Feedback: The required parameter is away team not competition .
Output: SELECT season ,  home_team ,  away_team FROM game
SQL: SELECT T1.title , T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T2.inventory_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Add rental table in step 1 and confirm to find rental's inventory id in step 2.
Output: SELECT T1.title ,  T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id JOIN rental AS T3 ON T2.inventory_id  =  T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Customers WHERE customer_first_name = "Art" AND customer_last_name = "Turcotte"
Feedback: accounts table should be use in place of customers table .
Output: SELECT count(*) FROM Accounts 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 T2.Name FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Price < 50 AND T1.County = "Sonoma" AND T1.County = "Monterey"
Feedback: no need to find county equals Sonoma so remove it .
Output: SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  "Monterey" AND T2.price  <  50
SQL: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = "Duke" OR T2.College = "Maryland"
Feedback: Discard country name and include official native language instead .
Output: SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.College  =  "Maryland" OR T2.College  =  "Duke"
SQL: SELECT name , distance FROM aircraft WHERE distance BETWEEN 8430 AND 5000
Feedback: Ensure count of airline id in certificate table is minimum 5 , find all whose distance above 5000.
Output: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5
SQL: SELECT Player_name , Sponsor_name FROM player ORDER BY Votes Desc
Feedback: Use player name rather than sponsor name .
Output: SELECT T3.Player_name ,  T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID  =  T2.Coach_ID JOIN player AS T3 ON T1.Player_ID  =  T3.Player_ID ORDER BY T3.Votes DESC
SQL: SELECT first_name , last_name FROM customer ORDER BY create_date Asc LIMIT 1
Feedback: It should use rental rate in place of create date .
Output: SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
SQL: SELECT Avg ( price_in_dollars ) , Max ( price_in_pounds ) FROM Catalog_Contents
Feedback: Exchange price in dollars with price in euros , maximum with minimum , price in pounds with price in euros .
Output: SELECT avg(price_in_euros) ,  min(price_in_euros) FROM catalog_contents
SQL: SELECT T1.Name FROM track AS T1 WHERE T1.Track_ID NOT IN ( SELECT T2.Track_ID FROM race AS T2 WHERE T2.Class = "GT" )
Feedback: Remove "of track table" phrase from step .
Output: SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id WHERE T1.class  =  'GT'
SQL: SELECT StuID FROM Student WHERE Age = 18 INTERSECT SELECT StuID FROM Student WHERE Age = 20
Feedback: Find Student's student id student id those are present in participates in table and age less than 20.
Output: SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age  <  20
SQL: SELECT Count ( * ) FROM captain
Feedback: Swap captain table with ship table .
Output: SELECT count(*) FROM ship
SQL: SELECT Count ( * ) FROM Attribute_Definitions
Feedback: Find result from attribute definitions table is totally wrong use catalog contents table instead of attribute definitions table .
Output: SELECT count(*) FROM catalog_contents
SQL: SELECT Avg ( Price ) FROM wine WHERE State ! = "Sonoma"
Feedback: county should be take instead of state .
Output: SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  'Sonoma')
SQL: SELECT T1.catalog_name , T1.date_of_publication FROM Catalogs AS T1 JOIN Catalog_Structure AS T2 ON T1.catalog_id = T2.catalog_id JOIN Catalog_Contents AS T3 ON T2.catalog_level_number = T3.catalog_level_number WHERE T3.price_in_pounds > 5
Feedback: Exchange price in pounds with catalog level number in step 2.
Output: SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  5
SQL: SELECT T1.Name FROM storm AS T1 JOIN region AS T2 JOIN affected_region AS T3 ON T1.Storm_ID = T3.Storm_ID AND T3.Region_id = T2.Region_id WHERE T2.Region_code = "Denmark"
Feedback: region name equals Denmark , not region code .
Output: SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id JOIN storm AS T3 ON T1.storm_id  =  T3.storm_id WHERE T2.region_name  =  'Denmark'
SQL: SELECT title FROM course
Feedback: Also indicate that course's prerequisite course name equals Differential Geometry .
Output: SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id  =  T2.course_id WHERE T2.title  =  'Differential Geometry')
SQL: SELECT Count ( * ) FROM Addresses WHERE city = "Lake Geovannyton"
Feedback: Instead of addresses table , Use customers table .
Output: SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t3.city  =  "Lake Geovannyton"
SQL: SELECT T1.supplier_name , Avg ( T2.total_value_purchased ) FROM Suppliers AS T1 JOIN Product_Suppliers AS T2 ON T1.supplier_id = T2.supplier_id GROUP BY T1.supplier_name ORDER BY Avg ( T2.total_value_purchased ) Desc LIMIT 1
Feedback: Count number of rows for supplier id in product suppliers table , find average total amount purchased , total value purchased for highest count .
Output: SELECT avg(total_amount_purchased) ,  avg(total_value_purchased) FROM Product_Suppliers WHERE supplier_id  =  (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1)
SQL: SELECT Count ( * ) FROM Physician WHERE Name = "John Dorian"
Feedback: Find number of rows of prescribes table whose corresponding Physician's name equals John Dorian
Output: SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN  =  T2.patient JOIN physician AS T3 ON T2.physician  =  T3.employeeid WHERE T3.name = "John Dorian"
SQL: SELECT title , film_id FROM film GROUP BY film_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: There should be inventory table instead of film table in step 1.
Output: SELECT T1.title ,  T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Customers WHERE other_customer_details = "Second time"
Feedback: Interchange customers table with customer orders table and other customer details with order details .
Output: SELECT count(*) FROM customer_orders WHERE order_details  =  "Second time"
SQL: SELECT city FROM Addresses EXCEPT SELECT city FROM Addresses
Feedback: In step 2 , need to mention that customer id should present in customer addresses table .
Output: SELECT city FROM addresses WHERE city NOT IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id)
SQL: SELECT T2.Name , T2.Area , T2.Population FROM roller_coaster AS T1 JOIN country AS T2 ON T1.Country_ID = T2.Country_ID WHERE T1.Speed > 60 INTERSECT SELECT T2.Name , T2.Area , T2.Population FROM roller_coaster AS T1 JOIN country AS T2 ON T1.Country_ID = T2.Country_ID WHERE T1.Speed = 55
Feedback: Need to find for country who has two roller coasters with highest speed .
Output: SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  >  60 INTERSECT SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  <  55
SQL: SELECT Count ( * ) FROM actor
Feedback: Show distinct rating of film table .
Output: SELECT count(DISTINCT rating) FROM film
SQL: SELECT Min ( Order_Quantity ) , Max ( Order_Quantity ) , Avg ( Order_Quantity ) FROM Invoice_Items
Feedback: invoice items table is wrong . Take invoices table in place of it .
Output: SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES
SQL: SELECT Avg ( strength ) FROM Player_Attributes
Feedback: Interchange strength with weight , player attributes table with player table .
Output: SELECT avg(weight) FROM Player
SQL: SELECT Sum ( Budgeted ) FROM budget WHERE Year = "Glenn"
Feedback: Instead of year use school name .
Output: SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn'
SQL: SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno LIKE 99
Feedback: Confirm that flight number equals 99 not flight number contains 99.
Output: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T1.flno  =  99
SQL: SELECT DISTINCT T1.Name FROM wrestler AS T1 JOIN Elimination AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Team ! = "Tokyo , Japan"
Feedback: reign and location should be used instead of name and team respectively .
Output: SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan"
SQL: SELECT Count ( * ) FROM country WHERE country = "Australia"
Feedback: Find number of rows in city table whose country id's corresponding country's country equals Australia .
Output: SELECT count(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id  =  T2.country_id WHERE T2.country  =  'Australia'
SQL: SELECT Count ( * ) FROM flight
Feedback: Use aircraft table on behalf of flight table .
Output: SELECT count(*) FROM Aircraft
SQL: SELECT T2.interaction_type FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T1.name = "ALA synthase" AND T1.Porphyria = "Aripiprazole"
Feedback: In step 1 , include medicine table , mention that enzyme's name equals ALA synthase and medicine's name equals Aripiprazole .
Output: SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id  =  T2.id JOIN enzyme AS T3 ON T1.enzyme_id  =  T3.id WHERE T3.name  =  'ALA synthase' AND T2.name  =  'Aripiprazole'
SQL: SELECT T2.player_name FROM Player_Attributes AS T1 JOIN Player AS T2 ON T1.player_fifa_api_id = T2.player_fifa_api_id WHERE T1.overall_rating < 90 INTERSECT SELECT T2.player_name FROM Player_Attributes AS T1 JOIN Player AS T2 ON T1.player_fifa_api_id = T2.player_fifa_api_id WHERE T1.overall_rating < 85
Feedback: Satisfy overall rating less than 90 and greater than 85 in step 2 , preferred foot equals left in step 3.
Output: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot  =  "left" AND T2.overall_rating  >=  85 AND T2.overall_rating  <=  90
SQL: SELECT Name FROM Physician
Feedback: Make sure Physicians have took any employee id .
Output: SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
SQL: SELECT T2.building , T2.room_number , T2.year FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = "Psychology" ORDER BY T1.title Asc
Feedback: Also find room number , semester , year along with building .
Output: SELECT T2.building ,  T2.room_number ,  T2.semester ,  T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id  =  T2.course_id WHERE T1.dept_name  =  'Psychology' ORDER BY T1.title
SQL: SELECT Draft_Class , Season FROM match_season WHERE Position = "Defender"
Feedback: It should be draft pick number , not season .
Output: SELECT Draft_Pick_Number ,  Draft_Class FROM match_season WHERE POSITION  =  "Defender"
SQL: SELECT catalog_name FROM Catalogs GROUP BY catalog_name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 1 , change catalog name in catalogs to catalog entry id in catalog contents additional attributes , instep 2 find catalog entry name of catalog contents table instead .
Output: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.attribute_value  =  (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)
SQL: SELECT Position FROM player WHERE Points > 20
Feedback: Need to confirm that average points greater than 20.
Output: SELECT POSITION FROM player GROUP BY name HAVING avg(Points)  >=  20
SQL: SELECT Count ( * ) FROM Dorm WHERE gender = "M"
Feedback: Need to find for summation of total students living in dorm whose gender equals M .
Output: SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.gender  =  'M'
SQL: SELECT Name FROM wine WHERE Grape = "Red" INTERSECT SELECT Name FROM wine WHERE Price > 50
Feedback: Replace grape with grapes' color in step 1.
Output: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "Red" AND T2.price  >  50
SQL: SELECT * FROM player WHERE Player LIKE "English"
Feedback: Ensure to use country's official native language in place of player table and Exchange player with official native language .
Output: SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%"
SQL: SELECT Sum ( T1.Revenue ) , T2.Manufacturer FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer GROUP BY T2.Manufacturer
Feedback: Be sure to find name of manufacturer instead of manufacturer .
Output: SELECT sum(revenue) ,  name FROM manufacturers GROUP BY name
SQL: SELECT Avg ( followers ) FROM user_profiles
Feedback: Make sure to find for users who have corresponding email in tweets table .
Output: SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)
SQL: SELECT Count ( * ) FROM city
Feedback: Find the number of rows of distinct status .
Output: SELECT count(DISTINCT Status) FROM city
SQL: SELECT Name FROM Physician GROUP BY Name HAVING Count ( * ) > 1
Feedback: Change name in physician physician table with pcp in patient patient table .
Output: SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid HAVING count(*)  >  1
SQL: SELECT staff_id , staff_name FROM Staff GROUP BY staff_id ORDER BY Count ( * ) Asc LIMIT 1
Feedback: In step 1 for each staff id in staff department assignments , find difference between date assigned to and date assigned from .
Output: SELECT T1.staff_id ,  T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1
SQL: SELECT id , market_share FROM browser ORDER BY market_share Asc LIMIT 1
Feedback: Remove "with smallest value of market share". Ensure browser's name equals Safari .
Output: SELECT id ,  market_share FROM browser WHERE name  =  'Safari'
SQL: SELECT Nickname FROM university WHERE Enrollment < ( SELECT Avg ( Enrollment ) FROM university )
Feedback: nickname of university table is wrong . It should be team name of basketball match table .
Output: SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE enrollment  <  (SELECT avg(enrollment) FROM university)
SQL: SELECT T1.Name FROM channel AS T1 JOIN broadcast AS T2 ON T1.Channel_ID = T2.Channel_ID ORDER BY T2.Time_of_day Asc
Feedback: Change channel table with program table in step 1 and time of day with launch .
Output: SELECT name FROM program ORDER BY launch
SQL: SELECT Max ( Silver ) , Min ( Gold ) FROM club_rank
Feedback: The minimum silver is the right term , not minimum gold .
Output: SELECT max(Silver) ,  min(Silver) FROM club_rank
SQL: SELECT Count ( * ) FROM Physician
Feedback: Exchange physician physician table with appointment appointment table .
Output: SELECT count(*) FROM appointment
SQL: SELECT Avg ( T2.Order_Quantity ) FROM Invoices AS T1 JOIN Invoice_Items AS T2 ON T1.Invoice_ID = T2.Invoice_ID WHERE T1.payment_method_code = "MasterCard"
Feedback: The required parameter is Invoices' order quantity , not Invoice Items's order quantity in step 2.
Output: SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code  =  "MasterCard"
SQL: SELECT Count ( * ) FROM Ref_Characteristic_Types AS T1 JOIN Characteristics AS T2 ON T1.characteristic_type_code = T2.characteristic_type_code WHERE T2.characteristic_name = "white" OR T1.characteristic_type_description = "hot"
Feedback: Add characteristics in step 1 , exchange reference characteristic types table with products table , characteristic name with color description , characteristic type description with characteristic 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 JOIN ref_colors AS t4 ON t1.color_code  =  t4.color_code WHERE t4.color_description  =  "white" OR t3.characteristic_name  =  "hot"
SQL: SELECT Name FROM Products WHERE Price > 150 OR Manufacturer < 5
Feedback: Display manufacturers name whose products' average price equals or greater than $ 150.
Output: SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150
SQL: SELECT DISTINCT city FROM Addresses
Feedback: Ensure to find city only for students .
Output: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id
SQL: SELECT T1.Name FROM Physician AS T1 JOIN Medication AS T2 JOIN Prescribes AS T3 ON T1.EmployeeID = T3.Physician AND T3.Medication = T2.Code WHERE T2.Name = "Procrastin-X"
Feedback: Need to find Nurse's name whose corresponding employee id is present in Undergoes's assisting nurse .
Output: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID
SQL: SELECT T2.pName , T1.cName FROM College AS T1 JOIN Player AS T2 JOIN Tryout AS T3 ON T1.cName = T3.cName AND T3.pID = T2.pID
Feedback: Also satisfy Tryout's decision equals yes .
Output: SELECT T1.pName ,  T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID  =  T2.pID WHERE T2.decision  =  'yes'
SQL: SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T1.origin = "John Williams"
Feedback: Add employee table in step 1 , interchange origin with employee's name , ensure employee's employee id present in certificate table .
Output: SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T1.name  =  "John Williams"
SQL: SELECT id , name , Porphyria FROM enzyme ORDER BY Porphyria Desc
Feedback: Find id , name and fda approved of medicine table ordered descending by medicine id , Ensure that fda approved equals Yes .
Output: SELECT T1.id ,  T1.Name ,  T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id ORDER BY count(*) DESC
SQL: SELECT staff_name FROM Staff
Feedback: Confirm that count of staff id is more than one time in staff department assignments table .
Output: SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id GROUP BY T2.staff_id HAVING COUNT (*)  >  1
SQL: SELECT DISTINCT T2.Name FROM Physician AS T1 JOIN Nurse AS T2 JOIN Appointment AS T3 ON T1.EmployeeID = T3.Physician AND T3.PrepNurse = T2.EmployeeID ORDER BY T1.Name Asc
Feedback: It should be Nurse's name , not Physician's name in step 2.
Output: SELECT DISTINCT name FROM nurse ORDER BY name
SQL: SELECT Count ( * ) FROM Artist WHERE Name = "Metallica"
Feedback: It should be album table in place of artist table .
Output: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "Metallica"
SQL: SELECT date_of_publication FROM Catalogs GROUP BY catalog_name HAVING Count ( * ) > 1
Feedback: Interchange catalog name with date of latest revision .
Output: SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*)  >  1
SQL: SELECT T1.id , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T2.stadium_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: The game table and stadium id must be replaced by injury accident table and injury accident's id .
Output: SELECT T1.id ,  T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id  =  T2.stadium_id JOIN injury_accident AS T3 ON T2.id  =  T3.game_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Institution WHERE Type = "Private" OR Founded > 1880
Feedback: Rather than institution table , Use protein table .
Output: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id WHERE T1.founded  >  1880 OR T1.type  =  'Private'
SQL: SELECT protein_name , common_name FROM protein
Feedback: Instead of common name use Institution's institution .
Output: SELECT T2.protein_name ,  T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id
SQL: SELECT id , Trade_Name FROM medicine GROUP BY id HAVING Count ( * ) > = 3
Feedback: Use medicine id in medicine enzyme interaction table in place of id in medicine table in step 1.
Output: SELECT T1.id ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id HAVING COUNT(*)  >=  3