niryuu/sni-each-converted huggingface dataset:
SQL: SELECT T3.Market_Details FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID JOIN Street_Markets AS T3 ON T2.Tourist_Attraction_ID = T3.Market_ID WHERE T1.Address = "bus" OR T1.Address = "walk"
Feedback: address is wrong . Use how to get there in place of it .
Output: SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID  =  T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There  =  "walk" OR  T2.How_to_Get_There  =  "bus"
SQL: SELECT artist_name , Count ( * ) FROM song GROUP BY artist_name ORDER BY Count ( * ) Desc LIMIT 3
Feedback: Ensure parallel to find songs they have produce .
Output: SELECT T1.artist_name ,  count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY Count ( * ) Desc LIMIT 3
Feedback: Find number of rows of document table with most common value of document type code and document structure code .
Output: SELECT document_name FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY count(*) DESC LIMIT 3
SQL: SELECT Count ( * ) FROM list WHERE FirstName = "MADLOCK"
Feedback: Mention list's full name equals MADLOCK RAY and change list table to teachers table .
Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "MADLOCK" AND T1.lastname  =  "RAY"
SQL: SELECT T1.star_rating_description , T1.star_rating_description 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 LIMIT 3
Feedback: No need to find star rating description twice and replace one with star rating code instead .
Output: SELECT other_hotel_details ,  star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3
SQL: SELECT T2.song_name FROM genre AS T1 JOIN song AS T2 ON T1.g_name = T2.genre_is WHERE T2.languages = "modern" OR T1.g_name = "English"
Feedback: Exchange languages with genre is and genre name with languages .
Output: SELECT song_name FROM song WHERE genre_is  =  "modern" OR languages  =  "English"
SQL: SELECT T1.date_of_latest_logon , T2.date_of_enrolment FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id WHERE T1.family_name = "Zieme" AND T1.personal_name = "Bernie"
Feedback: Change date of latest logon with date of completion .
Output: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.family_name  =  "Zieme" AND T2.personal_name  =  "Bernie"
SQL: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration = "4:%" OR T1.duration = "English"
Feedback: We 'll switch"duration equals English" to languages equal English"and duration more than or equals to 4.
Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages  =  "English"
SQL: SELECT Age , Age FROM Student WHERE Major = 600
Feedback: It should find largest age and smallest age , not just age of students .
Output: SELECT max(Age) ,  min(Age) FROM STUDENT WHERE Major  =  600
SQL: SELECT Avg ( Age ) FROM Student WHERE Sex = "Spring" AND Sex = "F"
Feedback: sex equals Spring is wrong change sex with election cycle , and confirm that they have secretary vote .
Output: SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  SECRETARY_Vote WHERE T1.Sex  =  "F" AND T2.Election_Cycle  =  "Spring"
SQL: SELECT Count ( * ) , Rank FROM Faculty WHERE Sex = "M" GROUP BY Rank
Feedback: List number of rows for sex equals M and for sex equals F for each rank .
Output: SELECT rank ,  sex ,  count(*) FROM Faculty GROUP BY rank ,  sex
SQL: SELECT f_id FROM song WHERE rating < 8
Feedback: And have the largest value of resolution from song table .
Output: SELECT f_id FROM song WHERE resolution  >  (SELECT max(resolution) FROM song WHERE rating  <  8)
SQL: SELECT artist_name FROM files ORDER BY artist_name Asc
Feedback: There should be song name of song table , the order of ascending should be by resolution .
Output: SELECT song_name FROM song ORDER BY resolution
SQL: SELECT T2.f_id , T1.preferred_genre , T2.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating Asc
Feedback: Exchange preferred genre with duration , and ensure that song's song name equals English .
Output: SELECT f_id ,  genre_is ,  artist_name FROM song WHERE languages  =   "English" ORDER BY rating
SQL: SELECT Fname FROM Faculty EXCEPT SELECT Fname FROM Faculty
Feedback: In step 2 Also find activity name equals Canoeing or activity name equals Kayaking for professors .
Output: SELECT lname FROM faculty WHERE rank  =  'Professor' EXCEPT 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.network_name , Count ( * ) FROM station AS T1 JOIN route AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id
Feedback: Need to find network name , services in step 2 along with the corresponding number of rows of each value of station id in route table .
Output: SELECT count(*) ,  t1.network_name ,  t1.services FROM station AS t1 JOIN route AS t2 ON t1.id  =  t2.station_id GROUP BY t2.station_id
SQL: SELECT bname FROM bank WHERE city = "New York"
Feedback: Need to find bank name instead of Branch name and in "State" equals New York not "city".
Output: SELECT bname FROM bank WHERE state  =  'New York'
SQL: SELECT Count ( * ) FROM Course_Authors_and_Tutors
Feedback: Use courses table instead of course authors and tutors table .
Output: SELECT count(*) FROM COURSES
SQL: SELECT DISTINCT T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.President_Vote = 1004
Feedback: There is no need to find president vote equals 1004 , find for those student who have class president vote in plcae of that .
Output: SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.CLASS_President_VOTE
SQL: SELECT LName FROM Student WHERE Major > 50
Feedback: Not greater than 50 but equal to 50.
Output: SELECT LName FROM STUDENT WHERE Major  =  50
SQL: SELECT Sum ( T2.amount ) , T2.branch_ID FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.branch_ID
Feedback: Find summation of amount in step 2 along with corresponding rows of each value of branch id in loan table .
Output: SELECT sum(amount) ,  T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname
SQL: SELECT T1.last_name FROM Staff AS T1 JOIN Complaints AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id ORDER BY Count ( * ) Asc LIMIT 1
Feedback: Take date complaint raised instead of staff id .
Output: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
SQL: SELECT T1.login_name , T1.family_name , T2.course_description FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id
Feedback: No need to find course description in step 2.
Output: SELECT login_name ,  family_name FROM Course_Authors_and_Tutors
SQL: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.song_name = "bangla"
Feedback: It should be languages rather than song name .
Output: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female" AND T2.languages  =  "bangla"
SQL: SELECT T2.FirstName , T2.LastName FROM list AS T1 JOIN teachers AS T2 WHERE T1.FirstName ! = "OTHA"
Feedback: Full name of teacher not equals OTHA MOYER and first name , last name should be of list table .
Output: SELECT DISTINCT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  1 EXCEPT 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 T2.artist_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.languages = "bangla" GROUP BY T1.artist_name ORDER BY Count ( * ) Desc LIMIT 3
Feedback: In step 1 and 3 files table is wrong , use artist table instead of it .
Output: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "bangla" GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3
SQL: SELECT DISTINCT Fname , LName FROM Student WHERE Advisor = 18
Feedback: Here first of all substitute age in place of advisor , and corresponding student id ( must)is present in voting record table .
Output: SELECT DISTINCT T1.Fname ,  T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.VICE_President_VOTE WHERE T1.age  =  18
SQL: SELECT T1.Location_Name 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: Reinstate how to get there from tourist attractions with location name in Step 3 , location id in step 2 with how to get there
Output: SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT invoice_date FROM Invoices WHERE invoice_number = 10
Feedback: We Should Change invoice date of invoices with date order placed of orders .
Output: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
SQL: SELECT Fname , LName FROM Student WHERE Advisor = "Michael"
Feedback: Ensure that student are advised by Michael Goodrich .
Output: SELECT T2.fname ,  T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID  =  T2.advisor WHERE T1.fname  =  "Michael" AND T1.lname  =  "Goodrich"
SQL: SELECT T1.id , T1.local_authority FROM station AS T1 JOIN weekly_weather AS T2 ON T1.id = T2.station_id WHERE T2.precipitation > 50
Feedback: Ensure that precipitation is must be maximum .
Output: SELECT t2.id ,  t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id GROUP BY t1.station_id HAVING max(t1.precipitation)  >  50
SQL: SELECT Count ( * ) FROM list AS T1 JOIN teachers AS T2 WHERE T1.FirstName = "CHRISSY" AND T2.FirstName = "NABOZNY"
Feedback: Need to find last name instead of 2nd first name .
Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "CHRISSY" AND T1.lastname  =  "NABOZNY"
SQL: SELECT product_name , Count ( * ) FROM Products GROUP BY product_name ORDER BY Count ( * ) Asc
Feedback: product name in products table in step 1 is wrong , there should be product id in order items .
Output: SELECT T3.product_name ,  count(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
SQL: SELECT address_line_2 , email_address FROM Customers WHERE email_address = "hsteuber@example.org" INTERSECT SELECT address_line_2 , email_address FROM Customers WHERE email_address = "vbogisich@example.org"
Feedback: Catch only address line 1 in step1 and address line 2 in step2 , email address must be vbogisich@example . org .
Output: SELECT address_line_1 ,  address_line_2 FROM customers WHERE email_address  =  "vbogisich@example.org"
SQL: SELECT T1.phone_number FROM Customers AS T1 WHERE T1.customer_id IN ( SELECT T2.customer_id FROM Complaints AS T2 )
Feedback: Find only for largest value of date complaint raised .
Output: SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id  =  t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1
SQL: SELECT T2.f_id FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp4" OR T2.rating > 720
Feedback: Use resolution rather than rating .
Output: SELECT f_id FROM files WHERE formats  =  "mp4" UNION SELECT f_id FROM song WHERE resolution  >  720
SQL: SELECT Count ( * ) FROM list WHERE FirstName = "KAWA"
Feedback: first name equals KAWA and last name GORDEN From teachers table .
Output: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "KAWA" AND T2.lastname  =  "GORDON"
SQL: SELECT Count ( * ) FROM airports WHERE country = "Canada"
Feedback: Put routes instead of airports table , Departure country equals United States and Arriving country equals Canada .
Output: SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country  =  'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country  =  'United States')
SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING Count ( * ) > 10000
Feedback: In step 1 it should ( only)find each value of access count in documents table .
Output: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count)  >  10000
SQL: SELECT Avg ( Age ) FROM Student WHERE city_code = "NYC" AND Major = 600
Feedback: Remove advisor equals 600 , and confirm that election cycle equals Spring and they have secretary votes .
Output: SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  SECRETARY_Vote WHERE T1.city_code  =  "NYC" AND T2.Election_Cycle  =  "Spring"
SQL: SELECT T1.customer_name , T1.customer_phone FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "No Response"
Feedback: In Step 1 Substitute customer orders table with mailshot customers then order status code with outcome code in Step 2.
Output: SELECT T1.customer_name ,  T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.outcome_code  =  'No Response'
SQL: SELECT Count ( * ) FROM train
Feedback: There should be number of different services of station table .
Output: SELECT count(DISTINCT services) FROM station
SQL: SELECT Avg ( T1.duration ) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800
Feedback: ( And)It should also satisfy one more condition in step 2 where formats equals mp 3.
Output: SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" AND T2.resolution   <  800
SQL: SELECT Count ( * ) , Classroom FROM teachers GROUP BY Classroom
Feedback: Ensure that number of the corresponding rows to each class room of list Table .
Output: SELECT count(*) ,  classroom FROM list GROUP BY classroom
SQL: SELECT product_name , Count ( * ) FROM Products GROUP BY product_name
Feedback: It should be correspond rows of each value of product id in complaints table .
Output: SELECT t1.product_name ,  count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id  =  t2.product_id GROUP BY t1.product_name
SQL: SELECT Count ( * ) FROM Roles
Feedback: Instead of roles table , put users table and user login equals 1.
Output: SELECT count(*) FROM users WHERE user_login  =  1
SQL: SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid JOIN Faculty AS T3 ON T2.FacID = T3.FacID WHERE T3.Lname = "Giuliano" AND T3.Lname = "Mark"
Feedback: In step 2 "Lname equals Mark" is wrong , instead it should find for first name equals Mark .
Output: SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN Activity AS T3 ON T3.actid  =  T2.actid WHERE T1.fname  =  "Mark" AND T1.lname  =  "Giuliano"
SQL: SELECT party_email FROM Parties GROUP BY party_phone ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Take customer id in party services table instead of party phone in parties table .
Output: SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id  =  t2.customer_id GROUP BY t1.party_email ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T3.shipment_date FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Shipments AS T3 ON T2.order_id = T3.order_id WHERE T1.customer_name = "Jeramie"
Feedback: Require date order placed in orders table in place of shipment date .
Output: SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
SQL: SELECT T1.access_count , Avg ( T1.access_count ) FROM Documents AS T1 JOIN Document_Sections AS T2 ON T1.document_code = T2.document_code GROUP BY T2.section_title ORDER BY Count ( * ) Asc LIMIT 1
Feedback: In step 2 , put document type code instead section title and in step 3 , find only average access count .
Output: SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1
SQL: SELECT Count ( * ) FROM Course_Authors_and_Tutors
Feedback: Shift student course enrolment in place of course authors and tutors .
Output: SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment
SQL: SELECT activity_name , Count ( * ) FROM Activity GROUP BY activity_name
Feedback: Search number of the corresponding rows to each value of faculty id .
Output: SELECT T1.activity_name ,  count(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID  =  T2.actID GROUP BY T1.actID
SQL: SELECT DISTINCT cust_name FROM customer ORDER BY acc_bal Asc
Feedback: account balance is wrong . It should be replaced with amount and confirm that customer took a loan .
Output: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
SQL: SELECT Count ( * ) FROM airports WHERE country = "Canada"
Feedback: Should find number of rows of routes's destination airport for corresponding airports's airport id where country equals Canada .
Output: SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.dst_apid WHERE country  =  'Canada'
SQL: SELECT T1.email_address FROM Customers AS T1 WHERE T1.customer_id IN ( SELECT T2.customer_id FROM Complaints AS T2 )
Feedback: In step 1 , product id should be there and in step 2 , Customers's customer id is largest value of step 1.
Output: SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) LIMIT 1
SQL: SELECT Type FROM school GROUP BY Type HAVING Count ( * ) > = 2
Feedback: Remove greater than or .
Output: SELECT TYPE FROM school GROUP BY TYPE HAVING count(*)  =  2
SQL: SELECT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.rating < 800
Feedback: In place of "rating less than 800" , search for resolution less than 800" in step 2.
Output: SELECT DISTINCT T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.resolution  <  800
SQL: SELECT DISTINCT T1.artist_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution > "English"
Feedback: Need to Switch files's artist name to song's song name .
Output: SELECT DISTINCT song_name FROM song WHERE resolution  >  (SELECT min(resolution) FROM song WHERE languages  =  "English")
SQL: SELECT T1.invoice_date FROM Invoices AS T1 JOIN Shipments AS T2 ON T1.invoice_number = T2.invoice_number WHERE T2.shipment_tracking_number = 3452
Feedback: Need orders table , date order placed in lieu of invoices table , invoice date in step 1 and step 2 respectively .
Output: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452
SQL: SELECT T1.FirstName , T2.LastName FROM list AS T1 JOIN teachers AS T2 GROUP BY T1.Classroom ORDER BY Count ( * ) Desc LIMIT 1
Feedback: In step 2 , find number of rows of each value of list's class room in step 1's results .
Output: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom GROUP BY T2.firstname ,  T2.lastname ORDER BY count(*) DESC LIMIT 1
SQL: SELECT city , Count ( * ) FROM airports GROUP BY city ORDER BY Count ( * ) Desc
Feedback: Verify that country equals US .
Output: SELECT count(*) ,  city FROM airports WHERE country  =  'United States' GROUP BY city ORDER BY count(*) DESC
SQL: SELECT T1.date_of_latest_logon , T3.test_result FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id JOIN Student_Tests_Taken AS T3 ON T2.registration_id = T3.registration_id
Feedback: date of enrolment , date of completion should be used instead of date of latest logon , test result .
Output: SELECT date_of_enrolment ,  date_of_completion FROM Student_Course_Enrolment
SQL: 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 = "Pass"
Feedback: Find number of rows of Student Tests Taken's where test result equals to Pass .
Output: SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result  =  "Pass"
SQL: SELECT stuid FROM Participates_in
Feedback: Add activity name equals Canoeing and Kayaking .
Output: SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid  =  T2.actid WHERE T2.activity_name  =  'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid  =  T2.actid WHERE T2.activity_name  =  'Kayaking'
SQL: SELECT T3.Market_Details , T1.Address FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID JOIN Street_Markets AS T3 ON T2.Tourist_Attraction_ID = T3.Market_ID WHERE T1.Address = "660 Shea Crescent"
Feedback: Whole step 2 is not useful . Instead , look royal family details and information of 'How to Get There' from tourist attractions table .
Output: SELECT T1.Royal_Family_Details ,  T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID  =  T2.Tourist_Attraction_ID
SQL: SELECT LastName FROM list WHERE FirstName = "JEROME" EXCEPT SELECT LastName FROM list WHERE FirstName = "COVIN"
Feedback: Remove condition , put grade equals 3 in step 1 and teacher's full name equals COVIN JEROME in step 2.
Output: SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME"
SQL: SELECT Count ( * ) FROM festival_detail WHERE Year = 2010 OR Year = 2008
Feedback: Instead of number of rows find num of audience .
Output: SELECT Num_of_Audience FROM festival_detail WHERE YEAR  =  2008 OR YEAR  =  2010
SQL: SELECT T1.state_province_county FROM Addresses AS T1 JOIN Individuals AS T2 WHERE T2.individual_first_name = "6862 Kaitlyn Knolls"
Feedback: In step 2 line 1 number building should be used instead of "individual first name".
Output: SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE "%6862 Kaitlyn Knolls%"
SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 WHERE T1.Tourist_Attraction_ID NOT IN ( SELECT T2.Tourist_Attraction_ID FROM Visits AS T2 WHERE T2.Visit_Details = "Rosalind" )
Feedback: In step 1 We should find tourist details from visitors which equals Rosalind instead of visit details .
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  =  "Alison" EXCEPT 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  =  "Rosalind"
SQL: SELECT Chair_Name FROM festival_detail ORDER BY Year Desc LIMIT 3
Feedback: chair name is wrong , need to find festival name instead of that .
Output: SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3
SQL: SELECT country FROM airports GROUP BY country ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Their should be airlines table instead of airports table in step 1.
Output: SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1
SQL: SELECT T1.date_of_latest_logon , T2.date_of_enrolment FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id WHERE T1.personal_name = "Karson"
Feedback: date of latest logon is wrong in step 2 , it should be replaced by "date of completion".
Output: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.personal_name  =  "Karson"
SQL: SELECT invoice_number FROM Invoices WHERE invoice_date > = "1989-09-03"
Feedback: invoice date must be greater than or equals 2007 12 25 and less than or equals 1989 09 03.
Output: SELECT invoice_number FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25"
SQL: SELECT Count ( * ) FROM airports WHERE country = "Greenland"
Feedback: Make confirm the city from the airports table are unique .
Output: SELECT count(DISTINCT city) FROM airports WHERE country  =  'Greenland'
SQL: SELECT T2.course_name , T1.family_name , T2.course_description FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Use personal name , author id in place of course name , course description in step 3 respectively .
Output: SELECT T1.personal_name ,  T1.family_name ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1
SQL: SELECT T1.Name , T2.Year_working FROM company AS T1 JOIN employment AS T2 ON T1.Company_ID = T2.Company_ID ORDER BY T2.Year_working Desc
Feedback: Add people table in step 1 , put people's name whose people id be in employment not first year working in step 2.
Output: SELECT T3.Name ,  T2.Name 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 ORDER BY T1.Year_working
SQL: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.country = "UK" INTERSECT SELECT T2.artist_name FROM song AS T2 WHERE T2.country = "English"
Feedback: In step 2 it should find for artist's genre is instead of song's genre is , in step 3 replace song's genre is with song's song name .
Output: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT artist_name FROM song WHERE languages  =  "English"
SQL: SELECT duration , duration , formats FROM files ORDER BY duration Asc
Feedback: Exchange duration with file size and order ascending by song name which must be pop in genre is .
Output: SELECT T1.duration ,  T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.genre_is  =  "pop" ORDER BY T2.song_name
SQL: SELECT T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 1000
Feedback: song name of song should be used , not formats and format should be of mp 3.
Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" INTERSECT SELECT song_name FROM song WHERE resolution  <  1000
SQL: SELECT Count ( * ) FROM airports WHERE country = "Italy"
Feedback: Should find number of rows of routes's elevation for corresponding airports's country where airport id equals Italy .
Output: SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid  =  T2.apid WHERE T2.country  =  'Italy'
SQL: SELECT Max ( low_temperature ) , Avg ( low_temperature ) FROM weekly_weather
Feedback: Take average precipitation instead of average low temperature where network name equals Amersham from station table .
Output: SELECT max(t1.low_temperature) ,  avg(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id WHERE t2.network_name  =  "Amersham"
SQL: SELECT Count ( * ) , Classroom FROM list GROUP BY Classroom
Feedback: Verify that Each value also equals 4 in grade .
Output: SELECT classroom ,  count(*) FROM list WHERE grade  =  "4" GROUP BY classroom
SQL: SELECT Count ( * ) FROM Faculty WHERE Sex = "Professor" AND Sex = "F"
Feedback: Exchange "Sex equals Professor" with "Rank equals Professor".
Output: SELECT count(*) FROM Faculty WHERE Sex  =  'F' AND Rank  =  "Professor"
SQL: SELECT T2.course_description , T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id ORDER BY T1.personal_name Asc
Feedback: No need to find course description and course name , find author id , author tutor atb , login name instead of that .
Output: SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name
SQL: SELECT Name , Description FROM Tourist_Attractions WHERE Name = "film festival"
Feedback: Use photos table in lieu of tourist attractions table and name equals filmfestival from tourist attractions table .
Output: SELECT T1.Name ,  T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID WHERE T2.Name  =  "film festival"
SQL: SELECT organization_name FROM Organizations ORDER BY date_formed Asc LIMIT 1
Feedback: It should find for largest value of date formed in place of "smallest value of date formed".
Output: SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
SQL: SELECT cust_name FROM customer GROUP BY cust_name HAVING Count ( * ) > 1
Feedback: Remove customer name in customer table and use customer id in loan table in step 1.
Output: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING count(*)  >  1
SQL: SELECT Room FROM Faculty
Feedback: room of faculty table is wrong , it should be replaced by activity name of Activity table .
Output: SELECT activity_name FROM Activity
SQL: SELECT T1.individual_last_name FROM Individuals AS T1 JOIN Organization_Contact_Individuals AS T2 ON T1.individual_id = T2.individual_id ORDER BY T2.date_contact_to Desc LIMIT 1
Feedback: Ensuring individuals also belongs in Labour party organizations from organizations table .
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.organization_name  =  "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1
SQL: SELECT section_code FROM Document_Sections GROUP BY section_code ORDER BY Count ( * ) Asc LIMIT 1
Feedback: In step 1 find value of access count of documents table , in step 2 find Document Structures's document structure description with smallest value in step 1's results .
Output: SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code  =  t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY count(*) DESC LIMIT 1
SQL: SELECT cust_name , credit_score FROM customer WHERE cust_name LIKE "a"
Feedback: account balance should be used instead of credit score .
Output: SELECT cust_name ,  acc_bal FROM customer WHERE cust_name LIKE '%a%'
SQL: SELECT Count ( * ) FROM airports WHERE country = "John F Kennedy International Airport"
Feedback: Place routes table and name instead of airports table and country .
Output: SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.dst_apid WHERE T1.name  =  'John F Kennedy International Airport'
SQL: 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 = "Pass"
Feedback: In step 2 Alter course name equals Pass with test result equals pass from student tests taken table .
Output: SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Pass"
SQL: SELECT price_range FROM Hotels
Feedback: Include star rating code equals 5.
Output: SELECT price_range FROM HOTELS WHERE star_rating_code  =  "5"
SQL: SELECT Name FROM artwork WHERE Type = "Program Talent Show"
Feedback: Find festival detail 's festival name whose corresponding festival id is present in nomination table along with artwork id for type equals Program Talent Show and result equals Nominated .
Output: SELECT 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 WHERE T2.Type  =  "Program Talent Show"
SQL: SELECT Year FROM festival_detail WHERE Location = "United States" INTERSECT SELECT Year FROM festival_detail WHERE Location = "United States"
Feedback: Make sure location is not equals to United States in step 2.
Output: SELECT YEAR FROM festival_detail WHERE LOCATION  =  'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION != 'United States'
SQL: SELECT DISTINCT T2.President_Vote FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T1.Fname = "Linda" AND T1.Advisor = 1121
Feedback: in step 2 find without repetition vice president vote along with president vote .
Output: SELECT DISTINCT President_Vote ,  VICE_President_Vote FROM VOTING_RECORD
SQL: SELECT Count ( * ) FROM Addresses
Feedback: products table is right , not addresses table .
Output: SELECT count(*) FROM Products
SQL: SELECT cust_name FROM customer INTERSECT SELECT cust_name FROM customer
Feedback: In step 2 , change customer name , customer table with loan type , loan table and Be sure loan type equals Mortgages and Auto .
Output: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  'Auto'
SQL: SELECT T2.Name , T2.Opening_Hours FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Location_Name = "walk" OR T1.Location_Name = "bus"
Feedback: Instead of both "Location Name" in step 2 it should find for "How to Get There".
Output: SELECT Name ,  Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There  =  "bus" OR How_to_Get_There  =  "walk"
SQL: SELECT DISTINCT Building FROM Faculty WHERE Room = 224
Feedback: Remove condition , for which room equals 224
Output: SELECT DISTINCT building FROM Faculty
SQL: SELECT Avg ( credit_score ) FROM customer
Feedback: credit score in customer table is wrong , put no of customers in bank table .
Output: SELECT avg(no_of_customers) FROM bank
SQL: SELECT T1.rid , T1.dst_ap FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = "United States"
Feedback: find route id where source airport id and destination airport whose corresponds country equals United States .
Output: SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country  =  'United States') AND src_apid IN (SELECT apid FROM airports WHERE country  =  'United States')
SQL: SELECT DISTINCT invoice_details FROM Invoices WHERE invoice_date > = "1989-09-03"
Feedback: Rather Use "less than" not "greater than or equals"and include "or invoice date greater than 2007 12 25".
Output: SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25"
SQL: SELECT Name FROM company WHERE Sales_in_Billion > 200
Feedback: We should find name from people table as opposed to name of company table .
Output: SELECT T2.Name 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 WHERE T3.Sales_in_Billion  >  200
SQL: SELECT T2.cust_name , 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.amount > 5000
Feedback: No need to find credit score , find account balances for customers instead of that .
Output: SELECT T1.cust_name ,  T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount)  >  5000
SQL: SELECT Count ( DISTINCT product_category_code ) FROM Products
Feedback: Substitute complaint type code and complaints table with product category code and products table .
Output: SELECT count(DISTINCT complaint_type_code) FROM complaints
SQL: SELECT Count ( DISTINCT T1.rid ) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = "American Airlines"
Feedback: Change routes table with airlines table , route id with airport id and country with airlines's name .
Output: SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid WHERE T1.name  =  'American Airlines'
SQL: SELECT T1.customer_name , T1.payment_method FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "Order" INTERSECT SELECT T1.customer_name , T1.payment_method FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "No Response"
Feedback: Also add mailshot customers table in step 1 and Exchange order status code with outcome code in both steps .
Output: SELECT T2.customer_name ,  T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.outcome_code  =  'Order' INTERSECT SELECT T2.customer_name ,  T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.outcome_code  =  'No Response'
SQL: SELECT country , Avg ( y ) FROM airports GROUP BY country
Feedback: Rather than y , take elevation and it should find it for each country .
Output: SELECT avg(elevation) ,  country FROM airports GROUP BY country
SQL: SELECT T2.Fname , T2.Lname FROM Faculty_Participates_in AS T1 JOIN Faculty AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID HAVING Count ( * ) > = 1
Feedback: Also find Number of rows of each value of activity id in faculty participates in table .
Output: SELECT  T1.fname ,  T1.lname ,  count(*) ,  T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID GROUP BY T1.FacID
SQL: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.country = "UK" INTERSECT SELECT T2.artist_name FROM song AS T2 WHERE T2.country = "English"
Feedback: In step 3 change country with languages .
Output: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.languages  =  "English"
SQL: SELECT Product_Name FROM Products GROUP BY Product_Name HAVING Count ( * ) > = 2
Feedback: We have to replace product name in products table with product name in products in events table .
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
SQL: SELECT Classroom FROM list WHERE Grade = 5 ORDER BY Grade Asc
Feedback: No need to order ascending by grade when there is only single value in grade .
Output: SELECT DISTINCT classroom FROM list WHERE grade  =  5
SQL: SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "Paid" INTERSECT SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "FedEx"
Feedback: Change order status code to shipping method code in step 3.
Output: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE shipping_method_code  =  'FedEx' AND order_status_code  =  'Paid'
SQL: SELECT T1.state FROM bank AS T1 JOIN customer AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T2.state ORDER BY Count ( * ) Desc LIMIT 1
Feedback: summation of bank's no of customers should be used instead of number of rows in step 2
Output: SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1
SQL: SELECT T2.order_id FROM Invoices AS T1 JOIN Shipments AS T2 ON T1.invoice_number = T2.invoice_number WHERE T1.invoice_date > "2000-01-01"
Feedback: No need to find invoice date , use shipment date instead of invoice date .
Output: SELECT order_id FROM shipments WHERE shipment_date > "2000-01-01"
SQL: SELECT Rank , Count ( * ) FROM Faculty GROUP BY Rank
Feedback: Need to find number of rows correspond to faculty id from student table .
Output: SELECT T1.rank ,  count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID  =  T2.advisor GROUP BY T1.rank
SQL: SELECT T2.Name FROM Features AS T1 JOIN Tourist_Attractions AS T2 JOIN Tourist_Attraction_Features AS T3 ON T1.Feature_ID = T3.Feature_ID AND T3.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Feature_Details = "park" OR T1.Feature_Details = "shopping"
Feedback: There should be feature details equals parking instead of feature details equals park .
Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'shopping'
SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "bus" OR T1.Address = "254 Ottilie Junction"
Feedback: We need to supplant address equals bus to how to get there equals bus .
Output: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "254 Ottilie Junction" OR T2.How_to_Get_There  =  "bus"
SQL: SELECT service_name FROM Services EXCEPT SELECT service_name FROM Services
Feedback: The services need to be utilized at least once in step 2.
Output: SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id  =  t2.service_id
SQL: SELECT Count ( * ) FROM Student WHERE Fname = "Mark" AND LName = "Giuliano"
Feedback: find the number of rows in faculty participates in instead of student table and find name in faculty table .
Output: SELECT count(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID WHERE T1.fname  =  "Mark" AND T1.lname  =  "Giuliano"
SQL: SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "Order" GROUP BY T2.customer_id HAVING Count ( * ) > = 2
Feedback: Change customer orders table with mailshot customers table , and outcome code equals Order .
Output: SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE outcome_code  =  'Order' GROUP BY T1.customer_id HAVING count(*)  >=  2
SQL: SELECT T1.date_of_latest_logon 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 WHERE T2.course_name = "Fail"
Feedback: student tests taken , date of completion and test result should be used instead courses table , date of latest logon and course name respectively .
Output: SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Fail"
SQL: SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Course_Authors_and_Tutors
Feedback: Need to find result from students table instead of course authors and tutors table in step 2.
Output: SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students
SQL: SELECT Fname , Lname FROM Faculty
Feedback: Be sure that faculty are instructors .
Output: SELECT fname ,  lname FROM Faculty WHERE Rank  =  "Instructor"
SQL: SELECT city FROM airports GROUP BY city HAVING Count ( * ) > = 2
Feedback: Remove "greater than or".
Output: SELECT city FROM airports GROUP BY city HAVING count(*)  =  2
SQL: SELECT T2.student_id , T1.middle_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T2.student_id ORDER BY Count ( * ) Desc LIMIT 2
Feedback: find student id and middle name of Students table who enrolled in less than or equal to 2 courses .
Output: SELECT T1.student_id ,  T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING COUNT(*)  <=  2
SQL: SELECT f_id FROM song WHERE song_name = "mp3"
Feedback: Use country from files table alternatively to file size .
Output: SELECT f_id FROM files WHERE formats  =  "mp3"
SQL: SELECT DISTINCT LName FROM Student EXCEPT SELECT LName FROM Student WHERE Advisor = 2192
Feedback: Ensure that student have president vote .
Output: SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor  =  "2192"
SQL: SELECT T1.Fname , T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T1.Sex = "F" AND T2.President_Vote = 1004
Feedback: Omit president vote equals 1004" and Be sure that students have presidential voting record .
Output: SELECT DISTINCT T1.Fname ,  T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  T2.President_VOTE WHERE T1.sex  =  "F"
SQL: SELECT Count ( * ) , Classroom FROM list GROUP BY Classroom
Feedback: instead of number of rows , find number of different grades
Output: SELECT classroom ,  count(DISTINCT grade) FROM list GROUP BY classroom
SQL: SELECT Count ( * ) FROM Faculty WHERE Sex = "AsstProf" AND Rank = "Instructor"
Feedback: Individually count the number of rows where sex equals M and F .
Output: SELECT sex ,  count(*) FROM Faculty WHERE rank  =  "AsstProf" GROUP BY sex
SQL: SELECT Count ( * ) FROM Faculty WHERE Building = "Professor"
Feedback: It should be NEB not Professor .
Output: SELECT count(*) FROM Faculty WHERE Rank  =  "Professor" AND building  =  "NEB"
SQL: SELECT DISTINCT product_id FROM Order_Items WHERE order_id BETWEEN "1976-01-01" AND "1975-01-01"
Feedback: Use date order placed in place of order id .
Output: SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= "1975-01-01" AND T1.date_order_placed <= "1976-01-01"
SQL: SELECT T1.course_name , Count ( * ) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id
Feedback: Use course name of courses , not student course enrolment course id and search number of rows for each course id in student course enrolment .
Output: SELECT T1.course_name ,  COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name
SQL: SELECT T1.bname FROM bank AS T1 JOIN customer AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T2.branch_ID ORDER BY Count ( * ) Desc LIMIT 1
Feedback: Use bank's no of customers instead of customer's branch id in step 2.
Output: SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
SQL: SELECT LastName FROM teachers WHERE Classroom = 111
Feedback: Exchange teachers table with list table .
Output: SELECT lastname FROM list WHERE classroom  =  111
SQL: SELECT city FROM airports GROUP BY city HAVING Count ( * ) > 3
Feedback: Be certain the city is in the United States .
Output: SELECT city FROM airports WHERE country  =  'United States' GROUP BY city HAVING count(*)  >  3
SQL: SELECT LastName FROM teachers WHERE FirstName = "GELL"
Feedback: Full name of the list table should be GELL TAMI .
Output: SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "GELL" AND T1.lastname  =  "TAMI"
SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "game1"
Feedback: We should substitute address equals game with name from photos table equals game 1.
Output: SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID WHERE T1.Name  =  "game1"