niryuu/sni-each-converted huggingface dataset:
SQL: SELECT Sex FROM Student WHERE Sex = "F" GROUP BY Sex ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 2 change sex with advisor , Number of rows that correspond of each value of sex .
Output: SELECT Major FROM STUDENT WHERE Sex  =  "F" GROUP BY major ORDER BY count(*) DESC LIMIT 1
SQL: SELECT country , Count ( * ) FROM airports GROUP BY country
Feedback: find name , country from airlines table , ensure each rows correspond airline id of routes table .
Output: SELECT T1.country ,  T1.name ,  count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T1.country ,  T1.name
SQL: SELECT document_name , access_count FROM Documents ORDER BY document_name Asc
Feedback: Change document name , access count , documents table and document name to image name , image url , images table and image name respectively .
Output: SELECT image_name ,  image_url FROM images ORDER BY image_name
SQL: SELECT DISTINCT LName FROM Student WHERE Advisor = 8741
Feedback: Ensure that those student have president votes .
Output: SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor  =  "8741"
SQL: SELECT T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.rating < 1000
Feedback: Find song id instead of formats whose formats is mp 4 and resolution less than 1000.
Output: SELECT f_id FROM files WHERE formats  =  "mp4" INTERSECT SELECT f_id FROM song WHERE resolution  <  1000
SQL: SELECT order_id , customer_id FROM Orders ORDER BY customer_id Desc LIMIT 1
Feedback: Need to find smallest value of date order placed .
Output: SELECT order_id ,  customer_id FROM orders ORDER BY date_order_placed LIMIT 1
SQL: SELECT T2.hotel_id , T1.star_rating_description , T2.price_range FROM Ref_Hotel_Star_Ratings AS T1 JOIN Hotels AS T2 ON T1.star_rating_code = T2.star_rating_code ORDER BY T2.price_range Asc
Feedback: star rating description and 1st price range are not needed , find star rating code instead of that .
Output: SELECT hotel_id ,  star_rating_code FROM HOTELS ORDER BY price_range ASC
SQL: SELECT StuID FROM Student WHERE Advisor = "Professor"
Feedback: The students' advisor should be a faculty whose rank equals Professor .
Output: SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID  =  T2.advisor WHERE T1.rank  =  "Professor"
SQL: SELECT FirstName , LastName FROM list WHERE FirstName = "OTHA"
Feedback: Ensure last name is MOYER and first name and last name both are in corresponding teachers table .
Output: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER"
SQL: SELECT T1.Artwork_ID , T1.Name FROM artwork AS T1 JOIN nomination AS T2 ON T1.Artwork_ID = T2.Artwork_ID GROUP BY T2.Festival_ID HAVING Count ( * ) > = 2
Feedback: Change artwork table with festival detail table and artwork id , name with festival id , festival name .
Output: SELECT T1.Festival_ID ,  T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID  =  T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID  =  T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*)  >=  2
SQL: SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 900
Feedback: Change rating with resolution , ensure that those artists have release 1 or more than 1 song .
Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.resolution  >  900 GROUP BY T2.artist_name HAVING count(*)  >=  1
SQL: SELECT Count ( * ) , Grade FROM list GROUP BY Grade
Feedback: Also find number of class room and total number of distinct students for that grade .
Output: SELECT grade ,  count(DISTINCT classroom) ,  count(*) FROM list GROUP BY grade
SQL: SELECT Count ( * ) FROM Student WHERE Major = "NYC"
Feedback: student id should be used instead advisor , election cycle equals spring , student id is registered as class senator vote in voting record .
Output: SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  Class_Senator_Vote WHERE T1.city_code  =  "NYC" AND T2.Election_Cycle  =  "Spring"
SQL: SELECT Count ( * ) FROM routes
Feedback: Should only find for routes which are operated by airlines's name equals American airline .
Output: SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid WHERE T1.name  =  'American Airlines'
SQL: SELECT train_number , time FROM train ORDER BY time Asc
Feedback: It should satisfy one condition which is destination should be equal to Chennai .
Output: SELECT TIME ,  train_number FROM train WHERE destination  =  'Chennai' ORDER BY TIME
SQL: SELECT Classroom FROM list WHERE Grade = 4 ORDER BY Classroom Asc
Feedback: Omit the condition "ordered ascending by Classroom".
Output: SELECT DISTINCT classroom FROM list WHERE grade  =  4
SQL: SELECT Address FROM Locations WHERE Location_Name = "UK Gallery"
Feedback: No need to find address , use other details instead of that .
Output: SELECT Other_Details FROM LOCATIONS WHERE Location_Name  =  "UK Gallery"
SQL: SELECT acc_type , Avg ( no_of_loans ) FROM customer WHERE credit_score < 50 GROUP BY acc_type
Feedback: Ensure to find average account balance instead of number of loans .
Output: SELECT avg(acc_bal) ,  acc_type FROM customer WHERE credit_score  <  50 GROUP BY acc_type
SQL: SELECT Fname , Lname FROM Faculty GROUP BY FacID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Make sure that faculty has a highest student .
Output: SELECT T1.fname ,  T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID  =  T2.advisor GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T2.name FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid GROUP BY T1.airline ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Change airports table with airlines table and code share with icao .
Output: SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Count ( DISTINCT Name ) FROM Tourist_Attractions
Feedback: "Tourist Attractions" table is wrong , instead it should be "Photos" table .
Output: SELECT count(DISTINCT Name) FROM PHOTOS
SQL: SELECT T2.Name , T1.Address FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID GROUP BY T2.Location_ID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Exchange Tourist Attractions's location id with Visits's tourist attraction id in step 2 and address with tourist attraction id .
Output: SELECT T1.Name ,  T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  <=  1
SQL: SELECT email_address , phone_number FROM Customers ORDER BY email_address Asc
Feedback: The order of ascending should be by email address as well as phone number .
Output: SELECT email_address ,  phone_number FROM customers ORDER BY email_address ,  phone_number
SQL: SELECT Count ( * ) FROM train WHERE name = "Express"
Feedback: Make sure that name contains Express .
Output: SELECT count(*) FROM train WHERE name LIKE "%Express%"
SQL: SELECT T2.Fname FROM Faculty_Participates_in AS T1 JOIN Faculty AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID HAVING Count ( * ) > = "Canoeing"
Feedback: In step 2 it should find faculty participates in student id and in step 3 it should apply condition which says corresponding activity name equals to Canoeing or Kayaking .
Output: SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Canoeing' OR T3.activity_name  =  'Kayaking'
SQL: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 7 EXCEPT SELECT T2.artist_name FROM song AS T2 WHERE T2.country = "Bangladesh"
Feedback: In step 3 , change all three "song" to "artist" and in step 4 swap "step 2" and "step 3".
Output: SELECT DISTINCT artist_name FROM artist WHERE country  =  "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  7
SQL: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer
Feedback: In step 2 Use account type instead of customer name and ensure that account type equals saving .
Output: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type  =  'saving'
SQL: SELECT T2.name , Count ( * ) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid GROUP BY T1.dst_apid ORDER BY Count ( * ) Desc
Feedback: Need to change destination airport id with source airport id in step 2 and destination airport id with name in step 3.
Output: SELECT count(*) ,  T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC
SQL: SELECT Count ( * ) FROM Tourist_Attractions AS T1 WHERE T1.Tourist_Attraction_ID NOT IN ( SELECT T2.Tourist_Attraction_ID FROM Visits AS T2 )
Feedback: In step 1 and 2 exchange tourist attraction id with tourist id , now in step 2 need to replace tourist attractions with visitors .
Output: SELECT count(*) FROM Visitors WHERE Tourist_ID NOT IN ( SELECT Tourist_ID FROM Visits )
SQL: SELECT T1.artist_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.f_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 3 , it should be song's song name not files's artist name and in step 2 , find releasedate for each song .
Output: SELECT song_name ,  releasedate FROM song ORDER BY releasedate DESC LIMIT 1
SQL: SELECT artist_name FROM song WHERE resolution > 500 GROUP BY artist_name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Be certain to find each value of artist name for each languages in step 2.
Output: SELECT artist_name FROM song WHERE resolution  >  500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "walk" OR T1.Address = "660 Shea Crescent"
Feedback: Remove address equals walk and Use how to get there equals walk instead of it .
Output: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "660 Shea Crescent" OR T2.How_to_Get_There  =  "walk"
SQL: SELECT Product_Name , Count ( * ) FROM Products GROUP BY Product_Name
Feedback: It should find number of corresponding rows for each product id in products in events table .
Output: SELECT T1.Product_Name ,  COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID  =  T2.Product_ID GROUP BY T1.Product_Name
SQL: SELECT T3.Visit_Date , T3.Visit_Details FROM Tourist_Attractions AS T1 JOIN Shops AS T2 ON T2.Shop_ID = T1.Tourist_Attraction_ID JOIN Visits AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID WHERE T2.Shop_Details = "Vincent"
Feedback: Add Visitors table in step 1 , use tourist details instead of visit details and tourist details instead of shop details .
Output: SELECT T2.Visit_Date ,  T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID  =  T2.Tourist_ID WHERE T1.Tourist_Details  =  "Vincent"
SQL: SELECT T1.rating , Avg ( T2.rating ) FROM genre AS T1 JOIN song AS T2 ON T1.g_name = T2.genre_is GROUP BY T2.languages
Feedback: no need for step 1. remove genre table
Output: SELECT avg(rating) ,  languages FROM song GROUP BY languages
SQL: SELECT Attraction_Type_Description , Attraction_Type_Code FROM Ref_Attraction_Types GROUP BY Attraction_Type_Code ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 1 find number of rows of each value of attraction type code in tourist attractions table .
Output: SELECT T1.Attraction_Type_Description ,  T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code  =  T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT Count ( * ) FROM Student WHERE Sex = "Fall" AND Sex = "M"
Feedback: Change second "Sex" to election cycle and students must have class senator votes recorded in voting record .
Output: SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  Class_Senator_Vote WHERE T1.Sex  =  "M" AND T2.Election_Cycle  =  "Fall"
SQL: SELECT Avg ( rating ) , Avg ( resolution ) FROM song
Feedback: It should only find for song's languages equals bangla .
Output: SELECT avg(rating) ,  avg(resolution) FROM song WHERE languages  =  "bangla"
SQL: SELECT individual_last_name FROM Individuals
Feedback: Be sure that those individual id has been listed in organization contact individuals .
Output: SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id  =  t2.individual_id
SQL: SELECT Count ( * ) FROM Ref_Hotel_Star_Ratings
Feedback: Substitute hotels table with ref hotel star ratings table , make sure only to find for available hotel .
Output: SELECT count(*) FROM HOTELS
SQL: SELECT Count ( * ) FROM Activity
Feedback: Change activity table with faculty table .
Output: SELECT count(*) FROM Faculty
SQL: SELECT DISTINCT T2.course_name , T1.login_name FROM Students AS T1 JOIN Courses AS T2 JOIN Student_Course_Enrolment AS T3 ON T1.student_id = T3.student_id AND T3.course_id = T2.course_id
Feedback: No need to find course name .
Output: SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students
SQL: SELECT Count ( * ) , Classroom FROM list GROUP BY Classroom
Feedback: It should correspond each value of rows where grade equals to 0.
Output: SELECT classroom ,  count(*) FROM list WHERE grade  =  "0" GROUP BY classroom
SQL: SELECT T2.product_id , T1.customer_id FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.order_id = T2.order_id WHERE T1.order_status_code = "Paid" OR T1.order_status_code = "Cancelled"
Feedback: Ensure to use order shipping charges instead of product id .
Output: SELECT order_shipping_charges ,  customer_id FROM customer_orders WHERE order_status_code  =  'Cancelled' OR order_status_code  =  'Paid'
SQL: SELECT Avg ( T2.price_range ) FROM Ref_Hotel_Star_Ratings AS T1 JOIN Hotels AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.star_rating_description = 5
Feedback: Also determine that pets allowed yn equals 1 along with star rating description equals 5 in step 2.
Output: SELECT avg(price_range) FROM HOTELS WHERE star_rating_code  =  "5" AND pets_allowed_yn  =  1
SQL: SELECT Count ( * ) FROM Student
Feedback: voting record table should be used instead of student table .
Output: SELECT count(*) FROM VOTING_RECORD
SQL: SELECT document_name FROM Documents ORDER BY access_count Asc
Feedback: Remove access count and use document name instead of it .
Output: SELECT document_name ,  access_count FROM documents ORDER BY document_name
SQL: SELECT Sum ( credit_score ) FROM customer WHERE state = "Texas" OR state = "Utah"
Feedback: Here it should find summation of account balance in place of credit score .
Output: SELECT sum(acc_bal) FROM customer WHERE state  =  'Utah' OR state  =  'Texas'
SQL: SELECT name , country , elevation FROM airports WHERE city = "New York"
Feedback: In addition to name , country , elevation , should also find city .
Output: SELECT name ,  city ,  country ,  elevation FROM airports WHERE city  =  'New York'
SQL: SELECT Max ( y ) FROM airports WHERE country = "Iceland"
Feedback: Supplant y with elevation .
Output: SELECT max(elevation) FROM airports WHERE country  =  'Iceland'
SQL: SELECT Name FROM Tourist_Attractions
Feedback: Ensure to satisfy condition that is how to get there equals bus .
Output: SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There  =  "bus"
SQL: SELECT state , Sum ( no_of_loans ) FROM customer WHERE credit_score > 100 GROUP BY state
Feedback: account balance should be used instead of number of loans .
Output: SELECT sum(acc_bal) ,  state FROM customer WHERE credit_score  >  100 GROUP BY state
SQL: SELECT Count ( * ) FROM genre
Feedback: genre table is wrong , use artist table instead of that and ensure that artist's country equals Bangladesh .
Output: SELECT count(*) FROM artist WHERE country  =  "Bangladesh"
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name = "Cathrine" OR personal_name = "Cathrine"
Feedback: Remove "or personal name equals Cathrine" phrase .
Output: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name	 =  "Cathrine"
SQL: SELECT Count ( * ) FROM Addresses
Feedback: Use services table in place of addresses table .
Output: SELECT count(*) FROM services
SQL: SELECT Count ( * ) FROM airports WHERE country = "Italy"
Feedback: Swap airports table with routes table , ensure that destination country is Italy , and airlines's name equals American airlines .
Output: SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid  =  T2.apid JOIN airlines AS T3 ON T1.alid  =  T3.alid WHERE T2.country  =  'Italy' AND T3.name  =  'American Airlines'
SQL: SELECT order_id FROM Order_Items WHERE product_id = 11
Feedback: Ensure to find order item id of order items table .
Output: SELECT order_item_id FROM order_items WHERE product_id = 11
SQL: SELECT Avg ( T2.credit_score ) FROM bank AS T1 JOIN customer AS T2 ON T1.branch_ID = T2.branch_ID WHERE T1.state = "Utah"
Feedback: switch credit score with no of customers .
Output: SELECT avg(no_of_customers) FROM bank WHERE state  =  'Utah'
SQL: SELECT LastName FROM list WHERE Grade = 5
Feedback: Take teachers table instead of list table .
Output: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  5
SQL: SELECT T1.city , T2.cust_name FROM bank AS T1 JOIN customer AS T2 ON T1.branch_ID = T2.branch_ID
Feedback: Use bname instaed of customer name and Verify they are in loan table too .
Output: SELECT T1.bname ,  T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T2.loan_type  =  'Business'
SQL: SELECT T3.date_of_enrolment FROM Subjects AS T1 JOIN Courses AS T2 ON T1.subject_id = T2.subject_id JOIN Student_Course_Enrolment AS T3 ON T2.course_id = T3.course_id WHERE T1.subject_name = "Spanish"
Feedback: course name should be used instead of subject name .
Output: SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id WHERE T1.course_name  =  "Spanish"
SQL: SELECT DISTINCT FirstName FROM list WHERE Grade = 1
Feedback: teachers table should be used in place of list table .
Output: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  1
SQL: SELECT T1.customer_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING Count ( * ) > = 2
Feedback: The word "greater" must be replaced by "less".
Output: SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*)  <=  2
SQL: SELECT T2.FirstName , T2.LastName FROM list AS T1 JOIN teachers AS T2 WHERE T1.FirstName = "EVELINA"
Feedback: In step 2 find teachers's first name , last name of step 1's results who teaches list's first name equals EVELINA and last name equals BROMLEY .
Output: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "EVELINA" AND T1.lastname  =  "BROMLEY"
SQL: SELECT T2.price_range , Avg ( T2.price_range ) FROM Ref_Attraction_Types AS T1 JOIN Hotels AS T2 GROUP BY T1.Attraction_Type_Code
Feedback: Put pets allowed yn in place of attraction type code .
Output: SELECT pets_allowed_yn ,  avg(price_range) FROM HOTELS GROUP BY pets_allowed_yn
SQL: SELECT customer_name FROM Customers GROUP BY customer_name ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Discard customer name in customers table , use Mailshot Customers's customer id in step 1 in place of that .
Output: SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Address FROM Locations
Feedback: Here it is needed to find the tourist details of visitors table .
Output: SELECT Tourist_Details FROM VISITORS
SQL: SELECT DISTINCT Advisor FROM Student WHERE Major = "Fall"
Feedback: It should find secretary vote of voting record table instead of first name of student table and it should be election cycle in place of advisor .
Output: SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE  =  "Fall"
SQL: SELECT g_name FROM genre ORDER BY rating Asc
Feedback: Change rating with genre name and also find rating of genre table .
Output: SELECT g_name ,  rating FROM genre ORDER BY g_name
SQL: SELECT T1.bname FROM bank AS T1 JOIN customer AS T2 ON T1.branch_ID = T2.branch_ID WHERE T2.credit_score < 100
Feedback: Here in step 2 it should also verify that customer has taken loan from that bank .
Output: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100
SQL: SELECT song_name FROM song WHERE rating < ( SELECT Min ( rating ) FROM song )
Feedback: Also Ensure that song song name equals to English in step 2.
Output: SELECT song_name FROM song WHERE rating  <   (SELECT min(rating) FROM song WHERE languages  =  'English')
SQL: SELECT T1.name , T2.network_name FROM train AS T1 JOIN station AS T2 JOIN route AS T3 ON T1.id = T3.train_id AND T3.station_id = T2.id WHERE T2.network_name = "Chiltern"
Feedback: Change network name with time and Use local authority equals Chiltern instead of network name equals Chiltern .
Output: SELECT t3.name ,  t3.time FROM station AS t1 JOIN route AS t2 ON t1.id  =  t2.station_id JOIN train AS t3 ON t2.train_id  =  t3.id WHERE t1.local_authority  =  "Chiltern"
SQL: SELECT product_price FROM Products EXCEPT SELECT product_price FROM Products
Feedback: In step 2 it should find product price of products table whose product id is present in complaints table .
Output: SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints)
SQL: SELECT Count ( * ) FROM genre
Feedback: Find number of rows in files table whose duration is greater than 4. 00
Output: SELECT count(*) FROM files WHERE duration LIKE "4:%"
SQL: SELECT Shop_Details FROM Shops
Feedback: Double check to only find for those for which Tourist Attractions's how to get there equals walk .
Output: SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID  =  T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There  =  "walk"
SQL: SELECT DISTINCT Age FROM Student WHERE Major = "Fall"
Feedback: "Major" is wrong , use "Election Cycle" instead of it , and make sure they have received secretary vote .
Output: SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.Secretary_Vote WHERE T2.Election_Cycle  =  "Fall"
SQL: SELECT Chair_Name , Location FROM festival_detail
Feedback: Substitute festival name with chair name .
Output: SELECT Festival_Name ,  LOCATION FROM festival_detail
SQL: SELECT T1.party_email FROM Parties AS T1 JOIN Party_Forms AS T2 ON T1.party_id = T2.party_id GROUP BY T2.party_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 1 use parties in place of forms , and in step 3 find form name instead party email .
Output: SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id  =  t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT DISTINCT Fname FROM Student WHERE Advisor = 1121 AND Advisor ! = "PIT"
Feedback: Two conditions are to be fulfilled which are student id not equals PIT and Student's student id is present under Voting record's student id with vice president vote .
Output: SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code  =  "PIT"
SQL: SELECT T2.Name , T1.Address FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID GROUP BY T2.Location_ID HAVING Count ( * ) > = 2
Feedback: Change locations table with visits table , Tourist Attractions's location id with Visits's tourist attraction id and address with tourist attraction id .
Output: SELECT T1.Name ,  T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2
SQL: SELECT login_name FROM Students
Feedback: Exchange login name of students table with subject name of subjects table .
Output: SELECT subject_name FROM SUBJECTS
SQL: SELECT Avg ( T2.credit_score ) FROM bank AS T1 JOIN customer AS T2 ON T2.branch_ID = T1.branch_ID JOIN loan AS T3 ON T1.branch_ID = T3.branch_ID WHERE T3.loan_type = "Mortgages"
Feedback: Not only loan type equals Mortgages but also every other loan type in loan table .
Output: SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)
SQL: SELECT T2.course_name , T2.course_description FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.login_name = "Computer Science"
Feedback: Need to put subjects table instead of course authors and tutors table and subject name instead of login name .
Output: SELECT T1.course_name ,  T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id WHERE T2.subject_name  =  "Computer Science"
SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Visit_Details = "Marcelle"
Feedback: Instead of visits table put visitors table , also mention tourist details equals Vincent and Marcelle , remove visit details equals Marcelle .
Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Vincent" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Marcelle"
SQL: SELECT Rank , Count ( * ) FROM Faculty GROUP BY FacID
Feedback: Make sure to find number of rows of student table for each faculty id in student table .
Output: SELECT T1.FacID ,  count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID  =  T2.advisor GROUP BY T1.FacID
SQL: SELECT DISTINCT T1.Fname FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.President_Vote = 1004
Feedback: There is no need of"President Vote equals 1004" , make sure student id appears in voting record table for president vote .
Output: SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.CLASS_Senator_VOTE
SQL: SELECT Count ( * ) FROM list WHERE FirstName = "LORIA" AND LastName = "ONDERSMA"
Feedback: Take teachers table in place of list table .
Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "LORIA" AND T2.lastname  =  "ONDERSMA"
SQL: SELECT Product_Name , Count ( * ) FROM Products GROUP BY Product_Name ORDER BY Count ( * ) Desc
Feedback: In step 1 Change product name in products table with product id in products in events .
Output: SELECT T1.Product_Name ,  COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID  =  T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC
SQL: SELECT f_id FROM song ORDER BY releasedate Desc LIMIT 1
Feedback: We'll have to use duration from files table as opposed to releasedate .
Output: SELECT f_id FROM files ORDER BY duration DESC LIMIT 1
SQL: SELECT artist_name , country FROM song ORDER BY rating Desc LIMIT 3
Feedback: Apply artist's country instead of song's country .
Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.rating DESC LIMIT 3
SQL: SELECT Avg ( T2.access_count ) FROM Functional_Areas AS T1 JOIN Documents AS T2 JOIN Document_Functional_Areas AS T3 ON T1.functional_area_code = T3.functional_area_code AND T3.document_code = T2.document_code WHERE T1.parent_functional_area_code = "Acknowledgement"
Feedback: Supersede functional area description with parent functional area code in step 2.
Output: SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code  =  t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code  =  t3.functional_area_code WHERE t3.functional_area_description  =  "Acknowledgement"
SQL: SELECT Name FROM driver WHERE Home_city = "Hartford" AND Age < 40 INTERSECT SELECT Name FROM driver WHERE Age > 40
Feedback: just show which are in step 1 and not in the step 2 instead of both .
Output: SELECT name FROM driver WHERE home_city  =  'Hartford' AND age  <  40
SQL: SELECT Avg ( * ) FROM artist WHERE gender = "Female"
Feedback: Here it should find average rows in song table whose corresponding artist's song id equals female .
Output: SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female"
SQL: SELECT T1.individual_last_name FROM Individuals AS T1 JOIN Organizations AS T2 JOIN Organization_Contact_Individuals AS T3 ON T1.individual_id = T3.individual_id AND T3.organization_id = T2.organization_id ORDER BY T2.uk_vat_number Desc LIMIT 1
Feedback: In step 2 also ensure that organization contact individuals date contact from is smallest for that specific individuals .
Output: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id  =  t2.organization_id JOIN individuals AS t3 ON t2.individual_id  =  t3.individual_id WHERE t1.uk_vat_number  =  (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1
SQL: SELECT artist_name FROM song ORDER BY rating Asc LIMIT 1
Feedback: The correct parameter is files' duration not rating .
Output: SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id  =  T2.f_id ORDER BY T2.duration LIMIT 1
SQL: SELECT f_id FROM song WHERE resolution > ( SELECT Avg ( resolution ) FROM song )
Feedback: And take care that genre is equals to modern only .
Output: SELECT f_id FROM song WHERE resolution  >  (SELECT avg(resolution) FROM song WHERE genre_is  =  "modern")
SQL: SELECT Fname FROM Faculty
Feedback: Ensure to Add Activity's activity name equals Canoeing and Kayaking for faculty .
Output: SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Kayaking'
SQL: SELECT course_name FROM Courses
Feedback: Also specify that course id of course table should present only one time in student course enrolment table .
Output: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  =  1
SQL: SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name = "love"
Feedback: "song name equals love" is wrong , it should be "song name contains love" instead .
Output: SELECT T1.artist_name ,  T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.song_name LIKE "%love%"
SQL: SELECT state , acc_type , credit_score FROM customer WHERE cust_name = 0
Feedback: substitute number of loans in place of customer name .
Output: SELECT state ,  acc_type ,  credit_score FROM customer WHERE no_of_loans  =  0
SQL: SELECT T1.Artwork_ID , T1.Name , Count ( * ) FROM artwork AS T1 JOIN nomination AS T2 ON T1.Artwork_ID = T2.Artwork_ID GROUP BY T2.Festival_ID
Feedback: Change artwork with festival detail in step 1 , in step 2 find festival id , festival name from festival detail , find number of rows of each value of festival id .
Output: SELECT T1.Festival_ID ,  T3.Festival_Name ,  COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID  =  T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID  =  T3.Festival_ID GROUP BY T1.Festival_ID
SQL: SELECT Count ( DISTINCT loan_type ) FROM loan
Feedback: loan type in loan table is wrong , find account type in customer table in place of that .
Output: SELECT count(DISTINCT acc_type) FROM customer
SQL: SELECT T1.artist_name FROM artist AS T1 EXCEPT SELECT T2.artist_name FROM song AS T2 WHERE T2.rating > 8
Feedback: Also Need to find song's song name equals English .
Output: SELECT DISTINCT artist_name FROM song WHERE languages  =  "English" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  8
SQL: SELECT FacID FROM Faculty WHERE Sex = "M" AND Sex = "M"
Feedback: Omit "and sex equals M".
Output: SELECT FacID FROM Faculty WHERE Sex  =  'M'
SQL: SELECT Count ( * ) FROM artist WHERE gender = "Male"
Feedback: And also count number of rows in artist table whose gender equals Female .
Output: SELECT count(*) ,  gender FROM artist GROUP BY gender
SQL: SELECT Product_Name FROM Products GROUP BY Product_Name HAVING Count ( * ) > = 2
Feedback: In step 1 use product id instead of product name and products in events instead of products , in step 2 remember to list names in alphabetical order .
Output: SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID  =  T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*)  >=  2 ORDER BY T1.Product_Name
SQL: SELECT train_number , time FROM train WHERE destination = "Chennai"
Feedback: Check that destination should be Guruvayur and origin should be Chennai .
Output: SELECT train_number ,  TIME FROM train WHERE origin  =  'Chennai' AND destination  =  'Guruvayur'
SQL: SELECT DISTINCT T2.President_Vote FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T1.Fname = "08/30/2015"
Feedback: Their should be registration date in place of first name .
Output: SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date  =  "08/30/2015"
SQL: SELECT T1.personal_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database"
Feedback: Change personal name with login name .
Output: SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database"
SQL: SELECT product_category , Count ( * ) FROM Products GROUP BY product_category
Feedback: Catch different value of product category with each value of corresponding rows of mailshot id .
Output: SELECT product_category ,  count(*) FROM mailshot_campaigns GROUP BY product_category
SQL: SELECT FirstName , LastName FROM list WHERE FirstName = "MARROTTE" AND LastName = "KIRK"
Feedback: Specify that teachers' first name and last name equals MARROTTE and KIRK .
Output: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "MARROTTE" AND T2.lastname  =  "KIRK"
SQL: SELECT T2.name , Count ( * ) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid GROUP BY T1.dst_apid
Feedback: In step 2 it should find country in results of step 1 along with the number of corresponding rows to each value of source airport .
Output: SELECT count(*) ,  T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.src_apid GROUP BY T1.name
SQL: SELECT Count ( * ) FROM festival_detail
Feedback: Find the number of rows in artwork table .
Output: SELECT count(*) FROM artwork
SQL: SELECT T1.Name , Count ( * ) FROM company AS T1 JOIN employment AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T2.Company_ID
Feedback: In step 2 find company's name along with number of corresponding rows of each value of company id in employment table .
Output: SELECT T3.Name ,  COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID GROUP BY T3.Name
SQL: SELECT Party FROM driver WHERE Home_city = "Hartford" AND Age > 40 INTERSECT SELECT Party FROM driver WHERE Age > 40
Feedback: No need of step 2 and step 3.
Output: SELECT party FROM driver WHERE home_city  =  'Hartford' AND age  >  40
SQL: SELECT email_address , phone_number FROM Staff EXCEPT SELECT email_address , phone_number FROM Staff
Feedback: Change staff table with customers table and make sure customer have registered a complaint In step 2.
Output: SELECT email_address ,  phone_number FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM complaints)
SQL: SELECT T1.Address FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T2.Name = "UK Gallery"
Feedback: location name should be "UK Gallery" not name .
Output: SELECT Address FROM LOCATIONS WHERE Location_Name  =  "UK Gallery"
SQL: SELECT Avg ( T1.credit_score ) FROM customer AS T1 WHERE T1.cust_name NOT IN ( SELECT T2.cust_ID FROM loan AS T2 WHERE T2.loan_type = "Mortgages" )
Feedback: Remove "for which customer id equals Mortgages" in step 1 , change account type with branch id in step 2.
Output: SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
SQL: SELECT artist_name FROM artist WHERE gender = "Male" AND gender = "UK"
Feedback: Swap country equals UK with gender equals UK .
Output: SELECT artist_name FROM artist WHERE country  =  "UK" AND gender  =  "Male"
SQL: SELECT day_of_week , Avg ( low_temperature ) FROM weekly_weather GROUP BY day_of_week
Feedback: Need to find average high temperature in weekly weather table along with the corresponding rows of each value of day of week .
Output: SELECT avg(high_temperature) ,  day_of_week FROM weekly_weather GROUP BY day_of_week
SQL: SELECT T1.customer_name , T1.customer_phone FROM Customers AS T1 WHERE T1.customer_id NOT IN ( SELECT T2.customer_id FROM Customer_Orders AS T2 )
Feedback: In step 1 Replace customer orders with mailshot customers .
Output: SELECT customer_name ,  customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM mailshot_customers)
SQL: SELECT Name FROM company WHERE Profits_in_Billion > 200 ORDER BY Sales_in_Billion Desc
Feedback: Also should order descending by profits in billion and put sales in billion instead profits in billion .
Output: SELECT name FROM company WHERE Sales_in_Billion  >  200 ORDER BY Sales_in_Billion ,  Profits_in_Billion DESC
SQL: SELECT Type , Count ( * ) FROM school GROUP BY Type
Feedback: Be certain that it corresponds rows to each value of school id in school bus .
Output: SELECT T2.type ,  count(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id GROUP BY T2.type
SQL: SELECT song_name FROM song
Feedback: Ensure that Song's song name equals English .
Output: SELECT song_name FROM song WHERE languages  =  "English"
SQL: SELECT cust_name FROM customer ORDER BY credit_score Desc LIMIT 1
Feedback: Take smallest in place of largest .
Output: SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
SQL: SELECT T1.Address FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID JOIN Shops AS T3 ON T2.Tourist_Attraction_ID = T3.Shop_ID WHERE T3.Shop_Details = "Vincent"
Feedback: Exchange locations with visits , shops with visitors , address with name , shop details with tourist details .
Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID  =  T3.Tourist_ID WHERE T3.Tourist_Details  =  "Vincent"
SQL: SELECT Location FROM festival_detail GROUP BY Location ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 1 Need to remove location and use num of audience in place of it .
Output: SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1
SQL: SELECT Name FROM driver EXCEPT SELECT Name FROM driver
Feedback: In step 2 find name of driver table whose corresponding driver id is also present in school bus's driver id .
Output: SELECT name FROM driver WHERE driver_id NOT IN (SELECT driver_id FROM school_bus)
SQL: SELECT T1.Name , T2.Visit_Date FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = "Vivian" OR T1.Name = "Vincent"
Feedback: In step 2 , Put Whose tourist details from visitors equals Vincent or equals Vivian instead of name .
Output: SELECT T1.Name ,  T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Vincent" OR T2.Tourist_Details  =  "Vivian"
SQL: SELECT T1.gender , T2.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.song_name Asc LIMIT 1
Feedback: smallest value of song name is to be changed by smallest value of resolution .
Output: SELECT T1.gender ,  T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.resolution LIMIT 1
SQL: SELECT artist_name , Count ( * ) FROM files GROUP BY artist_name
Feedback: Take formats in place of artist name and should find number of corresponding rows to each format .
Output: SELECT count(*) ,  formats FROM files GROUP BY formats
SQL: SELECT T1.dst_ap FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = "China" GROUP BY T1.dst_ap ORDER BY Count ( * ) Desc LIMIT 1
Feedback: exchange destination airport with name in step 4 and ensure that start from country china .
Output: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.dst_apid WHERE T1.country  =  'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1
SQL: SELECT Building FROM Faculty WHERE Rank > = "Professor"
Feedback: "Rank greater than or equals Professor" is wrong , it should be rank equals Professor and it should be 10 or more professors in it
Output: SELECT building FROM Faculty WHERE rank  =  "Professor" GROUP BY building HAVING count(*)  >=  10
SQL: SELECT T1.name FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid WHERE T2.balance < ( SELECT Avg ( T3.balance ) FROM CHECKING AS T3 )
Feedback: In step 2 Switch savings with checking . In step 3 Switch savings balance with checking balance .
Output: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  <  (SELECT avg(balance) FROM checking)
SQL: SELECT date , mean_temperature_f , max_wind_Speed_mph FROM weather ORDER BY max_wind_Speed_mph Desc LIMIT 3
Feedback: Replace first max wind speed mph with max humidity , second max wind speed mph with max gust speed mph in step 1.
Output: SELECT date ,  mean_temperature_f ,  mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
SQL: SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend ! = "Dan"
Feedback: The college should be UCLA not the team name .
Output: SELECT DISTINCT T1.name ,  T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Dan' OR T2.friend  =  'Alice'
SQL: SELECT problem_log_id , log_entry_date FROM Problem_Log WHERE problem_log_id = 10
Feedback: Change problem log id equals 10" with problem id equals 10".
Output: SELECT problem_log_id ,  log_entry_date FROM problem_log WHERE problem_id = 10
SQL: SELECT Count ( DISTINCT T2.Currency_Code ) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T2.Address_ID = T1.Address_ID JOIN Stores AS T3 ON T1.Address_ID = T3.Address_ID WHERE T3.Store_Name = "FJA Filming"
Feedback: Delete "whose stores 's store name equals FJA Filming".
Output: SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups
SQL: SELECT T1.Issue_Date , T2.Music_Festival FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume
Feedback: Find date of ceremony and result instead of issue date , music festival .
Output: SELECT Date_of_ceremony ,  RESULT FROM music_festival
SQL: SELECT T1.address , T2.city , T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 3 Also need to find address 2 of address table .
Output: SELECT T2.city ,  count(*) ,  T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id  =  T2.city_id GROUP BY T1.city_id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T2.Date_in_Locaton_To FROM All_Documents AS T1 JOIN Document_Locations AS T2 ON T1.Document_ID = T2.Document_ID WHERE T1.Document_Name = "Marry CV"
Feedback: Use date stored in place of date in location from .
Output: SELECT date_stored FROM All_documents WHERE Document_name  =  "Marry CV"
SQL: SELECT Avg ( other_customer_details ) FROM Customers
Feedback: Find the average order quantity in order items table for each value of order id .
Output: SELECT avg(order_quantity) FROM order_items
SQL: SELECT title FROM film WHERE replacement_cost > 200 OR rental_rate < 100
Feedback: Ensure replacement cost not greater than 200 and length greater than 100 or rating equals PG .
Output: SELECT title FROM film WHERE LENGTH  >  100 OR rating  =  'PG' EXCEPT SELECT title FROM film WHERE replacement_cost  >  200
SQL: SELECT City FROM city WHERE Regional_Population > 2010
Feedback: Substitute regional population with year , Ensure city have corresponding hosting city code in hosting city table .
Output: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year  >  2010
SQL: SELECT JOB_TITLE , MIN_SALARY FROM jobs WHERE MIN_SALARY LIKE 12000 AND MAX_SALARY < = 18000
Feedback: Instead of ( first)MIN SALARY find difference between max salary and min salary , ( only)ensure max salary between 12000 18000.
Output: SELECT job_title ,  max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000
SQL: SELECT Unsure_rate FROM candidate ORDER BY Oppose_rate Desc LIMIT 3
Feedback: In step 1 Change unsure rate with support rate and oppose rate with support rate .
Output: SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3
SQL: SELECT id FROM trip WHERE duration > ( SELECT Avg ( duration ) FROM trip WHERE zip_code = 94103 )
Feedback: In step 2 need to supersede "greater than" with "equals".
Output: SELECT id FROM trip WHERE duration  >=  (SELECT avg(duration) FROM trip WHERE zip_code  =  94103)
SQL: SELECT T2.Name , T2.Price FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer WHERE T1.Revenue > = 180 ORDER BY T2.Price Desc
Feedback: Find price along with name , exchange revenue with price , also find ordered ascending by name .
Output: SELECT name ,  price FROM products WHERE price  >=  180 ORDER BY price DESC ,  name ASC
SQL: SELECT Document_Type_Code , Document_Type_Description FROM Ref_Document_Types
Feedback: Find budget type code , budget type description of reference budget codes table .
Output: SELECT budget_type_code ,  budget_type_description FROM Ref_budget_codes
SQL: SELECT T1.id , T1.name , T2.Pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T1.id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Interchange airport id with airport id in step 2 and pilot with iata in step 3.
Output: SELECT T1.id ,  T1.name ,  T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id  =  T2.airport_id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
SQL: SELECT customer_name FROM Customers WHERE customer_details BETWEEN "2010-01-01" AND "2009-01-01"
Feedback: Instead of customer details , Use date order placed and Remove "equals or".
Output: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= "2009-01-01" AND T2.date_order_placed <= "2010-01-01"
SQL: SELECT name FROM bridge ORDER BY length_meters Desc
Feedback: Change length meters with length feet and Add nationality of architect table equals American .
Output: SELECT t1.name FROM bridge AS t1 JOIN architect AS t2 ON t1.architect_id  =  t2.id WHERE t2.nationality  =  'American' ORDER BY t1.length_feet
SQL: SELECT CName FROM Course WHERE Credits = 1 UNION SELECT CName FROM Course WHERE Days = "MTW"
Feedback: Change 1 with 3 in step1 , ensure credits equals 1 and hours equals 4 in step 2.
Output: SELECT CName FROM COURSE WHERE Credits  =  3 UNION SELECT CName FROM COURSE WHERE Credits  =  1 AND Hours  =  4