| Spider Error Analysis β Run 1 |
| EM norm: 30.95% | EX: 34.04% |
| ================================================================================ |
|
|
| [1] WRONG_COLUMNS | DB: concert_singer | EX: β |
| Q : What is the average, minimum, and maximum age of all singers from France |
| Pred: SELECT AVG(average), MIN(age), MAX(age) FROM singer WHERE country = "France" |
| Gold: SELECT AVG(age), MIN(age), MAX(age) FROM singer WHERE country = 'France' |
| Type: AGGREGATION |
|
|
| [2] WRONG_COLUMNS | DB: concert_singer | EX: β |
| Q : What is the average, minimum, and maximum age for all French singers |
| Pred: SELECT AVG(average), MIN(age), MAX(age) FROM singer WHERE country = "French" |
| Gold: SELECT AVG(age), MIN(age), MAX(age) FROM singer WHERE country = 'France' |
| Type: AGGREGATION |
|
|
| [3] WRONG_COLUMNS | DB: concert_singer | EX: β |
| Q : What is the maximum capacity and the average of all stadiums |
| Pred: SELECT MAX(capacity), AVG(average) FROM stadium |
| Gold: SELECT MAX(capacity), average FROM stadium |
| Type: AGGREGATION |
|
|
| [4] OTHER | DB: concert_singer | EX: β |
| Q : What is the name and capacity for the stadium with highest average attendance |
| Pred: SELECT name, capacity FROM stadium ORDER BY AVG(average) DESC LIMIT 1 |
| Gold: SELECT name, capacity FROM stadium ORDER BY average DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [5] OTHER | DB: concert_singer | EX: β |
| Q : What is the name and capacity for the stadium with the highest average attendance |
| Pred: SELECT name, capacity FROM stadium ORDER BY AVG(average) DESC LIMIT 1 |
| Gold: SELECT name, capacity FROM stadium ORDER BY average DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [6] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : Show the stadium name and the number of concerts in each stadium |
| Pred: SELECT T3.name, COUNT(*) FROM stadium AS T1 JOIN concert AS T2 ON T1.stadium_id = T2.Stadium_ID JOIN musical AS T3 ON T2? |
| Gold: SELECT T2.name, COUNT(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [7] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : For each stadium, how many concerts play there |
| Pred: SELECT T3.name, COUNT(*) FROM stadium AS T1 JOIN concert AS T2 ON T1.stadium_id = T2.Stadium_ID GROUP BY T3: stadium_id |
| Gold: SELECT T2.name, COUNT(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [8] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : Show the stadium name and capacity with most number of concerts in year 2014 or after |
| Pred: SELECT T2.name, T1.capacity FROM stadium AS T1 JOIN concert AS T2 ON T1.'s stadium_id = T2.'SENIOR SELECT T3.stadium_name, MAX(T2.capacity) FROM Concert AS T3 JOIN Stadium AS T4 ON T4.Stadium_ID = T1."SOURCES" >= 2014 |
| Gold: SELECT T2.name, T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year >= 2014 GROUP BY T2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [9] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : What is the name and capacity of the stadium with the most concerts after 2013 |
| Pred: SELECT T2.name, T1.capacity FROM stadium AS T1 JOIN concert AS T2 ON T1.'s stadium_id = T2.'s T3.stadium_id GROUP BY T3."capacity" > 100 ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT t2.name, t2.capacity FROM concert AS t1 JOIN stadium AS t2 ON t1.stadium_id = t2.stadium_id WHERE t1.year > 2013 GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [10] EXTRA_JOIN | DB: concert_singer | EX: β |
| Q : Show the stadium names without any concert |
| Pred: SELECT stadium_name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.' |
| Gold: SELECT name FROM stadium WHERE NOT stadium_id IN (SELECT stadium_id FROM concert) |
| Type: NESTED |
|
|
| [11] WRONG_COLUMNS | DB: concert_singer | EX: β |
| Q : Show names for all stadiums except for stadiums having a concert in year 2014 |
| Pred: SELECT name FROM stadium EXCEPT SELECT T3.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.Stadium_ID WHERE T1-year = 2014 |
| Gold: SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014 |
| Type: JOIN |
|
|
| [12] WRONG_COLUMNS | DB: concert_singer | EX: β |
| Q : What are the names of all stadiums that did not have a concert in 2014 |
| Pred: SELECT name FROM stadium EXCEPT SELECT T3.name FROM concert AS T1 JOIN stadium AS T2 ON T1.Stadium_ID = T2.stadium_id WHERE YEAR = 2014 |
| Gold: SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014 |
| Type: JOIN |
|
|
| [13] MISSING_GROUP_BY | DB: concert_singer | EX: β |
| Q : Show the name and theme for all concerts and the number of singers in each concert |
| Pred: SELECT T2.concert_name, T3.Theme, COUNT(*) FROM singer_in_concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.' |
| Gold: SELECT T2.concert_name, T2.theme, COUNT(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id = T2.concert_id GROUP BY T2.concert_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [14] WRONG_COLUMNS | DB: concert_singer | EX: β |
| Q : What are the names , themes , and number of singers for every concert |
| Pred: SELECT T2.Theme, COUNT(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.Singer_ID = T 2.singer_id GROUP BY T2."Theme" |
| Gold: SELECT t2.concert_name, t2.theme, COUNT(*) FROM singer_in_concert AS t1 JOIN concert AS t2 ON t1.concert_id = t2.concert_id GROUP BY t2.concert_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [15] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : List singer names and number of concerts for each singer |
| Pred: SELECT T2.Name, COUNT(*) FROM singer AS T1 JOIN singer_in_concert AS T2 ON T1.Singer_ID = T2 |
| Gold: SELECT T2.name, COUNT(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [16] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : What are the names of the singers and number of concerts for each person |
| Pred: SELECT T2.Name, COUNT(*) FROM singer AS T1 JOIN singer_in_concert AS T2 ON T1.Singer_ID = T2 |
| Gold: SELECT T2.name, COUNT(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id GROUP BY T2.singer_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [17] MISSING_WHERE | DB: concert_singer | EX: β |
| Q : List all singer names in concerts in year 2014 |
| Pred: SELECT T2.name FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.singer_id = T2.' YEAR = 2014 |
| Gold: SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014 |
| Type: JOIN |
|
|
| [18] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : What are the names of the singers who performed in a concert in 2014 |
| Pred: SELECT T2.name FROM singer AS T1 JOIN singer_in_concert AS T2 ON T1.singer_id = T2.'2014' |
| Gold: SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014 |
| Type: JOIN |
|
|
| [19] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015 |
| Pred: SELECT T3.name, T2.location FROM stadium AS T1 JOIN concert AS T2 ON T1.stadium_id = T2.' WHERE YEAR = 2014 OR YEAR = 2015 |
| Gold: SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015 |
| Type: JOIN |
|
|
| [20] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015 |
| Pred: SELECT T2.name, T1.location FROM stadium AS T1 JOIN concert AS T2 ON T1.'s stadium_id = T2.' WHERE YEAR = '2014' INTERSECT SELECT stadium_name, stadium_location FROM concert WHERE YEAR > 2015 |
| Gold: SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name, T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015 |
| Type: JOIN |
|
|
| [21] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : Find the number of concerts happened in the stadium with the highest capacity |
| Pred: SELECT COUNT(*) FROM stadium AS T1 JOIN concert AS T2 ON T1.Stadium_ID = T2.stadium_id ORDER BY capacity DESC LIMIT 1 |
| Gold: SELECT COUNT(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1) |
| Type: ORDER_BY, LIMIT, NESTED, AGGREGATION |
|
|
| [22] WRONG_TABLE | DB: concert_singer | EX: β |
| Q : What are the number of concerts that occurred in the stadium with the largest capacity |
| Pred: SELECT COUNT(*) FROM stadium AS T1 JOIN concert AS T2 ON T1.stadium_id = T2.st stadium_id WHERE capacity = (SELECT MAX(capacity) FROM stadium) |
| Gold: SELECT COUNT(*) FROM concert WHERE stadium_id = (SELECT stadium_id FROM stadium ORDER BY capacity DESC LIMIT 1) |
| Type: ORDER_BY, LIMIT, NESTED, AGGREGATION |
|
|
| [23] MISSING_ORDER_BY | DB: pets_1 | EX: β |
| Q : Find the weight of the youngest dog |
| Pred: SELECT weight FROM pets WHERE pet_age = (SELECT MIN(age) FROM pets) |
| Gold: SELECT weight FROM pets ORDER BY pet_age LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [24] MISSING_ORDER_BY | DB: pets_1 | EX: β |
| Q : How much does the youngest dog weigh |
| Pred: SELECT Weight FROM pets WHERE age = (SELECT MIN(age) FROM pets) |
| Gold: SELECT weight FROM pets ORDER BY pet_age LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [25] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : Find number of pets owned by students who are older than 20 |
| Pred: SELECT COUNT(DISTINCT petid) FROM has_pet AS T1 JOIN pets AS T2 ON T1.petid = T2. petid JOIN student AS T3 ON T3.StuID = T4.StUID WHERE T3:age > 20 |
| Gold: SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20 |
| Type: JOIN, AGGREGATION |
|
|
| [26] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : How many pets are owned by students that have an age greater than 20 |
| Pred: SELECT COUNT(DISTINCT pettype) FROM pets AS T1 JOIN has_pet AS T2 ON T1.petid = T2. petid JOIN student AS T3 ON T3.StuID = T4.StUID WHERE T3:age > 20 |
| Gold: SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20 |
| Type: JOIN, AGGREGATION |
|
|
| [27] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : Find the number of dog pets that are raised by female students (with sex F) |
| Pred: SELECT COUNT(*) FROM pets WHERE sex = 'F' |
| Gold: SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog' |
| Type: JOIN, AGGREGATION |
|
|
| [28] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : How many dog pets are raised by female students |
| Pred: SELECT COUNT(*) FROM pets WHERE pettype = "dog" AND sex = "F" |
| Gold: SELECT COUNT(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T2.petid = T3.petid WHERE T1.sex = 'F' AND T3.pettype = 'dog' |
| Type: JOIN, AGGREGATION |
|
|
| [29] MISSING_JOIN | DB: pets_1 | EX: β |
| Q : Find the first name of students who have cat or dog pet |
| Pred: SELECT fname FROM Student WHERE pettype = "Cat" OR petType = "Dog" |
| Gold: SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog' |
| Type: JOIN |
|
|
| [30] MISSING_JOIN | DB: pets_1 | EX: β |
| Q : What are the first names of every student who has a cat or dog as a pet |
| Pred: SELECT fname FROM Student WHERE pettype = "Cat" OR petType = "Dog" |
| Gold: SELECT DISTINCT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' OR T3.pettype = 'dog' |
| Type: JOIN |
|
|
| [31] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : Find the first name of students who have both cat and dog pets |
| Pred: SELECT fname FROM Student WHERE StuID IN (SELECT T1.StuID FROM Has_pet AS T1 JOIN pets AS T2 ON T1.'spet.stuid = T2.stuID WHERE pettype = "Cat" INTERSECT SELECT T4.fname FROM has_pet WHERE petType = "Dog") |
| Gold: SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'cat' INTERSECT SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'dog' |
| Type: JOIN |
|
|
| [32] WRONG_COLUMNS | DB: pets_1 | EX: β |
| Q : What are the students' first names who have both cats and dogs as pets |
| Pred: SELECT DISTINCT T1.fname FROM Student AS T1 JOIN Has_pet AS T2 ON T2.StuID = T3.stuID WHERE Pets = "Cat" INTERSECT SELECT DISTINECT Fname |
| Gold: SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' INTERSECT SELECT T1.Fname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' |
| Type: JOIN |
|
|
| [33] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : Find the major and age of students who do not have a cat pet |
| Pred: SELECT major, age FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_pet AS T1 JOIN pets AS T2 ON T1?petid = T2.petid WHERE T2? pettype = "Cat") |
| Gold: SELECT major, age FROM student WHERE NOT stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat') |
| Type: JOIN, NESTED |
|
|
| [34] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : What major is every student who does not own a cat as a pet, and also how old are they |
| Pred: SELECT major, age FROM student WHERE NOT StuID IN (SELECT T1.StuID FROM has_pet AS T1 JOIN pets AS T2 ON T1?petid = T2.petid WHERE T2."animaltype = "Cat") |
| Gold: SELECT major, age FROM student WHERE NOT stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat') |
| Type: JOIN, NESTED |
|
|
| [35] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : Find the id of students who do not have a cat pet |
| Pred: SELECT stuid FROM Student EXCEPT SELECT StuID FROM Has_pet |
| Gold: SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' |
| Type: JOIN |
|
|
| [36] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : What are the ids of the students who do not own cats as pets |
| Pred: SELECT stuID FROM Student EXCEPT SELECT has_pet.stuid FROM Pets WHERE pettype = "Cat" |
| Gold: SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat' |
| Type: JOIN |
|
|
| [37] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : Find the first name and age of students who have a dog but do not have a cat as a pet |
| Pred: SELECT fname, age FROM Student WHERE StuID IN (SELECT DISTINCT T1.StuID FROM Has_pet AS T1 JOIN pets AS T2 ON T2.petid = T1.'sCat') |
| Gold: SELECT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND NOT T1.stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat') |
| Type: JOIN, NESTED |
|
|
| [38] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : What is the first name of every student who has a dog but does not have a cat |
| Pred: SELECT fname FROM Student WHERE StuID IN (SELECT DISTINCT T1.StuID FROM Has_pet AS T1 JOIN pets AS T2 ON T2.petid = T1.'sCat') |
| Gold: SELECT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND NOT T1.stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat') |
| Type: JOIN, NESTED |
|
|
| [39] MISSING_ORDER_BY | DB: pets_1 | EX: β |
| Q : Find the type and weight of the youngest pet |
| Pred: SELECT pettype, weight FROM pets WHERE pet_age = (SELECT MIN(age) FROM pets) |
| Gold: SELECT pettype, weight FROM pets ORDER BY pet_age LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [40] MISSING_ORDER_BY | DB: pets_1 | EX: β |
| Q : What type of pet is the youngest animal, and how much does it weigh |
| Pred: SELECT pettype, weight FROM pets WHERE pet_age = (SELECT MIN(weight) FROM pets) |
| Gold: SELECT pettype, weight FROM pets ORDER BY pet_age LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [41] WRONG_COLUMNS | DB: pets_1 | EX: β |
| Q : Find the average and maximum age for each type of pet |
| Pred: SELECT AVG(Pet_age), MAX(Age), pettype FROM pets GROUP BY pettype |
| Gold: SELECT AVG(pet_age), MAX(pet_age), pettype FROM pets GROUP BY pettype |
| Type: GROUP_BY, AGGREGATION |
|
|
| [42] WRONG_COLUMNS | DB: pets_1 | EX: β |
| Q : What is the average and maximum age for each pet type |
| Pred: SELECT pettype, AVG(Pet_age), MAX(Age) FROM pets GROUP BY pettype |
| Gold: SELECT AVG(pet_age), MAX(pet_age), pettype FROM pets GROUP BY pettype |
| Type: GROUP_BY, AGGREGATION |
|
|
| [43] WRONG_COLUMNS | DB: pets_1 | EX: β |
| Q : Find the average weight for each pet type |
| Pred: SELECT pettype, AVG(weight) FROM pets GROUP BY pettype |
| Gold: SELECT AVG(weight), pettype FROM pets GROUP BY pettype |
| Type: GROUP_BY, AGGREGATION |
|
|
| [44] WRONG_COLUMNS | DB: pets_1 | EX: β |
| Q : What is the average weight for each type of pet |
| Pred: SELECT pettype, AVG(weight) FROM pets GROUP BY pettype |
| Gold: SELECT AVG(weight), pettype FROM pets GROUP BY pettype |
| Type: GROUP_BY, AGGREGATION |
|
|
| [45] MISSING_JOIN | DB: pets_1 | EX: β |
| Q : Find the first name and age of students who have a pet |
| Pred: SELECT fname, age FROM Student WHERE pet_age = 1 |
| Gold: SELECT DISTINCT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid |
| Type: JOIN |
|
|
| [46] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : What are the different first names and ages of the students who do have pets |
| Pred: SELECT DISTINCT Fname, Age FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_pet) |
| Gold: SELECT DISTINCT T1.fname, T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid |
| Type: JOIN |
|
|
| [47] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : Find the id of the pet owned by student whose last name is βSmithβ |
| Pred: SELECT petid FROM has_pet AS T1 JOIN pets AS T2 ON T1.petid = T2.petID JOIN Student AS T3 ON T3.StuID = T4.stuID WHERE t3.Lname = 'Smith' |
| Gold: SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith' |
| Type: JOIN |
|
|
| [48] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : What is the id of the pet owned by the student whose last name is 'Smith' |
| Pred: SELECT petid FROM Pets WHERE lname = 'Smith' |
| Gold: SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith' |
| Type: JOIN |
|
|
| [49] WRONG_TABLE | DB: pets_1 | EX: β |
| Q : Find the number of pets for each student who has any pet and student id |
| Pred: SELECT COUNT(*), StuID FROM Has_pet AS T1 JOIN Student AS T2 ON T1.StuID = T2.Student |
| Gold: SELECT COUNT(*), T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [50] MISSING_JOIN | DB: pets_1 | EX: β |
| Q : For students who have pets , how many pets does each student have ? list their ids instead of names |
| Pred: SELECT petid, COUNT(*) FROM Student GROUP BY petid |
| Gold: SELECT COUNT(*), t1.stuid FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid GROUP BY t1.stuid |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [51] MISSING_JOIN | DB: pets_1 | EX: β |
| Q : Find the first name and gender of student who have more than one pet |
| Pred: SELECT fname, sex FROM Student GROUP BY sex HAVING COUNT(*) > 1 |
| Gold: SELECT T1.fname, T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [52] MISSING_JOIN | DB: pets_1 | EX: β |
| Q : What is the first name and gender of the all the students who have more than one pet |
| Pred: SELECT fname, sex FROM Student GROUP BY sex HAVING COUNT(*) > 1 |
| Gold: SELECT T1.fname, T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [53] MISSING_JOIN | DB: pets_1 | EX: β |
| Q : Find the last name of the student who has a cat that is age 3 |
| Pred: SELECT lname FROM Student WHERE pet_age = 3 |
| Gold: SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pet_age = 3 AND T3.pettype = 'cat' |
| Type: JOIN |
|
|
| [54] MISSING_JOIN | DB: pets_1 | EX: β |
| Q : What is the last name of the student who has a cat that is 3 years old |
| Pred: SELECT lname FROM Student WHERE age = 3 AND pets = "Cat" |
| Gold: SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pet_age = 3 AND T3.pettype = 'cat' |
| Type: JOIN |
|
|
| [55] MISSING_GROUP_BY | DB: car_1 | EX: β |
| Q : How many countries does each continent have? List the continent id, continent name and the number of countries |
| Pred: SELECT T1.columbus, T2. continent, COUNT(*) FROM continents AS T1 JOIN countries AS T2 ON T1."continent" |
| Gold: SELECT T1.ContId, T1.Continent, COUNT(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [56] MISSING_GROUP_BY | DB: car_1 | EX: β |
| Q : For each continent, list its id, name, and how many countries it has |
| Pred: SELECT T1.columbus, T2. continent, COUNT(*) FROM continents AS T1 JOIN countries AS T2 ON T1."continent" |
| Gold: SELECT T1.ContId, T1.Continent, COUNT(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [57] WRONG_TABLE | DB: car_1 | EX: β |
| Q : How many models does each car maker produce? List maker full name, id and the number |
| Pred: SELECT T2.fullname, T1.id, COUNT(*) FROM car_names AS T1 JOIN make_makers AS T2 ON T1?makeid = T3.id GROUP BY T1!makeid |
| Gold: SELECT T1.FullName, T1.Id, COUNT(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [58] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the full name of each car maker, along with its id and how many models it produces |
| Pred: SELECT T2.fullname, COUNT(*) FROM car_names AS T1 JOIN car_makers AS T2 ON T1.makeid = T 2.id GROUP BY T2-fullname |
| Gold: SELECT T1.FullName, T1.Id, COUNT(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [59] MISSING_JOIN | DB: car_1 | EX: β |
| Q : Which model of the car has the minimum horsepower |
| Pred: SELECT model FROM car_names ORDER BY horsepower LIMIT 1 |
| Gold: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.horsepower ASC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [60] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the model of the car with the smallest amount of horsepower |
| Pred: SELECT model FROM cars_data ORDER BY horsepower ASC LIMIT 1 |
| Gold: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.horsepower ASC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [61] MISSING_JOIN | DB: car_1 | EX: β |
| Q : Find the model of the car whose weight is below the average weight |
| Pred: SELECT model FROM car_names WHERE weight < (SELECT AVG(weight) FROM cars_data) |
| Gold: SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Weight < (SELECT AVG(Weight) FROM CARS_DATA) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [62] MISSING_JOIN | DB: car_1 | EX: β |
| Q : What is the model for the car with a weight smaller than the average |
| Pred: SELECT model FROM car_names WHERE weight < (SELECT AVG(weight) FROM cars_data) |
| Gold: SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Weight < (SELECT AVG(Weight) FROM CARS_DATA) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [63] WRONG_TABLE | DB: car_1 | EX: β |
| Q : Find the name of the makers that produced some cars in the year of 1970 |
| Pred: SELECT T2.make FROM model_list AS T1 JOIN car_makers AS T2 ON T1.makeid = T 2.id WHERE YEAR = 1970 |
| Gold: SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker JOIN CAR_NAMES AS T3 ON T2.model = T3.model JOIN CARS_DATA AS T4 ON T3.MakeId = T4.id WHERE T4.year = '1970' |
| Type: JOIN |
|
|
| [64] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the name of the different car makers who produced a car in 1970 |
| Pred: SELECT DISTINCT T2.make FROM model_list AS T1 JOIN car_names AS T2 ON T1.model = T2.'til 1970' |
| Gold: SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker JOIN CAR_NAMES AS T3 ON T2.model = T3.model JOIN CARS_DATA AS T4 ON T3.MakeId = T4.id WHERE T4.year = '1970' |
| Type: JOIN |
|
|
| [65] WRONG_TABLE | DB: car_1 | EX: β |
| Q : Find the make and production time of the cars that were produced in the earliest year |
| Pred: SELECT make, MAX(year) FROM car_names ORDER BY YEAR LIMIT 1 |
| Gold: SELECT T2.Make, T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Year = (SELECT MIN(YEAR) FROM CARS_DATA) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [66] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the maker of the carr produced in the earliest year and what year was it |
| Pred: SELECT maker, model FROM car_names ORDER BY model ASC LIMIT 1 |
| Gold: SELECT T2.Make, T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Year = (SELECT MIN(YEAR) FROM CARS_DATA) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [67] WRONG_TABLE | DB: car_1 | EX: β |
| Q : Which distinct car models are the produced after 1980 |
| Pred: SELECT DISTINCT model FROM car_names WHERE YEAR > 1980 |
| Gold: SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980 |
| Type: JOIN |
|
|
| [68] MISSING_JOIN | DB: car_1 | EX: β |
| Q : What are the different models for the cards produced after 1980 |
| Pred: SELECT DISTINCT model FROM model_list WHERE YEAR > 1980 |
| Gold: SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980 |
| Type: JOIN |
|
|
| [69] WRONG_TABLE | DB: car_1 | EX: β |
| Q : How many car makers are there in each continents? List the continent name and the count |
| Pred: SELECT continent, COUNT(*) FROM car_names GROUP BY continent |
| Gold: SELECT T1.Continent, COUNT(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.continent JOIN car_makers AS T3 ON T2.CountryId = T3.Country GROUP BY T1.Continent |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [70] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the name of each continent and how many car makers are there in each one |
| Pred: SELECT continent, COUNT(*) FROM car_names GROUP BY continent |
| Gold: SELECT T1.Continent, COUNT(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.continent JOIN car_makers AS T3 ON T2.CountryId = T3.Country GROUP BY T1.Continent |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [71] MISSING_JOIN | DB: car_1 | EX: β |
| Q : Which of the countries has the most car makers? List the country name |
| Pred: SELECT countryname FROM car_makers GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId GROUP BY T1.Country ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [72] MISSING_JOIN | DB: car_1 | EX: β |
| Q : What is the name of the country with the most car makers |
| Pred: SELECT country FROM car_makers GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId GROUP BY T1.Country ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [73] WRONG_TABLE | DB: car_1 | EX: β |
| Q : How many car models are produced by each maker ? Only list the count and the maker full name |
| Pred: SELECT COUNT(*), T2.maker FROM car_names AS T1 JOIN model_list AS T2 ON T1.model = T2.' GROUP BY T2.-maker |
| Gold: SELECT COUNT(*), t2.fullname FROM model_list AS t1 JOIN car_makers AS t2 ON t1.maker = t2.id GROUP BY t2.id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [74] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the number of car models that are produced by each maker and what is the id and full name of each maker |
| Pred: SELECT T1.id, T2.fullname, T3.make, COUNT(*) FROM car_names AS T1 JOIN model_list AS T2 ON t1.model = t2.model JOIN make_makers AS T3 ON T2?makeid = T3? |
| Gold: SELECT COUNT(*), T2.FullName, T2.id FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id GROUP BY T2.id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [75] WRONG_COLUMNS | DB: car_1 | EX: β |
| Q : What is the accelerate of the car make amc hornet sportabout (sw) |
| Pred: SELECT accelerate FROM cars_data AS T1 JOIN car_names AS T2 ON T1.id = T2.makeid JOIN models AS T3 ON T3.model = t2.model WHERE t3.name = "Amc hornet sportabout (sw)" |
| Gold: SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T2.Make = 'amc hornet sportabout (sw)' |
| Type: JOIN |
|
|
| [76] WRONG_COLUMNS | DB: car_1 | EX: β |
| Q : How much does the car accelerate that makes amc hornet sportabout (sw) |
| Pred: SELECT accelerate FROM cars_data AS T1 JOIN car_names AS T2 ON T1.id = T2.makeid JOIN models AS T3 ON T3.model = T4.model WHERE t3.name = "Amc hornet sportabout (sw)" |
| Gold: SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T2.Make = 'amc hornet sportabout (sw)' |
| Type: JOIN |
|
|
| [77] MISSING_JOIN | DB: car_1 | EX: β |
| Q : How many car makers are there in france |
| Pred: SELECT COUNT(*) FROM car_makers WHERE country = "France" |
| Gold: SELECT COUNT(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId WHERE T2.CountryName = 'france' |
| Type: JOIN, AGGREGATION |
|
|
| [78] OTHER | DB: car_1 | EX: β |
| Q : What is the number of makers of care in France |
| Pred: SELECT COUNT(*) FROM car_makers AS T1 JOIN countries AS T2 ON T1.countryid = T2.country JOIN car_names AS T3 ON T3.makeid = t2.id WHERE T2.'country = 'France' |
| Gold: SELECT COUNT(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId WHERE T2.CountryName = 'france' |
| Type: JOIN, AGGREGATION |
|
|
| [79] WRONG_TABLE | DB: car_1 | EX: β |
| Q : How many car models are produced in the usa |
| Pred: SELECT COUNT(*) FROM car_names AS T1 JOIN model_list AS T2 ON T1.model = T2.model WHERE make = 'Usa' |
| Gold: SELECT COUNT(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id JOIN COUNTRIES AS T3 ON T2.Country = T3.CountryId WHERE T3.CountryName = 'usa' |
| Type: JOIN, AGGREGATION |
|
|
| [80] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the count of the car models produced in the United States |
| Pred: SELECT COUNT(*) FROM car_names AS T1 JOIN car_makers AS T2 ON T1.makeid = T2.id JOIN countries AS T3 ON T3.continent = T4.contid WHERE T2."countryname = "United States" |
| Gold: SELECT COUNT(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker = T2.Id JOIN COUNTRIES AS T3 ON T2.Country = T3.CountryId WHERE T3.CountryName = 'usa' |
| Type: JOIN, AGGREGATION |
|
|
| [81] EXTRA_JOIN | DB: car_1 | EX: β |
| Q : What is the smallest weight of the car produced with 8 cylinders on 1974 |
| Pred: SELECT MIN(T2.weight) FROM cars_data AS T1 JOIN car_names AS T2 ON T1.id = T2.makeid WHERE cylinders = 8 AND YEAR = 1974 |
| Gold: SELECT MIN(weight) FROM cars_data WHERE cylinders = 8 AND year = 1974 |
| Type: AGGREGATION |
|
|
| [82] EXTRA_JOIN | DB: car_1 | EX: β |
| Q : What is the minimum weight of the car with 8 cylinders produced in 1974 |
| Pred: SELECT MIN(T2.weight) FROM cars_data AS T1 JOIN car_names AS T2 ON T1.id = T2.makeid JOIN cars AS T3 ON t1.model = T3.model WHERE t1."year = 1974" GROUP BY t1.(*) ORDER BY COUNT(*) ASC LIMIT 8 |
| Gold: SELECT MIN(weight) FROM cars_data WHERE cylinders = 8 AND year = 1974 |
| Type: AGGREGATION |
|
|
| [83] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are all the makers and models |
| Pred: SELECT maker, model FROM model_names |
| Gold: SELECT Maker, Model FROM MODEL_LIST |
| Type: SIMPLE |
|
|
| [84] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the makers and models |
| Pred: SELECT maker, model FROM model_names |
| Gold: SELECT Maker, Model FROM MODEL_LIST |
| Type: SIMPLE |
|
|
| [85] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the countries having at least one car maker? List name and id |
| Pred: SELECT T2.countryname, T1.id FROM car_makers AS T1 JOIN countries AS T2 ON T1.'s1.countryid = T2.' |
| Gold: SELECT T1.CountryName, T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.CountryId HAVING COUNT(*) >= 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [86] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the names and ids of all countries with at least one car maker |
| Pred: SELECT countryname, countryid FROM car_makers GROUP BY countryid HAVING COUNT(*) >= 1 |
| Gold: SELECT T1.CountryName, T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.CountryId HAVING COUNT(*) >= 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [87] WRONG_COLUMNS | DB: car_1 | EX: β |
| Q : What is the average weight and year for each year |
| Pred: SELECT AVG(weight), AVG(year), YEAR FROM cars_data GROUP BY YEAR |
| Gold: SELECT AVG(Weight), YEAR FROM CARS_DATA GROUP BY YEAR |
| Type: GROUP_BY, AGGREGATION |
|
|
| [88] MISSING_JOIN | DB: car_1 | EX: β |
| Q : Which countries in europe have at least 3 car manufacturers |
| Pred: SELECT countryname FROM countries WHERE continent = "europe" GROUP BY countryname HAVING COUNT(*) >= 3 |
| Gold: SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent = T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId = T3.Country WHERE T2.Continent = 'europe' GROUP BY T1.CountryName HAVING COUNT(*) >= 3 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [89] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the names of all European countries with at least 3 manufacturers |
| Pred: SELECT T3.countryname FROM car_makers AS T1 JOIN countries AS T2 ON T1.countryid = T2.continent JOIN car_names AS T3 ON t2.makeid = t3.id WHERE t1.name = 'European' GROUP BY T3 .countryname HAVING COUNT(*) >= 3 |
| Gold: SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent = T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId = T3.Country WHERE T2.Continent = 'europe' GROUP BY T1.CountryName HAVING COUNT(*) >= 3 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [90] MISSING_JOIN | DB: car_1 | EX: β |
| Q : What is the maximum horsepower and the make of the car models with 3 cylinders |
| Pred: SELECT MAX( horsepower), MAX(make) FROM car_names WHERE cylinders = 3 |
| Gold: SELECT T2.horsepower, T1.Make FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.cylinders = 3 ORDER BY T2.horsepower DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [91] MISSING_JOIN | DB: car_1 | EX: β |
| Q : What is the largest amount of horsepower for the models with 3 cylinders and what make is it |
| Pred: SELECT model, make FROM car_names WHERE cylinders = 3 ORDER BY horsepower DESC LIMIT 1 |
| Gold: SELECT T2.horsepower, T1.Make FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.cylinders = 3 ORDER BY T2.horsepower DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [92] MISSING_JOIN | DB: car_1 | EX: β |
| Q : Which model saves the most gasoline? That is to say, have the maximum miles per gallon |
| Pred: SELECT model FROM car_names ORDER BY mpg DESC LIMIT 1 |
| Gold: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id ORDER BY T2.mpg DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [93] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the car model with the highest mpg |
| Pred: SELECT model FROM cars_data ORDER BY mpg DESC LIMIT 1 |
| Gold: SELECT t1.model FROM car_names AS t1 JOIN cars_data AS t2 ON t1.makeid = t2.id ORDER BY t2.mpg DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [94] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the average edispl of the cars of model volvo |
| Pred: SELECT AVG(T2.edispl) FROM model_list AS T1 JOIN car_names AS T2 ON T1.model = T2.model WHERE t1.Model = "volvo" |
| Gold: SELECT AVG(T2.edispl) FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T1.Model = 'volvo' |
| Type: JOIN, AGGREGATION |
|
|
| [95] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the average edispl for all volvos |
| Pred: SELECT AVG(Edispl) FROM cars_data |
| Gold: SELECT AVG(T2.edispl) FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T1.Model = 'volvo' |
| Type: JOIN, AGGREGATION |
|
|
| [96] WRONG_COLUMNS | DB: car_1 | EX: β |
| Q : What is the maximum accelerate for different number of cylinders |
| Pred: SELECT MAX(celeration), COUNT(*) FROM cars_data GROUP BY cylinders |
| Gold: SELECT MAX(Accelerate), Cylinders FROM CARS_DATA GROUP BY Cylinders |
| Type: GROUP_BY, AGGREGATION |
|
|
| [97] WRONG_COLUMNS | DB: car_1 | EX: β |
| Q : What is the maximum accelerate for all the different cylinders |
| Pred: SELECT MAX(celeration), cylinders FROM cars_data GROUP BY cylinders |
| Gold: SELECT MAX(Accelerate), Cylinders FROM CARS_DATA GROUP BY Cylinders |
| Type: GROUP_BY, AGGREGATION |
|
|
| [98] WRONG_TABLE | DB: car_1 | EX: β |
| Q : Which model has the most version(make) of cars |
| Pred: SELECT model FROM model_list GROUP BY model ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [99] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What model has the most different versions |
| Pred: SELECT model FROM model GROUP BY model ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [100] WRONG_TABLE | DB: car_1 | EX: β |
| Q : how many cars were produced in 1980 |
| Pred: SELECT COUNT(*) FROM car_names WHERE YEAR = 1980 |
| Gold: SELECT COUNT(*) FROM CARS_DATA WHERE YEAR = 1980 |
| Type: AGGREGATION |
|
|
| [101] WRONG_TABLE | DB: car_1 | EX: β |
| Q : In 1980, how many cars were made |
| Pred: SELECT COUNT(*) FROM car_names AS T1 JOIN model_list AS T2 ON T1.model = T2.model JOIN make AS T3 ON T3.makeid = t2.id WHERE t1.year = 1980 |
| Gold: SELECT COUNT(*) FROM CARS_DATA WHERE YEAR = 1980 |
| Type: AGGREGATION |
|
|
| [102] WRONG_TABLE | DB: car_1 | EX: β |
| Q : How many car models were produced by the maker with full name American Motor Company |
| Pred: SELECT COUNT(*) FROM car_names AS T1 JOIN model_list AS T2 ON T1.model = T2.model JOIN car_makers AS T3 ON T3.makeid = t2.id WHERE t3.fullname = "American Motor Company" |
| Gold: SELECT COUNT(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker WHERE T1.FullName = 'American Motor Company' |
| Type: JOIN, AGGREGATION |
|
|
| [103] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the number of car models created by the car maker American Motor Company |
| Pred: SELECT COUNT(DISTINCT model) FROM car_names AS T1 JOIN models AS T2 ON T1.model = T2.model_list JOIN car_makers AS T3 ON T3.makeid = t2.id WHERE t3.name = "American Motor Company" |
| Gold: SELECT COUNT(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker WHERE T1.FullName = 'American Motor Company' |
| Type: JOIN, AGGREGATION |
|
|
| [104] WRONG_TABLE | DB: car_1 | EX: β |
| Q : Which makers designed more than 3 car models? List full name and the id |
| Pred: SELECT T2.fullname, T1.id FROM model_names AS T1 JOIN car_makers AS T2 ON T1?model = t2.model JOIN make_id AS T3 ON T3.makeid = T4.id GROUP BY T2-fullname HAVING COUNT(*) > 3 |
| Gold: SELECT T1.FullName, T1.Id FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id HAVING COUNT(*) > 3 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [105] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the names and ids of all makers with more than 3 models |
| Pred: SELECT T2.make, T1.id FROM model_list AS T1 JOIN car_names AS T2 ON T1?model = t2.model JOIN make_makers AS T3 ON T3.makeid = T2?makeid GROUP BY T1./makeid HAVING COUNT(*) > 3 |
| Gold: SELECT T1.FullName, T1.Id FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id HAVING COUNT(*) > 3 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [106] OTHER | DB: car_1 | EX: β |
| Q : Which distinctive models are produced by maker with the full name General Motors or weighing more than 3500 |
| Pred: SELECT DISTINCT T2.model FROM car_names AS T1 JOIN model_list AS T2 ON T1.model = T2 AS T3 JOIN car_makers AS T4 ON T3.makeid = T4.id WHERE T4:fullname = "General Motors" OR T3:weight > 3500 |
| Gold: SELECT DISTINCT T2.Model FROM CAR_NAMES AS T1 JOIN MODEL_LIST AS T2 ON T1.Model = T2.Model JOIN CAR_MAKERS AS T3 ON T2.Maker = T3.Id JOIN CARS_DATA AS T4 ON T1.MakeId = T4.Id WHERE T3.FullName = 'General Motors' OR T4.weight > 3500 |
| Type: JOIN |
|
|
| [107] OTHER | DB: car_1 | EX: β |
| Q : What are the different models created by either the car maker General Motors or weighed more than 3500 |
| Pred: SELECT DISTINCT T2.model FROM car_names AS T1 JOIN model_list AS T2 ON T1.makeid = T3.id JOIN car_ names AS T3 ON T3:model = T2:model WHERE T1."name = "General Motors" OR T3!weight > 3500 |
| Gold: SELECT DISTINCT T2.Model FROM CAR_NAMES AS T1 JOIN MODEL_LIST AS T2 ON T1.Model = T2.Model JOIN CAR_MAKERS AS T3 ON T2.Maker = T3.Id JOIN CARS_DATA AS T4 ON T1.MakeId = T4.Id WHERE T3.FullName = 'General Motors' OR T4.weight > 3500 |
| Type: JOIN |
|
|
| [108] WRONG_TABLE | DB: car_1 | EX: β |
| Q : In which years cars were produced weighing no less than 3000 and no more than 4000 |
| Pred: SELECT YEAR FROM car_names WHERE weight < 3000 INTERSECT SELECT YEAR FROM cars_data WHERE weight > 4000 |
| Gold: SELECT DISTINCT year FROM cars_data WHERE weight BETWEEN 3000 AND 4000 |
| Type: SIMPLE |
|
|
| [109] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the different years in which there were cars produced that weighed less than 4000 and also cars that weighted more than 3000 |
| Pred: SELECT DISTINCT YEAR FROM car_names AS T1 JOIN cars_data AS T2 ON T1.id = T2.model JOIN car_makers AS T3 ON T2."engineer = T3.id WHERE t2.weight < 4000 INTERSECT SELECT MAX(YEAR) FROM cars_names WHERE weight > 3000 |
| Gold: SELECT DISTINCT year FROM cars_data WHERE weight BETWEEN 3000 AND 4000 |
| Type: SIMPLE |
|
|
| [110] WRONG_COLUMNS | DB: car_1 | EX: β |
| Q : What is the horsepower of the car with the largest accelerate |
| Pred: SELECT horsepower FROM cars_data ORDER BY accelerate DESC LIMIT 1 |
| Gold: SELECT T1.horsepower FROM CARS_DATA AS T1 ORDER BY T1.accelerate DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [111] WRONG_COLUMNS | DB: car_1 | EX: β |
| Q : What is the horsepower of the car with the greatest accelerate |
| Pred: SELECT horsepower FROM cars_data ORDER BY accelerate DESC LIMIT 1 |
| Gold: SELECT T1.horsepower FROM CARS_DATA AS T1 ORDER BY T1.accelerate DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [112] MISSING_JOIN | DB: car_1 | EX: β |
| Q : For model volvo, how many cylinders does the car with the least accelerate have |
| Pred: SELECT cylinders FROM cars_data WHERE model = "volvo" ORDER BY accelerate LIMIT 1 |
| Gold: SELECT T1.cylinders FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T2.Model = 'volvo' ORDER BY T1.accelerate ASC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [113] WRONG_TABLE | DB: car_1 | EX: β |
| Q : For a volvo model, how many cylinders does the version with least accelerate have |
| Pred: SELECT cylinders FROM model_list WHERE model = "volvo" ORDER BY accelerate LIMIT 1 |
| Gold: SELECT T1.cylinders FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T2.Model = 'volvo' ORDER BY T1.accelerate ASC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [114] WRONG_TABLE | DB: car_1 | EX: β |
| Q : How many cars have a larger accelerate than the car with the largest horsepower |
| Pred: SELECT COUNT(*) FROM car_names WHERE accelerate > (SELECT MAX(celeration) FROM cars_data) ORDER BY horsepower DESC LIMIT 1 |
| Gold: SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate > (SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1) |
| Type: ORDER_BY, LIMIT, NESTED, AGGREGATION |
|
|
| [115] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What is the number of cars with a greater accelerate than the one with the most horsepower |
| Pred: SELECT COUNT(*) FROM car_names WHERE accelerate > (SELECT MAX(celeration) FROM cars_data GROUP BY mpg ORDER BY SUM(horsepower) DESC LIMIT 1) |
| Gold: SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate > (SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1) |
| Type: ORDER_BY, LIMIT, NESTED, AGGREGATION |
|
|
| [116] WRONG_TABLE | DB: car_1 | EX: β |
| Q : How many countries has more than 2 car makers |
| Pred: SELECT COUNT(*) FROM car_makers WHERE maker > 2 |
| Gold: SELECT COUNT(*) FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [117] OTHER | DB: car_1 | EX: β |
| Q : What is the number of countries with more than 2 car makers |
| Pred: SELECT COUNT(*) FROM countries AS T1 JOIN car_makers AS T2 ON T1.countryid = T2.country GROUP BY T1.(*) HAVING COUNT (*) > 2 |
| Gold: SELECT COUNT(*) FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [118] MISSING_JOIN | DB: car_1 | EX: β |
| Q : For the cars with 4 cylinders, which model has the largest horsepower |
| Pred: SELECT model FROM car_names WHERE cylinders = 4 ORDER BY horsepower DESC LIMIT 4 |
| Gold: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Cylinders = 4 ORDER BY T2.horsepower DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [119] MISSING_JOIN | DB: car_1 | EX: β |
| Q : For all of the 4 cylinder cars, which model has the most horsepower |
| Pred: SELECT model FROM car_names WHERE cylinders = 4 ORDER BY horsepower DESC LIMIT 1 |
| Gold: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Cylinders = 4 ORDER BY T2.horsepower DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [120] WRONG_TABLE | DB: car_1 | EX: β |
| Q : Among the cars with more than lowest horsepower, which ones do not have more than 3 cylinders? List the car makeid and make name |
| Pred: SELECT makeid, make FROM car_names WHERE horsepower < (SELECT MIN(horsepower) FROM cars_data WHERE cylinders > 3) |
| Gold: SELECT T2.MakeId, T2.Make FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id = T2.MakeId WHERE T1.Horsepower > (SELECT MIN(Horsepower) FROM CARS_DATA) AND T1.Cylinders <= 3 |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [121] WRONG_TABLE | DB: car_1 | EX: β |
| Q : Among the cars that do not have the minimum horsepower , what are the make ids and names of all those with less than 4 cylinders |
| Pred: SELECT makeid, model FROM car_names WHERE mpg < 4 EXCEPT SELECT T1.makeid, T2.model FROM cars_data AS T1 JOIN cars_names AS T2 ON T1?model = T2?model_list JOIN make_makers AS T3 ON T3.id = t2.manufacturer WHERE t3.hp < 4 |
| Gold: SELECT t2.makeid, t2.make FROM cars_data AS t1 JOIN car_names AS t2 ON t1.id = t2.makeid WHERE t1.horsepower > (SELECT MIN(horsepower) FROM cars_data) AND t1.cylinders < 4 |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [122] WRONG_TABLE | DB: car_1 | EX: β |
| Q : Which models are lighter than 3500 but not built by the 'Ford Motor Company' |
| Pred: SELECT model FROM model_list WHERE model < 3500 EXCEPT SELECT model FROM car_names AS T1 JOIN car_list AS T2 ON T1.model = T2.model JOIN make_makers AS T3 ON T3.makeid = T4.id WHERE t3.name = 'Ford Motor Company' |
| Gold: SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.Model = T2.Model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.Id JOIN CAR_MAKERS AS T4 ON T1.Maker = T4.Id WHERE T3.weight < 3500 AND T4.FullName <> 'Ford Motor Company' |
| Type: JOIN |
|
|
| [123] WRONG_COLUMNS | DB: car_1 | EX: β |
| Q : What are the different models wthat are lighter than 3500 but were not built by the Ford Motor Company |
| Pred: SELECT DISTINCT model FROM model_list AS T1 JOIN car_names AS T2 ON T1.model = T2.model JOIN make_makers AS T3 ON T3.makeid = T4.id WHERE T1."weight < 3500 EXCEPT SELECT DISTINELLERAT model FROM Model_List AS T4 JOIN Car_Names AS T5 ON T5.Model = T8.Model WHERE t3.name = "Ford Motor Company" |
| Gold: SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.Model = T2.Model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.Id JOIN CAR_MAKERS AS T4 ON T1.Maker = T4.Id WHERE T3.weight < 3500 AND T4.FullName <> 'Ford Motor Company' |
| Type: JOIN |
|
|
| [124] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the name of the countries where there is not a single car maker |
| Pred: SELECT countryname FROM countries WHERE NOT countryid IN (SELECT country FROM car_makers) |
| Gold: SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId = T2.Country |
| Type: JOIN |
|
|
| [125] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the names of the countries with no car makers |
| Pred: SELECT countryname FROM countries WHERE NOT countryid IN (SELECT country FROM car_makers) |
| Gold: SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId = T2.Country |
| Type: JOIN |
|
|
| [126] MISSING_GROUP_BY | DB: car_1 | EX: β |
| Q : Which are the car makers which produce at least 2 models and more than 3 car makers ? List the id and the maker |
| Pred: SELECT T1.id, T2.maker FROM car_makers AS T1 JOIN model_list AS T2 ON T1."id = t2.model JOIN make_names AS T3 ON T3.makeid = T1 |
| Gold: SELECT t1.id, t1.maker FROM car_makers AS t1 JOIN model_list AS t2 ON t1.id = t2.maker GROUP BY t1.id HAVING COUNT(*) >= 2 INTERSECT SELECT t1.id, t1.maker FROM car_makers AS t1 JOIN model_list AS t2 ON t1.id = t2.maker JOIN car_names AS t3 ON t2.model = t3.model GROUP BY t1.id HAVING COUNT(*) > 3 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [127] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the ids and makers of all car makers that produce at least 2 models and make more than 3 cars |
| Pred: SELECT T1.id, T2.make FROM car_makers AS T1 JOIN model_names AS T2 ON T1."id = t2.model JOIN make_cars AS T3 ON T3.makeid = T1?id GROUP BY T 1.id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.(*) FROM CAR_MAULES AS T4 JOIN MEMBER AS T5 ON T4.model = T5.Model JOIN Manufacturers AS T6 ON T5? |
| Gold: SELECT T1.Id, T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker GROUP BY T1.Id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.Id, T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker JOIN CAR_NAMES AS T3 ON T2.model = T3.model GROUP BY T1.Id HAVING COUNT(*) > 3 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [128] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the id and names of the countries which have more than 3 car makers or produce the 'fiat' model |
| Pred: SELECT T2.countryid, T1.countryname FROM car_makers AS T1 JOIN countries AS T2 ON T1, T2 = T3.country JOIN model_names AS T4 ON T4.model = T1.'Fiat' GROUP BY T2 .countryid HAVING COUNT(*) > 3 |
| Gold: SELECT T1.countryId, T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.countryId HAVING COUNT(*) > 3 UNION SELECT T1.countryId, T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country JOIN MODEL_LIST AS T3 ON T2.Id = T3.Maker WHERE T3.Model = 'fiat' |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [129] WRONG_TABLE | DB: car_1 | EX: β |
| Q : What are the ids and names of all countries that either have more than 3 car makers or produce fiat model |
| Pred: SELECT T1.countryid, T2.countryname FROM car_makers AS T1 JOIN countries AS T2 ON T3.country = T2.' GROUP BY T1:countryid HAVING COUNT(*) > 3 UNION SELECT T1.(*) FROM country AS T4 JOIN car_names AS T5 ON T4.id = T5.country_names WHERE T5:make = 'Fiat' |
| Gold: SELECT t1.countryid, t1.countryname FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country GROUP BY t1.countryid HAVING COUNT(*) > 3 UNION SELECT t1.countryid, t1.countryname FROM countries AS t1 JOIN car_makers AS t2 ON t1.countryid = t2.country JOIN model_list AS t3 ON t2.id = t3.maker WHERE t3.model = 'fiat' |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [130] OTHER | DB: flight_2 | EX: β |
| Q : Which city and country is the Alton airport at |
| Pred: SELECT city, country FROM airports WHERE airport = "Alton" |
| Gold: SELECT City, Country FROM AIRPORTS WHERE AirportName = "Alton" |
| Type: SIMPLE |
|
|
| [131] OTHER | DB: flight_2 | EX: β |
| Q : Give the city and country for the Alton airport |
| Pred: SELECT city, country FROM airports WHERE airport = "Alton" |
| Gold: SELECT City, Country FROM AIRPORTS WHERE AirportName = "Alton" |
| Type: SIMPLE |
|
|
| [132] OTHER | DB: flight_2 | EX: β |
| Q : Count the number of flights into ATO |
| Pred: SELECT COUNT(*) FROM flights WHERE sourceairport = "ATO" |
| Gold: SELECT COUNT(*) FROM FLIGHTS WHERE DestAirport = "ATO" |
| Type: AGGREGATION |
|
|
| [133] OTHER | DB: flight_2 | EX: β |
| Q : How many flights depart from City Aberdeen |
| Pred: SELECT COUNT(*) FROM flights AS T1 JOIN airports AS T2 ON T1.sourceairport = T2.airportcode WHERE city = "Aberdeen" |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen" |
| Type: JOIN, AGGREGATION |
|
|
| [134] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : Return the number of flights departing from Aberdeen |
| Pred: SELECT COUNT(*) FROM flights WHERE sourceairport = "Aberdeen" |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen" |
| Type: JOIN, AGGREGATION |
|
|
| [135] MISSING_WHERE | DB: flight_2 | EX: β |
| Q : How many flights arriving in Aberdeen city |
| Pred: SELECT COUNT(*) FROM flights AS T1 JOIN airports AS T2 ON T1.sourceairport = T2.airportcode JOIN cities AS T3 ON T3.city = T4. Aberdeen |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen" |
| Type: JOIN, AGGREGATION |
|
|
| [136] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : Return the number of flights arriving in Aberdeen |
| Pred: SELECT COUNT(*) FROM flights WHERE airport = "Aberdeen" |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen" |
| Type: JOIN, AGGREGATION |
|
|
| [137] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : How many flights depart from City 'Aberdeen' and have destination City 'Ashley' |
| Pred: SELECT COUNT(*) FROM flights WHERE city = "Aberdeen" AND destination = "Ashley" |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRPORTS AS T3 ON T1.SourceAirport = T3.AirportCode WHERE T2.City = "Ashley" AND T3.City = "Aberdeen" |
| Type: JOIN, AGGREGATION |
|
|
| [138] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : How many flights fly from Aberdeen to Ashley |
| Pred: SELECT COUNT(*) FROM flights WHERE sourceairport = "Aberdeen" AND airport = "Ashley" |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRPORTS AS T3 ON T1.SourceAirport = T3.AirportCode WHERE T2.City = "Ashley" AND T3.City = "Aberdeen" |
| Type: JOIN, AGGREGATION |
|
|
| [139] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : How many flights does airline 'JetBlue Airways' have |
| Pred: SELECT COUNT(*) FROM airlines AS T1 JOIN flights AS T2 ON T1.sourceairport = T2.airportcode WHERE airline = 'JetBlue Airways' |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = "JetBlue Airways" |
| Type: JOIN, AGGREGATION |
|
|
| [140] OTHER | DB: flight_2 | EX: β |
| Q : Give the number of Jetblue Airways flights |
| Pred: SELECT COUNT(*) FROM flights AS T1 JOIN airlines AS T2 ON T1.sourceairport = T2.airportcode WHERE airline = "Jetblue Airways" |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = "JetBlue Airways" |
| Type: JOIN, AGGREGATION |
|
|
| [141] OTHER | DB: flight_2 | EX: β |
| Q : How many 'United Airlines' flights go to Airport 'ASY' |
| Pred: SELECT COUNT(*) FROM airlines AS T1 JOIN flights AS T2 ON T1.sourceairport = T2.airportcode JOIN airports AS T3 ON T3.dISTINCT airportcode AS T4 ON T4. airportcode = T5.admitting station WHERE T4: airportname = 'ASY' |
| Gold: SELECT COUNT(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.DestAirport = "ASY" |
| Type: JOIN, AGGREGATION |
|
|
| [142] OTHER | DB: flight_2 | EX: β |
| Q : Count the number of United Airlines flights arriving in ASY Airport |
| Pred: SELECT COUNT(*) FROM airlines AS T1 JOIN flights AS T2 ON T1.sourceairport = T2.airportcode JOIN airports AS T3 ON T3.dISTINCT airportcode AS T4 ON T4. airportcode = T5.id WHERE t1.AirportName = "ASY" AND T 1.Aircraft = "United Airlines" |
| Gold: SELECT COUNT(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.DestAirport = "ASY" |
| Type: JOIN, AGGREGATION |
|
|
| [143] OTHER | DB: flight_2 | EX: β |
| Q : How many 'United Airlines' flights depart from Airport 'AHD' |
| Pred: SELECT COUNT(*) FROM airlines AS T1 JOIN flights AS T2 ON T1.sourceairport = T2.airportcode JOIN airports AS T3 ON T3.dISTINCT airportcode AS T4 ON T4. airportcode = T5.advisor WHERE T4."AirportName = "AHD" |
| Gold: SELECT COUNT(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.SourceAirport = "AHD" |
| Type: JOIN, AGGREGATION |
|
|
| [144] OTHER | DB: flight_2 | EX: β |
| Q : Return the number of United Airlines flights leaving from AHD Airport |
| Pred: SELECT COUNT(*) FROM airlines AS T1 JOIN flights AS T2 ON T1.sourceairport = T2.airportcode JOIN airports AS T3 ON T3.dISTINCT airportcode AS T4 ON T4.id = T5.id WHERE T1?AirportName = "AHD" AND T1."United Airlines = "United Airlines" |
| Gold: SELECT COUNT(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.SourceAirport = "AHD" |
| Type: JOIN, AGGREGATION |
|
|
| [145] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : How many United Airlines flights go to City 'Aberdeen' |
| Pred: SELECT COUNT(*) FROM airlines AS T1 JOIN flights AS T2 ON T1. airline = T2.united Airlines WHERE city = 'Aberdeen' |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRLINES AS T3 ON T3.uid = T1.Airline WHERE T2.City = "Aberdeen" AND T3.Airline = "United Airlines" |
| Type: JOIN, AGGREGATION |
|
|
| [146] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Count the number of United Airlines flights that arrive in Aberdeen |
| Pred: SELECT COUNT(*) FROM airlines AS T1 JOIN flights AS T2 ON T1.sourceairport = T2.airportcode JOIN airports AS T3 ON T3.dISTINCT airport AS T4 ON T4. airportcode = T5.advisor WHERE T4:Airport = "Aberdeen" AND T1."United Airlines = "United Airlines" |
| Gold: SELECT COUNT(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode JOIN AIRLINES AS T3 ON T3.uid = T1.Airline WHERE T2.City = "Aberdeen" AND T3.Airline = "United Airlines" |
| Type: JOIN, AGGREGATION |
|
|
| [147] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which city has most number of arriving flights |
| Pred: SELECT city FROM flights GROUP BY city ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport GROUP BY T1.City ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [148] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : Which city has the most frequent destination airport |
| Pred: SELECT city FROM airports GROUP BY city ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport GROUP BY T1.City ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [149] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which city has most number of departing flights |
| Pred: SELECT city FROM flights GROUP BY city ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.SourceAirport GROUP BY T1.City ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [150] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : Which city is the most frequent source airport |
| Pred: SELECT city FROM airports GROUP BY city ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.SourceAirport GROUP BY T1.City ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [151] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : What is the code of airport that has the highest number of flights |
| Pred: SELECT T2. airportcode FROM flights AS T1 JOIN airports AS T2 ON T1.airportcode = T3.sourceairport GROUP BY T2.-airport ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [152] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : What is the airport code of the airport with the most flights |
| Pred: SELECT T2. airportcode FROM flights AS T1 JOIN airports AS T2 ON T1.airportcode = T3.sourceairport GROUP BY T2.-airport ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [153] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : What is the code of airport that has fewest number of flights |
| Pred: SELECT airportcode FROM airports GROUP BY airportcode ORDER BY COUNT(*) LIMIT 1 |
| Gold: SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY COUNT(*) LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [154] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Give the code of the airport with the least flights |
| Pred: SELECT T2. airportcode FROM flights AS T1 JOIN airports AS T2 ON T1.airportcode = T3.sourceairport ORDER BY T1:Flightno LIMIT 1 |
| Gold: SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY COUNT(*) LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [155] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which airline has most number of flights |
| Pred: SELECT airline FROM flights GROUP BY airline ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [156] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : What airline serves the most flights |
| Pred: SELECT airline FROM flights GROUP BY airline ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [157] WRONG_COLUMNS | DB: flight_2 | EX: β |
| Q : Find the abbreviation and country of the airline that has fewest number of flights |
| Pred: SELECT T1. abbreviation, T2.country FROM airlines AS T1 JOIN flights AS T2 ON T1."sourceairport = t2.airportcode GROUP BY T3. airline ORDER BY COUNT(*) LIMIT 1 |
| Gold: SELECT T1.Abbreviation, T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [158] WRONG_COLUMNS | DB: flight_2 | EX: β |
| Q : What is the abbreviation of the airilne has the fewest flights and what country is it in |
| Pred: SELECT T1.abbrev, T2.country FROM airlines AS T1 JOIN flights AS T2 ON T1."sourceairport = T2."destairport" GROUP BY T2.-airport ORDER BY COUNT(*) LIMIT 1 |
| Gold: SELECT T1.Abbreviation, T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [159] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : What are airlines that have some flight departing from airport 'AHD' |
| Pred: SELECT T2. airline FROM flights AS T1 JOIN airports AS T2 ON T1.airportcode = T2.'Destairport = T3.destairport WHERE T3."AirportName = 'AHD' |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "AHD" |
| Type: JOIN |
|
|
| [160] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which airlines have a flight with source airport AHD |
| Pred: SELECT T2.airline FROM airports AS T1 JOIN flights AS T2 ON T1.airportcode = T 2.sourceairport WHERE T 1.sourceAirport = "AHD" |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "AHD" |
| Type: JOIN |
|
|
| [161] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : What are airlines that have flights arriving at airport 'AHD' |
| Pred: SELECT T2.airline FROM airports AS T1 JOIN flights AS T2 ON T1.airportcode = t2.sourceairport WHERE t1. airportname = 'AHD' |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = "AHD" |
| Type: JOIN |
|
|
| [162] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which airlines have a flight with destination airport AHD |
| Pred: SELECT T2.airline FROM airports AS T1 JOIN flights AS T2 ON T1.airportcode = T 2.sourceairport WHERE T3. airportname = 'AHD' |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = "AHD" |
| Type: JOIN |
|
|
| [163] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Find all airlines that have flights from both airports 'APG' and 'CVO' |
| Pred: SELECT T2.airline FROM airports AS T1 JOIN flights AS T2 ON T1.airportcode = T 2.sourceairport WHERE T1."AirportName = "APG" INTERSECT SELECT T2.' airline FROM airport AS T3 JOIN flight AS T4 ON T3.AirportCode = T4 |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "APG" INTERSECT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "CVO" |
| Type: JOIN |
|
|
| [164] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which airlines have departing flights from both APG and CVO airports |
| Pred: SELECT T2.airline FROM airports AS T1 JOIN flights AS T2 ON T1.airportcode = T3.sourceairport WHERE T1."name = "APG" INTERSECT SELECT DISTINCT airline FROM airlines AS T4 JOIN flight AS T5 ON T4.irid = T5.iraiden WHERE T 1. airportName = "CVO" |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "APG" INTERSECT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "CVO" |
| Type: JOIN |
|
|
| [165] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Find all airlines that have flights from airport 'CVO' but not from 'APG' |
| Pred: SELECT T2. airline FROM flights AS T1 JOIN airports AS T2 ON T1.airportcode = T3.Airportcode WHERE T2."sourceairport" = "CVO" EXCEPT SELECT DISTINCT airline FROM airlines AS T3 JOIN airport AS T4 ON T3?AirportCode = "APG" |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "CVO" EXCEPT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "APG" |
| Type: JOIN |
|
|
| [166] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which airlines have departures from CVO but not from APG airports |
| Pred: SELECT airline FROM airlines WHERE departure = "CVO" EXCEPT SELECT airline FROM airports WHERE airportcode = "APG" |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "CVO" EXCEPT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "APG" |
| Type: JOIN |
|
|
| [167] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Find all airlines that have at least 10 flights |
| Pred: SELECT airline FROM flights GROUP BY airline HAVING COUNT(*) >= 10 |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING COUNT(*) > 10 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [168] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which airlines have at least 10 flights |
| Pred: SELECT airline FROM flights GROUP BY airline HAVING COUNT(*) >= 10 |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING COUNT(*) > 10 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [169] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Find all airlines that have fewer than 200 flights |
| Pred: SELECT airline FROM flights GROUP BY airline HAVING COUNT(*) < 200 |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING COUNT(*) < 200 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [170] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : Which airlines have less than 200 flights |
| Pred: SELECT airline FROM flights GROUP BY airline HAVING COUNT(*) < 200 |
| Gold: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING COUNT(*) < 200 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [171] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : What are flight numbers of Airline "United Airlines" |
| Pred: SELECT Flightno FROM airlines WHERE airline = "United Airlines" |
| Gold: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = "United Airlines" |
| Type: JOIN |
|
|
| [172] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : Which flight numbers correspond to United Airlines flights |
| Pred: SELECT Flightno FROM flights WHERE airline = "United Airlines" |
| Gold: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = "United Airlines" |
| Type: JOIN |
|
|
| [173] OTHER | DB: flight_2 | EX: β |
| Q : What are flight numbers of flights departing from Airport "APG" |
| Pred: SELECT Flightno FROM flights WHERE AirportName = "APG" |
| Gold: SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = "APG" |
| Type: SIMPLE |
|
|
| [174] OTHER | DB: flight_2 | EX: β |
| Q : What are flight numbers of flights arriving at Airport "APG" |
| Pred: SELECT Flightno FROM flights WHERE Airport = "APG" |
| Gold: SELECT FlightNo FROM FLIGHTS WHERE DestAirport = "APG" |
| Type: SIMPLE |
|
|
| [175] OTHER | DB: flight_2 | EX: β |
| Q : Give the flight numbers of flights landing at APG |
| Pred: SELECT Flightno FROM flights WHERE Airport = "APG" |
| Gold: SELECT FlightNo FROM FLIGHTS WHERE DestAirport = "APG" |
| Type: SIMPLE |
|
|
| [176] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : What are flight numbers of flights departing from City "Aberdeen " |
| Pred: SELECT flightno FROM flights WHERE city = "Aberdeen" |
| Gold: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen" |
| Type: JOIN |
|
|
| [177] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : Give the flight numbers of flights leaving from Aberdeen |
| Pred: SELECT Flightno FROM flights WHERE sourceairport = "Aberdeen" AND airport = "Airport" |
| Gold: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen" |
| Type: JOIN |
|
|
| [178] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : What are flight numbers of flights arriving at City "Aberdeen" |
| Pred: SELECT Flightno FROM flights WHERE city = "Aberdeen" |
| Gold: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen" |
| Type: JOIN |
|
|
| [179] MISSING_JOIN | DB: flight_2 | EX: β |
| Q : Give the flight numbers of flights arriving in Aberdeen |
| Pred: SELECT Flightno FROM flights WHERE Airport = "Aberdeen" |
| Gold: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen" |
| Type: JOIN |
|
|
| [180] WRONG_COLUMNS | DB: flight_2 | EX: β |
| Q : Find the number of flights landing in the city of Aberdeen or Abilene |
| Pred: SELECT COUNT(*) FROM flights AS T1 JOIN airports AS T2 ON T1.sourceairport = T2.airportcode WHERE t2.city = "Aberdeen" UNION SELECT flightno FROM flights WHERE city = "Abilene" |
| Gold: SELECT COUNT(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = "Aberdeen" OR T2.city = "Abilene" |
| Type: JOIN, AGGREGATION |
|
|
| [181] WRONG_TABLE | DB: flight_2 | EX: β |
| Q : How many flights land in Aberdeen or Abilene |
| Pred: SELECT COUNT(*) FROM airports AS T1 JOIN flights AS T2 ON T1.airportcode = T2.sourceairport JOIN airports AS t3 ON T3.city = T4.city WHERE T1?Auckland = "Abilene" |
| Gold: SELECT COUNT(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = "Aberdeen" OR T2.city = "Abilene" |
| Type: JOIN, AGGREGATION |
|
|
| [182] WRONG_COLUMNS | DB: flight_2 | EX: β |
| Q : Find the name of airports which do not have any flight in and out |
| Pred: SELECT airportname FROM airports WHERE NOT airportcode IN (SELECT sourceairport FROM flights) |
| Gold: SELECT AirportName FROM Airports WHERE NOT AirportCode IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights) |
| Type: NESTED |
|
|
| [183] WRONG_COLUMNS | DB: flight_2 | EX: β |
| Q : Which airports do not have departing or arriving flights |
| Pred: SELECT airportname FROM airports WHERE NOT airportcode IN (SELECT sourceairport FROM flights WHERE flightno = 0) OR flightno <> 0) |
| Gold: SELECT AirportName FROM Airports WHERE NOT AirportCode IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights) |
| Type: NESTED |
|
|
| [184] OTHER | DB: employee_hire_evaluation | EX: β |
| Q : Sort employee names by their age in ascending order |
| Pred: SELECT name FROM employee ORDER BY age ASC |
| Gold: SELECT name FROM employee ORDER BY age |
| Type: ORDER_BY |
|
|
| [185] OTHER | DB: employee_hire_evaluation | EX: β |
| Q : List the names of employees and sort in ascending order of age |
| Pred: SELECT name FROM employee ORDER BY age ASC |
| Gold: SELECT name FROM employee ORDER BY age |
| Type: ORDER_BY |
|
|
| [186] WRONG_COLUMNS | DB: employee_hire_evaluation | EX: β |
| Q : What is the number of employees from each city |
| Pred: SELECT city, COUNT(*) FROM employee GROUP BY city |
| Gold: SELECT COUNT(*), city FROM employee GROUP BY city |
| Type: GROUP_BY, AGGREGATION |
|
|
| [187] MISSING_WHERE | DB: employee_hire_evaluation | EX: β |
| Q : Find the cities that have more than one employee under age 30 |
| Pred: SELECT city FROM employee GROUP BY city HAVING COUNT(*) > 1 |
| Gold: SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING COUNT(*) > 1 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [188] WRONG_COLUMNS | DB: employee_hire_evaluation | EX: β |
| Q : How many shops are there in each location |
| Pred: SELECT LOCATION, COUNT(*) FROM shop GROUP BY LOCATION |
| Gold: SELECT COUNT(*), LOCATION FROM shop GROUP BY LOCATION |
| Type: GROUP_BY, AGGREGATION |
|
|
| [189] MISSING_JOIN | DB: employee_hire_evaluation | EX: β |
| Q : find the name of employee who was awarded the most times in the evaluation |
| Pred: SELECT name FROM employee ORDER BY year_awarded DESC LIMIT 1 |
| Gold: SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [190] OTHER | DB: employee_hire_evaluation | EX: β |
| Q : Which employee received the most awards in evaluations? Give me the employee name |
| Pred: SELECT T1.name FROM employee AS T1 JOIN evaluation AS T2 ON TRUE GROUP BY T2.employee_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [191] MISSING_JOIN | DB: employee_hire_evaluation | EX: β |
| Q : Find the name of the employee who got the highest one time bonus |
| Pred: SELECT name FROM employee ORDER BY bonus DESC LIMIT 1 |
| Gold: SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID ORDER BY t2.bonus DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [192] MISSING_JOIN | DB: employee_hire_evaluation | EX: β |
| Q : Which employee received the biggest bonus? Give me the employee name |
| Pred: SELECT name FROM employee ORDER BY bonus DESC LIMIT 1 |
| Gold: SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID ORDER BY t2.bonus DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [193] EXTRA_JOIN | DB: employee_hire_evaluation | EX: β |
| Q : Find the names of employees who never won any award in the evaluation |
| Pred: SELECT name FROM employee EXCEPT SELECT T2.name FROM evaluation AS T1 JOIN employee AS T2 ON T1.employee_id = T2.' |
| Gold: SELECT name FROM employee WHERE NOT Employee_ID IN (SELECT Employee_ID FROM evaluation) |
| Type: NESTED |
|
|
| [194] WRONG_COLUMNS | DB: employee_hire_evaluation | EX: β |
| Q : What is the name of the shop that is hiring the largest number of employees |
| Pred: SELECT T2.name FROM hiring AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.'Employee_ID IN (SELECT employee_id FROM hiring) GROUP BY shop_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t1.shop_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [195] WRONG_COLUMNS | DB: employee_hire_evaluation | EX: β |
| Q : Which shop has the most employees? Give me the shop name |
| Pred: SELECT T2.name FROM hiring AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.'Employee_ID IN (SELECT employee_ID FROM hiring GROUP BY employee_id ORDER BY COUNT(*) DESC LIMIT 1) |
| Gold: SELECT t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t1.shop_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [196] MISSING_GROUP_BY | DB: employee_hire_evaluation | EX: β |
| Q : Find the number of employees hired in each shop; show the shop name as well |
| Pred: SELECT T2.name, COUNT(*) FROM hiring AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2? |
| Gold: SELECT COUNT(*), t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [197] MISSING_GROUP_BY | DB: employee_hire_evaluation | EX: β |
| Q : For each shop, return the number of employees working there and the name of the shop |
| Pred: SELECT COUNT(*), T3.name FROM hiring AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop |
| Gold: SELECT COUNT(*), t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [198] OTHER | DB: employee_hire_evaluation | EX: β |
| Q : Which district has both stores with less than 3000 products and stores with more than 10000 products |
| Pred: SELECT district FROM shop WHERE number_products < 3000 INTERSECT SELECT district FROM Shop WHERE number-products > 10000 |
| Gold: SELECT district FROM shop WHERE Number_products < 3000 INTERSECT SELECT district FROM shop WHERE Number_products > 10000 |
| Type: SIMPLE |
|
|
| [199] OTHER | DB: employee_hire_evaluation | EX: β |
| Q : Find the districts in which there are both shops selling less than 3000 products and shops selling more than 10000 products |
| Pred: SELECT district FROM shop WHERE number_products < 3000 INTERSECT SELECT district FROM Shop WHERE number-products > 10000 |
| Gold: SELECT district FROM shop WHERE Number_products < 3000 INTERSECT SELECT district FROM shop WHERE Number_products > 10000 |
| Type: SIMPLE |
|
|
| [200] WRONG_COLUMNS | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the ids, names, and descriptions for all documents |
| Pred: SELECT document_id, document_name, document-description FROM documents |
| Gold: SELECT document_id, document_name, document_description FROM Documents |
| Type: SIMPLE |
|
|
| [201] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the document id, template id and description for document named "Robbin CV" |
| Pred: SELECT T1.document_id, T2.template_id , T3.Document_description FROM documents AS T1 JOIN templates AS T2 ON T1/ templates = t2. templates_id JOIN documents AS t3 ON T2?document_name = "Robbin CV" |
| Gold: SELECT document_id, template_id, Document_Description FROM Documents WHERE document_name = "Robbin CV" |
| Type: SIMPLE |
|
|
| [202] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the document id, template id, and description for the document with the name Robbin CV |
| Pred: SELECT T1.document_id, T2.template_id , T3. document_description FROM documents AS T1 JOIN templates AS T2 ON T1/ templates_id = T2.'robbin CV' |
| Gold: SELECT document_id, template_id, Document_Description FROM Documents WHERE document_name = "Robbin CV" |
| Type: SIMPLE |
|
|
| [203] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : How many documents are using the template with type code 'PPT' |
| Pred: SELECT COUNT(*) FROM templates WHERE template_type_code = "PPT" |
| Gold: SELECT COUNT(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT' |
| Type: JOIN, AGGREGATION |
|
|
| [204] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Count the number of documents that use the PPT template type |
| Pred: SELECT COUNT(*) FROM templates WHERE template_type_code = "PPT" |
| Gold: SELECT COUNT(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT' |
| Type: JOIN, AGGREGATION |
|
|
| [205] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the id and type code for the template used by the most documents |
| Pred: SELECT T1.template_id, T2. template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON TRUE JOIN documents AS T3 ON T1."template_ID = T3.temporary_id GROUP BY T1.(*) ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.template_id, T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [206] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the id and type code of the template that is used for the greatest number of documents |
| Pred: SELECT T1.template_id, T2. template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON TRUE JOIN documents AS T3 ON T1" = T3.document_id GROUP BY template_id ORDER BY COUNT(*) LIMIT 1 |
| Gold: SELECT T1.template_id, T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [207] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show ids for all templates that are used by more than one document |
| Pred: SELECT T1.template_id FROM templates AS T1 JOIN documents AS T2 ON T2.formats_type_code = T3.page_id GROUP BY template_id HAVING COUNT(*) > 1 |
| Gold: SELECT template_id FROM Documents GROUP BY template_id HAVING COUNT(*) > 1 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [208] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the template ids of any templates used in more than a single document |
| Pred: SELECT T1.template_id FROM templates AS T1 JOIN documents AS T2 ON T2.formats_id = T3. template_id GROUP BY T1.(*) HAVING COUNT(*) > 1 |
| Gold: SELECT template_id FROM Documents GROUP BY template_id HAVING COUNT(*) > 1 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [209] WRONG_COLUMNS | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show ids for all templates not used by any document |
| Pred: SELECT template_id FROM templates EXCEPT SELECT template_ids FROM documents |
| Gold: SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents |
| Type: SIMPLE |
|
|
| [210] WRONG_COLUMNS | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the ids for templates that are not used in any documents |
| Pred: SELECT template_id FROM templates EXCEPT SELECT template_ids FROM documents |
| Gold: SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents |
| Type: SIMPLE |
|
|
| [211] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the ids of templates with template type code PP or PPT |
| Pred: SELECT T1.template_id FROM templates AS T1 JOIN ref_template_types AS T2 ON t1. template_type_code = t2.bradford_id WHERE T2.formats_Type_Code = "PP" OR T2." |
| Gold: SELECT template_id FROM Templates WHERE template_type_code = "PP" OR template_type_code = "PPT" |
| Type: SIMPLE |
|
|
| [212] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the ids of templates that have the code PP or PPT |
| Pred: SELECT T1.template_id FROM templates AS T1 JOIN ref_template_types AS T2 ON t1. template_type_code = t2.template-type_ code WHERE t2."PP" = "PPT" |
| Gold: SELECT template_id FROM Templates WHERE template_type_code = "PP" OR template_type_code = "PPT" |
| Type: SIMPLE |
|
|
| [213] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the version number and template type code for the template with version number later than 5 |
| Pred: SELECT T1.version_number, T2.template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON T1."template_Type_code = t2. template_type-code WHERE T1 (version_Number > 5) |
| Gold: SELECT version_number, template_type_code FROM Templates WHERE version_number > 5 |
| Type: SIMPLE |
|
|
| [214] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the version numbers and template type codes of templates with a version number greater than 5 |
| Pred: SELECT DISTINCT T1.version_number, T2.template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON TRUE GROUP BY T1."version_ number" HAVING COUNT(*) > 5 |
| Gold: SELECT version_number, template_type_code FROM Templates WHERE version_number > 5 |
| Type: SIMPLE |
|
|
| [215] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the type code of the template type that the most templates belong to |
| Pred: SELECT T2.template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON T1.Template_Type_code = T2.' GROUP BY T1.(*) ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [216] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the codes of template types that have fewer than 3 templates |
| Pred: SELECT T1.template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON T1 (SELECT T2. template_type-code FROM ref_ templates_types as T3 JOIN pages AS T4 ON T3.template-type_id = T4 |
| Gold: SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING COUNT(*) < 3 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [217] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the template type code of the template used by document with the name "Data base" |
| Pred: SELECT T2.template_type_code FROM documents AS T1 JOIN templates AS T2 ON T1. template_id = T 2. templates_id WHERE document_name = "Data base" |
| Gold: SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = "Data base" |
| Type: JOIN |
|
|
| [218] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the template type code of the template that is used by a document named Data base |
| Pred: SELECT T2.template_type_code FROM documents AS T1 JOIN templates AS T2 ON T1.templates_id = T3.temporary_id WHERE document_name = "Data base" |
| Gold: SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = "Data base" |
| Type: JOIN |
|
|
| [219] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show all document names using templates with template type code BK |
| Pred: SELECT document_name FROM documents WHERE template_type_code = "BK" |
| Gold: SELECT T2.document_name FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T1.template_type_code = "BK" |
| Type: JOIN |
|
|
| [220] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the names of documents that use templates with the code BK |
| Pred: SELECT document_name FROM documents WHERE template_type_code = "BK" |
| Gold: SELECT T2.document_name FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T1.template_type_code = "BK" |
| Type: JOIN |
|
|
| [221] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show all template type codes and the number of documents using each type |
| Pred: SELECT template_type_code, COUNT(*) FROM documents GROUP BY template_Type_code |
| Gold: SELECT T1.template_type_code, COUNT(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [222] MISSING_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the different template type codes, and how many documents use each type |
| Pred: SELECT COUNT(*), template_type_code FROM templates GROUP BY template_Type_code |
| Gold: SELECT T1.template_type_code, COUNT(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [223] OTHER | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Which template type code is used by most number of documents |
| Pred: SELECT T1.template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON TRUE GROUP BY T2. template_Type_code ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [224] OTHER | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the code of the template type that is most commonly used in documents |
| Pred: SELECT t1.template_type_code FROM templates AS t1 JOIN documents AS t2 ON t1 site_id = t2.document_id GROUP BY t1!template_Type_code ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [225] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show all template type codes that are not used by any document |
| Pred: SELECT template_type_code FROM templates WHERE NOT template_id IN (SELECT Template_Type_Code FROM documents) |
| Gold: SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id |
| Type: JOIN |
|
|
| [226] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the codes of template types that are not used for any document |
| Pred: SELECT template_type_code FROM templates WHERE NOT template_id IN (SELECT Template_id FROM documents) |
| Gold: SELECT template_type_code FROM Templates EXCEPT SELECT template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id |
| Type: JOIN |
|
|
| [227] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show all template type codes and descriptions |
| Pred: SELECT T1.template_type_code, T2.Template_Type_Description FROM Ref_template_types AS T1 JOIN templates AS T2 ON T1 (SELECT T3. template_type-code FROM templates) |
| Gold: SELECT template_type_code, template_type_description FROM Ref_template_types |
| Type: SIMPLE |
|
|
| [228] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the type codes and descriptions for all template types |
| Pred: SELECT T1.template_type_code, T2. template_type-description FROM Ref_template_types AS T1 JOIN templates AS T2 ON T1."template_Type_code" |
| Gold: SELECT template_type_code, template_type_description FROM Ref_template_types |
| Type: SIMPLE |
|
|
| [229] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the template type descriptions for template type code "AD" |
| Pred: SELECT T1.template_type_description FROM templates AS T1 JOIN ref_template_types AS T2 ON T1."template_Type_code = T2. template_ type_code WHERE "AD%" |
| Gold: SELECT template_type_description FROM Ref_template_types WHERE template_type_code = "AD" |
| Type: SIMPLE |
|
|
| [230] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the template type description of the template type with the code AD |
| Pred: SELECT T1.template_type_description FROM Ref_template_types AS T1 JOIN templates AS T2 ON T1."template_Type_code = T2. template_type-code WHERE T2."ad%" |
| Gold: SELECT template_type_description FROM Ref_template_types WHERE template_type_code = "AD" |
| Type: SIMPLE |
|
|
| [231] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the template type code for template type description "Book" |
| Pred: SELECT T1.template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON T1 (SELECT T2. template_type-code FROM ref_ templates_Types AS T3 JOIN pages AS T4 ON T3.template page_id = T4.page_id WHERE T4: template_Type_description = "Book" |
| Gold: SELECT template_type_code FROM Ref_template_types WHERE template_type_description = "Book" |
| Type: SIMPLE |
|
|
| [232] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the type code of the template type with the description "Book" |
| Pred: SELECT T1.template_type_code FROM templates AS T1 JOIN ref_template_types AS T2 ON T1 (SELECT T2. template_Type_Code FROM ref_ templates_types as T3 ON T3.template-type_Code = T2.'s template_ type_code WHERE T3.'s Template_type-description = 'Book' |
| Gold: SELECT template_type_code FROM Ref_template_types WHERE template_type_description = "Book" |
| Type: SIMPLE |
|
|
| [233] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the distinct template type descriptions for the templates ever used by any document |
| Pred: SELECT DISTINCT template_type_description FROM templates |
| Gold: SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID = T3.template_ID |
| Type: JOIN |
|
|
| [234] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the different descriptions for templates that have been used in a document |
| Pred: SELECT DISTINCT template_type_description FROM templates AS T1 JOIN documents AS T2 ON T1.template_id = T2. template_id |
| Gold: SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID = T3.template_ID |
| Type: JOIN |
|
|
| [235] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the template ids with template type description "Presentation" |
| Pred: SELECT template_id FROM templates WHERE template_type_description = "Presentation" |
| Gold: SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = "Presentation" |
| Type: JOIN |
|
|
| [236] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the ids corresponding to templates with the description 'Presentation' |
| Pred: SELECT template_id FROM templates WHERE template_type_description = 'Presentation' |
| Gold: SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = "Presentation" |
| Type: JOIN |
|
|
| [237] WRONG_COLUMNS | DB: cre_Doc_Template_Mgt | EX: β |
| Q : How many paragraphs for the document with name 'Summer Show' |
| Pred: SELECT COUNT(DISTINCT paragraph_text) FROM paragraphs AS T1 JOIN documents AS T2 ON T1.document_id = T2.document-id WHERE T2:document_name = "Summer Show" |
| Gold: SELECT COUNT(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show' |
| Type: JOIN, AGGREGATION |
|
|
| [238] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Count the number of paragraphs in the document named 'Summer Show' |
| Pred: SELECT COUNT(DISTINCT paragraph_id) FROM documents AS T1 JOIN paragraphs AS T2 ON T1.document_id = T2.document-id WHERE document_name = "Summer Show" |
| Gold: SELECT COUNT(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show' |
| Type: JOIN, AGGREGATION |
|
|
| [239] OTHER | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show paragraph details for paragraph with text 'Korea ' |
| Pred: SELECT other_details FROM paragraphs WHERE paragraph_text LIKE '%Korea%' |
| Gold: SELECT other_details FROM paragraphs WHERE paragraph_text LIKE 'korea' |
| Type: SIMPLE |
|
|
| [240] OTHER | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the details for the paragraph that includes the text 'Korea ' |
| Pred: SELECT other_details FROM paragraphs WHERE paragraph_text LIKE '%Korea%' |
| Gold: SELECT other_details FROM paragraphs WHERE paragraph_text LIKE 'korea' |
| Type: SIMPLE |
|
|
| [241] WRONG_COLUMNS | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show all paragraph ids and texts for the document with name 'Welcome to NY' |
| Pred: SELECT DISTINCT T1. paragraph_id, T2.paragraph_text FROM paragraphs AS T1 JOIN documents AS T2 ON t1.document_id = t2. document_id WHERE t2?document_name = 'Welcome to NY' |
| Gold: SELECT T1.paragraph_id, T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY' |
| Type: JOIN |
|
|
| [242] MISSING_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the ids and texts of paragraphs in the document titled 'Welcome to NY' |
| Pred: SELECT document_id, paragraph_text FROM paragraphs WHERE document_name = 'Welcome to NY' |
| Gold: SELECT T1.paragraph_id, T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY' |
| Type: JOIN |
|
|
| [243] WRONG_COLUMNS | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show all paragraph texts for the document "Customer reviews" |
| Pred: SELECT DISTINCT paragraph_text FROM paragraphs AS T1 JOIN documents AS T2 ON T1.document_id = T2.document-id WHERE document_name = "Customer reviews" |
| Gold: SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Customer reviews" |
| Type: JOIN |
|
|
| [244] WRONG_COLUMNS | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the paragraph texts for the document with the name 'Customer reviews' |
| Pred: SELECT DISTINCT paragraph_text FROM paragraphs AS T1 JOIN documents AS T2 ON T1.document_id = T2.document-id WHERE document_name = 'Customer reviews' |
| Gold: SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Customer reviews" |
| Type: JOIN |
|
|
| [245] OTHER | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show all document ids and the number of paragraphs in each document. Order by document id |
| Pred: SELECT document_id, COUNT(*) FROM paragraphs GROUP BY document_ID ORDER BY COUNT(*), paragraph_id |
| Gold: SELECT document_id, COUNT(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id |
| Type: GROUP_BY, ORDER_BY, AGGREGATION |
|
|
| [246] WRONG_COLUMNS | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the different document ids along with the number of paragraphs corresponding to each, ordered by id |
| Pred: SELECT document_id, COUNT(*), paragraph_id FROM paragraphs GROUP BY page_id ORDER BY COUNT( |
| Gold: SELECT document_id, COUNT(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id |
| Type: GROUP_BY, ORDER_BY, AGGREGATION |
|
|
| [247] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show all document ids, names and the number of paragraphs in each document |
| Pred: SELECT document_id, document_name, COUNT(DISTINCT paragraph_id) FROM documents |
| Gold: SELECT T1.document_id, T2.document_name, COUNT(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [248] MISSING_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the ids and names of each document, as well as the number of paragraphs in each |
| Pred: SELECT document_id, document_name, COUNT(DISTINCT paragraph_id) FROM paragraphs |
| Gold: SELECT T1.document_id, T2.document_name, COUNT(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [249] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the ids of documents that have 2 or more paragraphs |
| Pred: SELECT T1.document_id FROM documents AS T1 JOIN paragraphs AS T2 ON T1 page_id = T2 |
| Gold: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING COUNT(*) >= 2 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [250] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the document id and name with greatest number of paragraphs |
| Pred: SELECT T1.document_id, T2. document_name FROM documents AS T1 JOIN paragraphs AS T2 ON T1 page_id = T2.' GROUP BY T1-document_ id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.document_id, T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [251] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the id and name of the document with the most paragraphs |
| Pred: SELECT T1.document_id, T2. document_name FROM documents AS T1 JOIN paragraphs AS T2 ON T1 page_id = T2.' GROUP BY document_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.document_id, T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [252] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the document id with least number of paragraphs |
| Pred: SELECT T2.document_id FROM paragraphs AS T1 JOIN documents AS T2 ON T1.page_id = T2.' GROUP BY document_id ORDER BY COUNT(*) ASC LIMIT 1 |
| Gold: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY COUNT(*) ASC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [253] EXTRA_JOIN | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Return the id of the document with the fewest paragraphs |
| Pred: SELECT T2.document_id FROM paragraphs AS T1 JOIN documents AS T2 ON T1.Document_id = T2.' GROUP BY T1 document_id ORDER BY COUNT(*) LIMIT 1 |
| Gold: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY COUNT(*) ASC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [254] MISSING_GROUP_BY | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What is the document id with 1 to 2 paragraphs |
| Pred: SELECT document_id FROM paragraphs WHERE paragraph_id BETWEEN 1 AND 2 |
| Gold: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING COUNT(*) BETWEEN 1 AND 2 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [255] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Give the ids of documents that have between one and two paragraphs |
| Pred: SELECT document_id FROM documents WHERE paragraph_id BETWEEN 1 AND 2 |
| Gold: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING COUNT(*) BETWEEN 1 AND 2 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [256] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : Show the document id with paragraph text 'Brazil' and 'Ireland' |
| Pred: SELECT document_id FROM paragraphs WHERE paragraph_text LIKE 'Brazil%' INTERSECT SELECT document_ID FROM documents WHERE paragraphs = 'Ireland%' |
| Gold: SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Ireland' |
| Type: SIMPLE |
|
|
| [257] WRONG_TABLE | DB: cre_Doc_Template_Mgt | EX: β |
| Q : What are the ids of documents that contain the paragraph text 'Brazil' and 'Ireland' |
| Pred: SELECT document_id FROM paragraphs WHERE paragraph_text LIKE 'Brazil%' INTERSECT SELECT document_ids FROM documents WHERE paragraphs LIKE 'Ireland%' |
| Gold: SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text = 'Ireland' |
| Type: SIMPLE |
|
|
| [258] OTHER | DB: course_teach | EX: β |
| Q : List the name of teachers whose hometown is not `` Little Lever Urban District '' |
| Pred: SELECT Name FROM teacher WHERE Hometown <> '' Little Lever Urban District '' |
| Gold: SELECT name FROM teacher WHERE hometown <> "little lever urban district" |
| Type: SIMPLE |
|
|
| [259] OTHER | DB: course_teach | EX: β |
| Q : What are the names of the teachers whose hometown is not `` Little Lever Urban District '' |
| Pred: SELECT Name FROM teacher WHERE Hometown <> '' Little Lever Urban District '' |
| Gold: SELECT name FROM teacher WHERE hometown <> "little lever urban district" |
| Type: SIMPLE |
|
|
| [260] OTHER | DB: course_teach | EX: β |
| Q : Show the name of teachers aged either 32 or 33 |
| Pred: SELECT name FROM teacher WHERE age = '32' OR age = 33 |
| Gold: SELECT Name FROM teacher WHERE Age = 32 OR Age = 33 |
| Type: SIMPLE |
|
|
| [261] OTHER | DB: course_teach | EX: β |
| Q : What are the names of the teachers who are aged either 32 or 33 |
| Pred: SELECT name FROM teacher WHERE age = '32' OR age = 33 |
| Gold: SELECT Name FROM teacher WHERE Age = 32 OR Age = 33 |
| Type: SIMPLE |
|
|
| [262] MISSING_ORDER_BY | DB: course_teach | EX: β |
| Q : What is the hometown of the youngest teacher |
| Pred: SELECT Hometown FROM teacher WHERE age = (SELECT MIN(age) FROM teacher) |
| Gold: SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [263] OTHER | DB: course_teach | EX: β |
| Q : Where is the youngest teacher from |
| Pred: SELECT hometown FROM teacher ORDER BY age LIMIT 1 |
| Gold: SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [264] WRONG_TABLE | DB: course_teach | EX: β |
| Q : What is the most commmon hometowns for teachers |
| Pred: SELECT T2.Hometown FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T 2.TEACHER_ID GROUP BY T2.-Hometown ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT Hometown FROM teacher GROUP BY Hometown ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [265] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : Show names of teachers and the courses they are arranged to teach |
| Pred: SELECT T2.Name, T3.Course_Arange FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T 2.TEACH_ID |
| Gold: SELECT T3.Name, T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID |
| Type: JOIN |
|
|
| [266] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : What is the name of each teacher and what course they teach |
| Pred: SELECT T2.Name, T3.Course FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T 2.TEACH_ID |
| Gold: SELECT T3.Name, T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID |
| Type: JOIN |
|
|
| [267] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : Show names of teachers and the courses they are arranged to teach in ascending alphabetical order of the teacher's name |
| Pred: SELECT T2.Name, T3.Course_ID FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.' ORDER BY T2:Name ASC |
| Gold: SELECT T3.Name, T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID ORDER BY T3.Name |
| Type: JOIN, ORDER_BY |
|
|
| [268] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : What are the names of the teachers and the courses they teach in ascending alphabetical order by the name of the teacher |
| Pred: SELECT T2.Name, T3.Course_ID FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T 2.TEACH_ID JOIN course AS T3 ON T2?course_id = T3?Course_id ORDER BY T4.Name ASC |
| Gold: SELECT T3.Name, T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID ORDER BY T3.Name |
| Type: JOIN, ORDER_BY |
|
|
| [269] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : Show the name of the teacher for the math course |
| Pred: SELECT T2.name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.teacher_id = T2.'Course_ID = T3.course_ID JOIN student AS T4 ON T4.Teacher_Id = T5.TEACHER_ID WHERE T1:course = 'Math' |
| Gold: SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID WHERE T2.Course = "Math" |
| Type: JOIN |
|
|
| [270] MISSING_WHERE | DB: course_teach | EX: β |
| Q : What are the names of the people who teach math courses |
| Pred: SELECT T2.name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.teacher_id = T2.'Course_ID = T3.course_ID JOIN student AS T4 ON T4.teach_id <> T1 |
| Gold: SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID WHERE T2.Course = "Math" |
| Type: JOIN |
|
|
| [271] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : Show names of teachers and the number of courses they teach |
| Pred: SELECT T3.Name, COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.TEACH_ID GROUP BY T3:Name |
| Gold: SELECT T2.Name, COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [272] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : What are the names of the teachers and how many courses do they teach |
| Pred: SELECT T2.Name, COUNT(DISTINCT T1.Course_ID) FROM course_arrange AS T1 JOIN teacher AS T2 ON t1.Teacher_ID = t2.teacher_id GROUP BY T2 .Name |
| Gold: SELECT T2.Name, COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [273] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : Show names of teachers that teach at least two courses |
| Pred: SELECT T3.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.TEACHER_ID GROUP BY T4.Name HAVING COUNT(*) >= 2 |
| Gold: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [274] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : What are the names of the teachers who teach at least two courses |
| Pred: SELECT T3.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.TEACH_ID GROUP BY T3 .Name HAVING COUNT(*) >= 2 |
| Gold: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [275] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : List the names of teachers who have not been arranged to teach courses |
| Pred: SELECT Name FROM teacher WHERE NOT Teacher_ID IN (SELECT Teachers_ID FROM course_arrange) |
| Gold: SELECT Name FROM teacher WHERE NOT Teacher_id IN (SELECT Teacher_id FROM course_arrange) |
| Type: NESTED |
|
|
| [276] WRONG_COLUMNS | DB: course_teach | EX: β |
| Q : What are the names of the teachers whose courses have not been arranged |
| Pred: SELECT Name FROM teacher WHERE NOT Teacher_ID IN (SELECT Teachers_ID FROM course_arrange) |
| Gold: SELECT Name FROM teacher WHERE NOT Teacher_id IN (SELECT Teacher_id FROM course_arrange) |
| Type: NESTED |
|
|
| [277] OTHER | DB: museum_visit | EX: β |
| Q : Find the names of the visitors whose membership level is higher than 4, and order the results by the level from high to low |
| Pred: SELECT name FROM visitor WHERE level_of_membership > 4 ORDER BY name |
| Gold: SELECT name FROM visitor WHERE Level_of_membership > 4 ORDER BY Level_of_membership DESC |
| Type: ORDER_BY |
|
|
| [278] OTHER | DB: museum_visit | EX: β |
| Q : What is the average age of the visitors whose membership level is not higher than 4 |
| Pred: SELECT AVG(age) FROM visitor WHERE level_of_membership < 4 |
| Gold: SELECT AVG(age) FROM visitor WHERE Level_of_membership <= 4 |
| Type: AGGREGATION |
|
|
| [279] WRONG_COLUMNS | DB: museum_visit | EX: β |
| Q : Find the name and membership level of the visitors whose membership level is higher than 4, and sort by their age from old to young |
| Pred: SELECT name FROM visitor WHERE level_of_membership > 4 ORDER BY age |
| Gold: SELECT name, Level_of_membership FROM visitor WHERE Level_of_membership > 4 ORDER BY age DESC |
| Type: ORDER_BY |
|
|
| [280] EXTRA_JOIN | DB: museum_visit | EX: β |
| Q : Find the id and name of the museum that has the most staff members |
| Pred: SELECT T1.museum_id, T2.name FROM museum AS T1 JOIN visit AS T2 ON T1.'s museum_id = T2.'s Museum_ID ORDER BY Num_of_Staff DESC LIMIT 1 |
| Gold: SELECT museum_id, name FROM museum ORDER BY num_of_staff DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [281] WRONG_COLUMNS | DB: museum_visit | EX: β |
| Q : What are the opening year and staff number of the museum named Plaza Museum |
| Pred: SELECT open_year, num_of_staff FROM museum WHERE name = "Plaza Museum" |
| Gold: SELECT Num_of_Staff, Open_Year FROM museum WHERE name = 'Plaza Museum' |
| Type: SIMPLE |
|
|
| [282] WRONG_COLUMNS | DB: museum_visit | EX: β |
| Q : find the names of museums which have more staff than the minimum staff number of all museums opened after 2010 |
| Pred: SELECT name FROM museum WHERE num_of_staff > (SELECT MIN(num_of-staff) FROM museum) AND open_year > 2010 |
| Gold: SELECT name FROM museum WHERE num_of_staff > (SELECT MIN(num_of_staff) FROM museum WHERE open_year > 2010) |
| Type: NESTED, AGGREGATION |
|
|
| [283] WRONG_COLUMNS | DB: museum_visit | EX: β |
| Q : find the id, name and age for visitors who visited some museums more than once |
| Pred: SELECT T3.id, T1.name, T2.age FROM visitor AS T1 JOIN visit AS T2 ON T1?id = T2?visitor_id GROUP BY T4.id HAVING COUNT(*) > 1 |
| Gold: SELECT t1.id, t1.name, t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id GROUP BY t1.id HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [284] WRONG_COLUMNS | DB: museum_visit | EX: β |
| Q : What are the id, name and membership level of visitors who have spent the largest amount of money in total in all museum tickets |
| Pred: SELECT T2.id, T1.name, T2_of_membership FROM visitor AS T1 JOIN visit AS T2 ON T1.'s visitor_id = T3.id GROUP BY T1?id ORDER BY SUM(T3.total_spent) DESC LIMIT 1 |
| Gold: SELECT t2.visitor_id, t1.name, t1.Level_of_membership FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id GROUP BY t2.visitor_id ORDER BY SUM(t2.Total_spent) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [285] WRONG_TABLE | DB: museum_visit | EX: β |
| Q : What are the id and name of the museum visited most times |
| Pred: SELECT T2.museum_id, T3.name FROM visit AS T1 JOIN museum AS T2 ON T1.Museum_ID = T2.' GROUP BY museum_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT t2.Museum_ID, t1.name FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID = t2.Museum_ID GROUP BY t2.Museum_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [286] WRONG_TABLE | DB: museum_visit | EX: β |
| Q : What is the name of the museum that had no visitor yet |
| Pred: SELECT name FROM museum WHERE NOT museum_id IN (SELECT museum_ID FROM visitor) |
| Gold: SELECT name FROM museum WHERE NOT Museum_ID IN (SELECT museum_id FROM visit) |
| Type: NESTED |
|
|
| [287] WRONG_COLUMNS | DB: museum_visit | EX: β |
| Q : Find the name and age of the visitor who bought the most tickets at once |
| Pred: SELECT T2.name, T2:age FROM visitor AS T1 JOIN visit AS T2 ON T1.id = T2.' GROUP BY T1.'s visitor_id ORDER BY SUM(T1.total_Spent) DESC LIMIT 1 |
| Gold: SELECT t1.name, t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id ORDER BY t2.num_of_ticket DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [288] WRONG_COLUMNS | DB: museum_visit | EX: β |
| Q : What are the average and maximum number of tickets bought in all visits |
| Pred: SELECT AVG(num_of_ticket), MAX(total_spent) FROM visit |
| Gold: SELECT AVG(num_of_ticket), MAX(num_of_ticket) FROM visit |
| Type: AGGREGATION |
|
|
| [289] MISSING_JOIN | DB: museum_visit | EX: β |
| Q : What is the total ticket expense of the visitors whose membership level is 1 |
| Pred: SELECT SUM(total_ticket) FROM visitor WHERE level_of_membership = 1 |
| Gold: SELECT SUM(t2.Total_spent) FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id WHERE t1.Level_of_membership = 1 |
| Type: JOIN, AGGREGATION |
|
|
| [290] WRONG_TABLE | DB: museum_visit | EX: β |
| Q : What is the name of the visitor who visited both a museum opened before 2009 and a museum opened after 2011 |
| Pred: SELECT T3.name FROM museum AS T1 JOIN visitor AS T2 ON T1.Museum_ID = T2.museum_id JOIN visit AS T3 ON T3: visitor_id = T4.visitor_id WHERE Open_Year < 2009 INTERSECT SELECT T3!name FROM visitor AS t1 JOin museum AS t2 ON TRUE JOIN VISITORS AS T 3 ON T4? |
| Gold: SELECT t1.name FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id JOIN museum AS t3 ON t3.Museum_ID = t2.Museum_ID WHERE t3.open_year < 2009 INTERSECT SELECT t1.name FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id JOIN museum AS t3 ON t3.Museum_ID = t2.Museum_ID WHERE t3.open_year > 2011 |
| Type: JOIN |
|
|
| [291] MISSING_JOIN | DB: museum_visit | EX: β |
| Q : Find the number of visitors who did not visit any museum opened after 2010 |
| Pred: SELECT COUNT(*) FROM visitor WHERE NOT id IN (SELECT visitor_id FROM museum WHERE open_year > 2010) |
| Gold: SELECT COUNT(*) FROM visitor WHERE NOT id IN (SELECT t2.visitor_id FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID = t2.Museum_ID WHERE t1.open_year > 2010) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [292] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : Find the average rank of winners in all matches |
| Pred: SELECT AVG(winner_rank_points) FROM matches |
| Gold: SELECT AVG(winner_rank) FROM matches |
| Type: AGGREGATION |
|
|
| [293] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : What is the average rank for winners in all matches |
| Pred: SELECT AVG(winner_rank_points) FROM matches |
| Gold: SELECT AVG(winner_rank) FROM matches |
| Type: AGGREGATION |
|
|
| [294] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : Find the highest rank of losers in all matches |
| Pred: SELECT MAX(Loser_rank) FROM matches |
| Gold: SELECT MIN(loser_rank) FROM matches |
| Type: AGGREGATION |
|
|
| [295] EXTRA_JOIN | DB: wta_1 | EX: β |
| Q : What is the best rank of losers across all matches |
| Pred: SELECT MAX(T2.best_of) FROM matches AS T1 JOIN rankings AS T2 ON T1.loser_id = T2.winner_id |
| Gold: SELECT MIN(loser_rank) FROM matches |
| Type: AGGREGATION |
|
|
| [296] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : Find the number of distinct name of losers |
| Pred: SELECT COUNT(DISTINCT loser_name) FROM losers |
| Gold: SELECT COUNT(DISTINCT loser_name) FROM matches |
| Type: AGGREGATION |
|
|
| [297] EXTRA_JOIN | DB: wta_1 | EX: β |
| Q : Find the name of tourney that has more than 10 matches |
| Pred: SELECT T2.tourney_name FROM matches AS T1 JOIN tourney_id AS T2 ON T1.Tourney_ID = T 2.T2.TOURNEY_ID GROUP BY T3.TourNEY HAVING COUNT(*) > 10 |
| Gold: SELECT tourney_name FROM matches GROUP BY tourney_name HAVING COUNT(*) > 10 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [298] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : What are the names of tournaments that have more than 10 matches |
| Pred: SELECT T1.tourney_name FROM Tourneys AS T1 JOIN MATCH AS T2 ON T2.T1.Tourney_ID = T3.MATCH_ID GROUP BY T1."Tourney" HAVING COUNT(*) > 10 |
| Gold: SELECT tourney_name FROM matches GROUP BY tourney_name HAVING COUNT(*) > 10 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [299] EXTRA_JOIN | DB: wta_1 | EX: β |
| Q : List the names of all winners who played in both 2013 and 2016 |
| Pred: SELECT T2.winner_name FROM matches AS T1 JOIN players AS T2 ON TRUE WHERE T1.year = 2013 INTERSECT SELECT TRUE FROM matches WHERE YEAR = 2016 |
| Gold: SELECT winner_name FROM matches WHERE YEAR = 2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR = 2016 |
| Type: SIMPLE |
|
|
| [300] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : What are the names of players who won in both 2013 and 2016 |
| Pred: SELECT T2.winner_name FROM results AS T1 JOIN players AS T2 ON T1.player_id = T2.' WHERE T1-year = 2013 INTERSECT SELECT T2 .winner_id FROM results as T1 WHERE T 1.year = 2016 |
| Gold: SELECT winner_name FROM matches WHERE YEAR = 2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR = 2016 |
| Type: SIMPLE |
|
|
| [301] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : List the number of all matches who played in years of 2013 or 2016 |
| Pred: SELECT COUNT(*) FROM players WHERE YEAR = 2013 OR YEAR = 2016 |
| Gold: SELECT COUNT(*) FROM matches WHERE YEAR = 2013 OR YEAR = 2016 |
| Type: AGGREGATION |
|
|
| [302] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : What are the country code and first name of the players who won in both tourney WTA Championships and Australian Open |
| Pred: SELECT T1.country_code, T2.first_name FROM players AS T1 JOIN TOURNEY_ATTRACTIONS AS T2 ON TRUE JOIN Players AS T3 ON T1."winner_id = T3.player_id WHERE T2."Tourney_Name = "WTA Championships" INTERSECT SELECT T1:country_Code, T 2.first-name FROM player AS T 1 JOIN Tourneys AS T 2 ON TRUE WHERE T3."TourNEY_name = "Australian Open" |
| Gold: SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'WTA Championships' INTERSECT SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'Australian Open' |
| Type: JOIN |
|
|
| [303] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : What are the first names and country codes for players who won both the WTA Championships and the Australian Open |
| Pred: SELECT first_name, country_code FROM players WHERE T1.winner_name = "WTA Championships" INTERSECT SELECT T2.player_name FROM players AS T1 JOIN MATCH AS T2 ON T 1.Player_ID = T 2.Winning_ID WHERE T2:Tourney_Name = "Australian Open" |
| Gold: SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'WTA Championships' INTERSECT SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'Australian Open' |
| Type: JOIN |
|
|
| [304] MISSING_ORDER_BY | DB: wta_1 | EX: β |
| Q : Find the first name and country code of the oldest player |
| Pred: SELECT first_name, country_code FROM players WHERE birth_date = (SELECT MAX(birth_date) FROM players) |
| Gold: SELECT first_name, country_code FROM players ORDER BY birth_date LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [305] OTHER | DB: wta_1 | EX: β |
| Q : What is the first name and country code of the oldest player |
| Pred: SELECT first_name, country_code FROM players ORDER BY birth_date DESC LIMIT 1 |
| Gold: SELECT first_name, country_code FROM players ORDER BY birth_date LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [306] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : What are the full names of all left handed players, in order of birth date |
| Pred: SELECT full_name, last_name FROM players WHERE hand = "left" ORDER BY birth_date |
| Gold: SELECT first_name, last_name FROM players WHERE hand = 'L' ORDER BY birth_date |
| Type: ORDER_BY |
|
|
| [307] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : Find the first name and country code of the player who did the most number of tours |
| Pred: SELECT T1.first_name, T2.country_code FROM players AS T1 JOIN ROLES AS T2 ON TRUE JOIN Tour AS T3 ON T1" = T3.Tourist_ID GROUP BY T1-player_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id ORDER BY T2.tours DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [308] MISSING_JOIN | DB: wta_1 | EX: β |
| Q : What is the first name and country code of the player with the most tours |
| Pred: SELECT first_name, country_code FROM players ORDER BY tours DESC LIMIT 1 |
| Gold: SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id ORDER BY T2.tours DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [309] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : Find the name and rank points of the winner who won the most times |
| Pred: SELECT T1.winner_name, T2.winning_rank_points FROM results AS T1 JOIN players AS T2 ON T1_player_id = T2.' GROUP BY T1.'s winner_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT winner_name, winner_rank_points FROM matches GROUP BY winner_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [310] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : What is the name of the winner who has won the most matches, and how many rank points does this player have |
| Pred: SELECT T2.winner_name, COUNT(*) FROM MATCH AS T1 JOIN players AS T2 ON T1.player_id = T2.' GROUP BY T2.-winner_rank_points ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT winner_name, winner_rank_points FROM matches GROUP BY winner_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [311] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : Find the name of the winner who has the highest rank points and participated in the Australian Open tourney |
| Pred: SELECT T2.winner_name FROM rankings AS T1 JOIN players AS T2 ON T1.player_id = T2.' AS T3 JOIN tours AS T4 ON T3.Tourney_ID = T4.Australian Open' ORDER BY T1:Winner_rank_points DESC LIMIT 1 |
| Gold: SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [312] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : What is the name of the winner with the most rank points who participated in the Australian Open tournament |
| Pred: SELECT T2.winner_name FROM rankings AS T1 JOIN players AS T2 ON T1.player_id = T2.'solo_rank_points = (SELECT MAX(T1.loser_Rank_Points) FROM matches AS T3 JOIN the Australian Open AS T4 ON T3.winning_ioc = T4.winning_id WHERE t4.t3.t4.brandonney_name = "Australian Open") |
| Gold: SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [313] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : find the names of loser and winner who played in the match with greatest number of minutes |
| Pred: SELECT T1.loser_name, T2.winner_name FROM MATCH AS T1 JOIN players AS T2 ON T 1.Loser_ID = T 2.Player_ID JOIN matches AS T3 ON T3.Winning_Id = T4.Winner_Id ORDER BY T3:T3.minutes DESC LIMIT 1 |
| Gold: SELECT winner_name, loser_name FROM matches ORDER BY minutes DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [314] OTHER | DB: wta_1 | EX: β |
| Q : What are the names of the winner and loser who played in the longest match |
| Pred: SELECT winner_name, loser_name FROM matches ORDER BY match_num DESC LIMIT 1 |
| Gold: SELECT winner_name, loser_name FROM matches ORDER BY minutes DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [315] MISSING_JOIN | DB: wta_1 | EX: β |
| Q : Find the average ranking for each player and their first name |
| Pred: SELECT AVG(Ranking), first_name FROM players |
| Gold: SELECT AVG(ranking), T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [316] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : What are the first names of all players, and their average rankings |
| Pred: SELECT T2.first_name, AVG(T2.rank_points) FROM rankings AS T1 JOIN players AS T2 ON T1.player_id = TRUE GROUP BY first_name |
| Gold: SELECT AVG(ranking), T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [317] MISSING_JOIN | DB: wta_1 | EX: β |
| Q : Find the total ranking points for each player and their first name |
| Pred: SELECT SUM(Ranking_Points), first_name FROM players |
| Gold: SELECT SUM(ranking_points), T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [318] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : What are the first names of all players, and their total ranking points |
| Pred: SELECT T2.first_name, SUM(T2.ranking_points) FROM rankings AS T1 JOIN players AS T2 ON T1.player_id = T2.' |
| Gold: SELECT SUM(ranking_points), T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [319] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : find the number of players for each country |
| Pred: SELECT Country_Code, COUNT(*) FROM players GROUP BY Country_code |
| Gold: SELECT COUNT(*), country_code FROM players GROUP BY country_code |
| Type: GROUP_BY, AGGREGATION |
|
|
| [320] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : How many players are from each country |
| Pred: SELECT Country_Code, COUNT(*) FROM players GROUP BY Country_code |
| Gold: SELECT COUNT(*), country_code FROM players GROUP BY country_code |
| Type: GROUP_BY, AGGREGATION |
|
|
| [321] EXTRA_JOIN | DB: wta_1 | EX: β |
| Q : Find the total number of tours for each ranking date |
| Pred: SELECT T2.ranking_date, COUNT(*) FROM rankings AS T1 JOIN players AS T2 ON T1.player_id = T2.' |
| Gold: SELECT SUM(tours), ranking_date FROM rankings GROUP BY ranking_date |
| Type: GROUP_BY, AGGREGATION |
|
|
| [322] EXTRA_JOIN | DB: wta_1 | EX: β |
| Q : How many total tours were there for each ranking date |
| Pred: SELECT T2.ranking_date, COUNT(*) FROM rankings AS T1 JOIN players AS T2 ON T1.player_id = T2.' GROUP BY TRUE_Date |
| Gold: SELECT SUM(tours), ranking_date FROM rankings GROUP BY ranking_date |
| Type: GROUP_BY, AGGREGATION |
|
|
| [323] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : Find the name and rank of the 3 youngest winners across all matches |
| Pred: SELECT winner_name, winner_rank_points FROM matches ORDER BY winner_age ASC LIMIT 3 |
| Gold: SELECT DISTINCT winner_name, winner_rank FROM matches ORDER BY winner_age LIMIT 3 |
| Type: ORDER_BY, LIMIT |
|
|
| [324] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : What are the names and ranks of the three youngest winners across all matches |
| Pred: SELECT winner_name, winner_rank_points FROM matches ORDER BY winner_age ASC LIMIT 3 |
| Gold: SELECT DISTINCT winner_name, winner_rank FROM matches ORDER BY winner_age LIMIT 3 |
| Type: ORDER_BY, LIMIT |
|
|
| [325] OTHER | DB: wta_1 | EX: β |
| Q : How many different winners both participated in the WTA Championships and were left handed |
| Pred: SELECT COUNT(DISTINCT winner_name) FROM matches WHERE winner_hand = "left" AND tourney_name = "WTA Championships" |
| Gold: SELECT COUNT(DISTINCT winner_name) FROM matches WHERE tourney_name = 'WTA Championships' AND winner_hand = 'L' |
| Type: AGGREGATION |
|
|
| [326] EXTRA_JOIN | DB: wta_1 | EX: β |
| Q : Find the number of left handed winners who participated in the WTA Championships |
| Pred: SELECT COUNT(*) FROM matches AS T1 JOIN winner_hand AS T2 ON T1.winner_id = T2.loser_id JOIN tourney_id AS T3 ON T3.t2.t1.tourney_aid = T1.'WTA Championships' |
| Gold: SELECT COUNT(DISTINCT winner_name) FROM matches WHERE tourney_name = 'WTA Championships' AND winner_hand = 'L' |
| Type: AGGREGATION |
|
|
| [327] WRONG_TABLE | DB: wta_1 | EX: β |
| Q : Find the first name, country code and birth date of the winner who has the highest rank points in all matches |
| Pred: SELECT T2.winner_name, T1.country_code, T2.'winner_rank_points FROM rankings AS T1 JOIN players AS T2 ON TRUE JOIN MATCH AS T3 ON T1?winner_id = T3.player_id ORDER BY T3.] DESC LIMIT 1 |
| Gold: SELECT T1.first_name, T1.country_code, T1.birth_date FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id ORDER BY T2.winner_rank_points DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [328] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : What is the first name, country code, and birth date of the player with the most winner rank points across all matches |
| Pred: SELECT T1.first_name, T2.country_code, T1:Birth_Date FROM players AS T1 JOIN ROLES AS T2 ON TRUE JOIN Player AS T3 ON T3.Player_ID = T1?Player_Id GROUP BY first_name ORDER BY SUM(T3.winner_rank_points) DESC LIMIT 1 |
| Gold: SELECT T1.first_name, T1.country_code, T1.birth_date FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id ORDER BY T2.winner_rank_points DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [329] WRONG_COLUMNS | DB: wta_1 | EX: β |
| Q : How many players are there for each hand type |
| Pred: SELECT hand, COUNT(*) FROM players GROUP BY hand |
| Gold: SELECT COUNT(*), hand FROM players GROUP BY hand |
| Type: GROUP_BY, AGGREGATION |
|
|
| [330] OTHER | DB: battle_death | EX: β |
| Q : How many ships ended up being 'Captured' |
| Pred: SELECT COUNT(*) FROM ship WHERE result = 'Captured' |
| Gold: SELECT COUNT(*) FROM ship WHERE disposition_of_ship = 'Captured' |
| Type: AGGREGATION |
|
|
| [331] WRONG_COLUMNS | DB: battle_death | EX: β |
| Q : List the name, date and result of each battle |
| Pred: SELECT name, date, result FROM battle |
| Gold: SELECT name, date FROM battle |
| Type: SIMPLE |
|
|
| [332] WRONG_COLUMNS | DB: battle_death | EX: β |
| Q : What is maximum and minimum death toll caused each time |
| Pred: SELECT MAX(Death), MIN(Death) FROM death GROUP BY death |
| Gold: SELECT MAX(killed), MIN(killed) FROM death |
| Type: AGGREGATION |
|
|
| [333] WRONG_COLUMNS | DB: battle_death | EX: β |
| Q : What is the average number of injuries caused each time |
| Pred: SELECT AVG(injured), date FROM death GROUP BY date |
| Gold: SELECT AVG(injured) FROM death |
| Type: AGGREGATION |
|
|
| [334] WRONG_COLUMNS | DB: battle_death | EX: β |
| Q : What are the death and injury situations caused by the ship with tonnage 't' |
| Pred: SELECT T1.sentiment, T3.injured FROM death AS T1 JOIN ship AS T2 ON T1.'s caused_by_ship_id = T2.id WHERE Tonnage = 't' |
| Gold: SELECT T1.killed, T1.injured FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id WHERE T2.tonnage = 't' |
| Type: JOIN |
|
|
| [335] WRONG_TABLE | DB: battle_death | EX: β |
| Q : What are the different ids and names of the battles that lost any 'Brig' type shipes |
| Pred: SELECT DISTINCT T1.id, T2.name FROM ship AS T1 JOIN lost_in_battle AS T2 ON T1.'s id = T3.id WHERE ship_type = 'Brig' |
| Gold: SELECT DISTINCT T1.id, T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.ship_type = 'Brig' |
| Type: JOIN |
|
|
| [336] MISSING_JOIN | DB: battle_death | EX: β |
| Q : What are the ids and names of the battles that led to more than 10 people killed in total |
| Pred: SELECT id, name FROM battle GROUP BY id HAVING SUM(killed) > 10 |
| Gold: SELECT T1.id, T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle JOIN death AS T3 ON T2.id = T3.caused_by_ship_id GROUP BY T1.id HAVING SUM(T3.killed) > 10 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [337] WRONG_TABLE | DB: battle_death | EX: β |
| Q : What is the ship id and name that caused most total injuries |
| Pred: SELECT id, name FROM ship ORDER BY injured DESC LIMIT 1 |
| Gold: SELECT T2.id, T2.name FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [338] EXTRA_JOIN | DB: battle_death | EX: β |
| Q : What are the distinct battle names which are between bulgarian commander 'Kaloyan' and latin commander 'Baldwin I' |
| Pred: SELECT DISTINCT T3.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle AS T3 JOIN bulgarian_commander AS T4 ON T4.ID = T5.id JOIN latin_Commander AS t5 ON T3?ID = 'Baldwin i' |
| Gold: SELECT name FROM battle WHERE bulgarian_commander = 'Kaloyan' AND latin_commander = 'Baldwin I' |
| Type: SIMPLE |
|
|
| [339] WRONG_TABLE | DB: battle_death | EX: β |
| Q : List the name and date the battle that has lost the ship named 'Lettice' and the ship named 'HMS Atalanta' |
| Pred: SELECT T3.name, T3:date FROM ship AS T1 JOIN lost_in_battle AS T2 ON T1.id = T2.lost_in-battle WHERE t1.name = 'Lettice' INTERSECT SELECT t3.date, t3:name FROM battle AS T3 JOIN ship AS t4 ON T3_id = t4.lost-in_ship WHERE t4.(*) = 'HMS Atalanta') |
| Gold: SELECT T1.name, T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'Lettice' INTERSECT SELECT T1.name, T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'HMS Atalanta' |
| Type: JOIN |
|
|
| [340] WRONG_TABLE | DB: battle_death | EX: β |
| Q : Show names, results and bulgarian commanders of the battles with no ships lost in the 'English Channel' |
| Pred: SELECT name, result, bulgarian_commander FROM battle WHERE NOT id IN (SELECT lost_in_battle FROM ship WHERE LOCATION = 'English Channel') |
| Gold: SELECT name, RESULT, bulgarian_commander FROM battle EXCEPT SELECT T1.name, T1.result, T1.bulgarian_commander FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.location = 'English Channel' |
| Type: JOIN |
|
|
| [341] OTHER | DB: battle_death | EX: β |
| Q : What are the notes of the death events which has substring 'East' |
| Pred: SELECT note FROM death WHERE RESULT LIKE 'East%' |
| Gold: SELECT note FROM death WHERE note LIKE '%East%' |
| Type: SIMPLE |
|
|
| [342] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : what are all the addresses including line 1 and line 2 |
| Pred: SELECT address_id FROM addresses WHERE line_1 = "1" AND line_2 = "2" |
| Gold: SELECT line_1, line_2 FROM addresses |
| Type: SIMPLE |
|
|
| [343] OTHER | DB: student_transcripts_tracking | EX: β |
| Q : Which department offers the most number of degrees? List department name and id |
| Pred: SELECT T2.department_name, T1.dePARTMENT_ID FROM degree_programs AS T1 JOIN departments AS T2 ON department_id = T2.' GROUP BY department_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.department_name, T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [344] OTHER | DB: student_transcripts_tracking | EX: β |
| Q : What is the name and id of the department with the most number of degrees |
| Pred: SELECT T2.department_name, T1.dePARTMENT_ID FROM degree_programs AS T1 JOIN departments AS T2 ON department_id = T2.' GROUP BY department_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT t2.department_name, t1.department_id FROM degree_programs AS t1 JOIN departments AS t2 ON t1.department_id = t2.department_id GROUP BY t1.department_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [345] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : How many departments offer any degree |
| Pred: SELECT COUNT(DISTINCT department_name) FROM degree_programs |
| Gold: SELECT COUNT(DISTINCT department_id) FROM Degree_Programs |
| Type: AGGREGATION |
|
|
| [346] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : How many different departments offer degrees |
| Pred: SELECT COUNT(DISTINCT department_name) FROM degree_programs |
| Gold: SELECT COUNT(DISTINCT department_id) FROM Degree_Programs |
| Type: AGGREGATION |
|
|
| [347] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : How many different degree names are offered |
| Pred: SELECT COUNT(DISTINCT degree_title) FROM degree_programs |
| Gold: SELECT COUNT(DISTINCT degree_summary_name) FROM Degree_Programs |
| Type: AGGREGATION |
|
|
| [348] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : How many different degrees are offered |
| Pred: SELECT COUNT(DISTINCT degree_program_id) FROM Degree_Programs |
| Gold: SELECT COUNT(DISTINCT degree_summary_name) FROM Degree_Programs |
| Type: AGGREGATION |
|
|
| [349] MISSING_JOIN | DB: student_transcripts_tracking | EX: β |
| Q : How many degrees does the engineering department offer |
| Pred: SELECT COUNT(DISTINCT department_id) FROM departments WHERE department_name = "engineer" |
| Gold: SELECT COUNT(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer' |
| Type: JOIN, AGGREGATION |
|
|
| [350] MISSING_JOIN | DB: student_transcripts_tracking | EX: β |
| Q : How many degrees does the engineering department have |
| Pred: SELECT COUNT(DISTINCT department_id) FROM departments WHERE department_name = "engineer" |
| Gold: SELECT COUNT(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer' |
| Type: JOIN, AGGREGATION |
|
|
| [351] MISSING_JOIN | DB: student_transcripts_tracking | EX: β |
| Q : What are the names and id of courses having at most 2 sections |
| Pred: SELECT course_name, course_id FROM courses WHERE SECTION_id COUNT(*) <= 2 |
| Gold: SELECT T1.course_name, T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING COUNT(*) <= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [352] MISSING_JOIN | DB: student_transcripts_tracking | EX: β |
| Q : What are the names and ids of every course with less than 2 sections |
| Pred: SELECT course_name, course_id FROM courses WHERE SECTION < 2 |
| Gold: SELECT T1.course_name, T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING COUNT(*) <= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [353] OTHER | DB: student_transcripts_tracking | EX: β |
| Q : List the section_name in reversed lexicographical order |
| Pred: SELECT section_name FROM sections ORDER BY SECTION_name |
| Gold: SELECT section_name FROM Sections ORDER BY section_name DESC |
| Type: ORDER_BY |
|
|
| [354] OTHER | DB: student_transcripts_tracking | EX: β |
| Q : What are the names of the sections in reverse alphabetical order |
| Pred: SELECT section_name FROM sections ORDER BY SECTION_name |
| Gold: SELECT section_name FROM Sections ORDER BY section_name DESC |
| Type: ORDER_BY |
|
|
| [355] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the semester which most student registered in? Show both the name and the id |
| Pred: SELECT T2.semester_name, T1.student_id FROM student_enrolment AS T1 JOIN semesters AS T2 ON T 1.sterter_id = T 2.sester_id GROUP BY semester_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.semester_name, T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [356] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : For each semester, what is the name and id of the one with the most students registered |
| Pred: SELECT T2.semester_name, T1.student_id FROM student_enrolment AS T1 JOIN semesters AS T2 ON TRUE GROUP BY semester_id ORDER BY COUNT(*) LIMIT 1 |
| Gold: SELECT T1.semester_name, T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [357] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id |
| Pred: SELECT T1.first_name, T2.middle_name , T2_last_name FROM Student_Enrolment AS T1 JOIN Degree_Programs AS T2 ON T1."degree_program_id = 2 |
| Gold: SELECT T1.first_name, T1.middle_name, T1.last_name, T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) = 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [358] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What are the first, middle, and last names, along with the ids, of all students who enrolled in 2 degree programs in one semester |
| Pred: SELECT T1.first_name, T2.middle_age, T3.last_name FROM Student_Enrolment AS T1 JOIN Student_Course_Types AS T2 ON TRUE JOIN Degrees AS T3 ON T1?degree_program_id = 2 AND T2?student_id IN (SELECT student_id FROM student_enrolment WHERE semester_date = 1) GROUP BY student_advisor HAVING COUNT(*) = 2 |
| Gold: SELECT T1.first_name, T1.middle_name, T1.last_name, T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) = 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [359] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Who is enrolled in a Bachelor degree program? List the first name, middle name, last name |
| Pred: SELECT DISTINCT T1.first_name, T2.middle_age, T4.last_name FROM Student_Enrolment AS T1 JOIN Degree_Programs AS T2 ON T1?degree_program_id = T2.' Bachelor' |
| Gold: SELECT DISTINCT T1.first_name, T1.middle_name, T1.last_name FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id JOIN Degree_Programs AS T3 ON T2.degree_program_id = T3.degree_program_id WHERE T3.degree_summary_name = 'Bachelor' |
| Type: JOIN |
|
|
| [360] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What are the first, middle, and last names for everybody enrolled in a Bachelors program |
| Pred: SELECT DISTINCT T1.first_name, T2.last_name FROM Student_Enrolment AS T1 JOIN Degree_Programs AS T2 ON T1.'sachelors_program_id = Bachelors' |
| Gold: SELECT DISTINCT T1.first_name, T1.middle_name, T1.last_name FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id JOIN Degree_Programs AS T3 ON T2.degree_program_id = T3.degree_program_id WHERE T3.degree_summary_name = 'Bachelor' |
| Type: JOIN |
|
|
| [361] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Find the kind of program which most number of students are enrolled in |
| Pred: SELECT T2.degree_program_id FROM student_enrolment AS T1 JOIN course_courses AS T2 ON T1.course_id = T2.' GROUP BY T4.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [362] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the degree summary name that has the most number of students enrolled |
| Pred: SELECT T2.degree_summary_name FROM student_enrolment AS T1 JOIN degree_programs AS T2 ON T1.year_program_id = T2.' GROUP BY T4.year-program_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [363] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Find the program which most number of students are enrolled in. List both the id and the summary |
| Pred: SELECT T1.degree_program_id, T2.year_summary_name FROM student_enrolment AS T1 JOIN degree_programs AS T2 ON T1.' |
| Gold: SELECT T1.degree_program_id, T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [364] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the program id and the summary of the degree that has the most students enrolled |
| Pred: SELECT T1.degree_program_id, T2. degree_summary_description FROM student_enrolment AS T1 JOIN degree_programs AS T2 ON T1.'sprogram_ id = T2.'sProgram_id GROUP BY T1.(*) ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.degree_program_id, T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [365] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Which student has enrolled for the most times in any program? List the id, first name, middle name, last name, the number of enrollments and student id |
| Pred: SELECT T1.student_id, T2.fearless_name, COUNT(*) FROM Student_Enrolment AS T1 JOIN Students AS T2 ON T1.'s student_id = T2.'s middle_advisor, T3.last_name = 'student' UNION SELECT T4.student-id, MAX(T4.enrolment_id) FROM student_enrolments AS T4 JOIN Student_Course_Types AS T5 ON T4.' |
| Gold: SELECT T1.student_id, T1.first_name, T1.middle_name, T1.last_name, COUNT(*), T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [366] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the first, middle, and last name, along with the id and number of enrollments, for the student who enrolled the most in any program |
| Pred: SELECT T1.first_name, T2.middle_age, COUNT(*) FROM Student_Enrolment_Courses AS T1 JOIN Students AS T2 ON TRUE JOIN Student_Course_ID AS T3 ON T4.student_id = T3. student_id GROUP BY T1:student_student_ id ORDER BY SUM(student_enrolment) DESC LIMIT 1 |
| Gold: SELECT T1.student_id, T1.first_name, T1.middle_name, T1.last_name, COUNT(*), T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [367] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : Which semesters do not have any student enrolled? List the semester name |
| Pred: SELECT semester_name FROM semesters WHERE NOT semester_id IN (SELECT semester-id FROM student_enrolment) |
| Gold: SELECT semester_name FROM Semesters WHERE NOT semester_id IN (SELECT semester_id FROM Student_Enrolment) |
| Type: NESTED |
|
|
| [368] EXTRA_JOIN | DB: student_transcripts_tracking | EX: β |
| Q : What is the name of the semester with no students enrolled |
| Pred: SELECT semester_name FROM semesters EXCEPT SELECT T2.semester_name from student_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.' |
| Gold: SELECT semester_name FROM Semesters WHERE NOT semester_id IN (SELECT semester_id FROM Student_Enrolment) |
| Type: NESTED |
|
|
| [369] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : What are all the course names of the courses which ever have students enrolled in |
| Pred: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.' |
| Gold: SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id |
| Type: JOIN |
|
|
| [370] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What are the names of all courses that have some students enrolled |
| Pred: SELECT T2.course_name FROM Student_Enrolment_Courses AS T1 JOIN Courses AS T2 ON T1.ccourse_id = T2.' |
| Gold: SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id |
| Type: JOIN |
|
|
| [371] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What's the name of the course with most number of enrollments |
| Pred: SELECT T2.course_name FROM Student_Enrolment_Courses AS T1 JOIN Courses AS T2 ON T1.council_id = T3.courier_course_id GROUP BY course_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [372] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the name of the course with the most students enrolled |
| Pred: SELECT T2.course_name FROM Student_Enrolment_Courses AS T1 JOIN Courses AS T2 ON T1.student_course_id = T3.student-course_ID GROUP BY T1."student_student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [373] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : Find the last name of the students who currently live in the state of North Carolina but have not registered in any degree program |
| Pred: SELECT last_name FROM students WHERE state_province_county = "North Carolina" EXCEPT SELECT T2.last_name from students AS T1 JOIN student_enrolment AS T2 ON T1.student_id = T2.'ssn JOIN degree_programs AS T3 ON T3.degree_program_id_t2.course_id JOIN Students AS T4 ON T4.undergraduate_address_ID = T4: |
| Gold: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id = T4.student_id |
| Type: JOIN |
|
|
| [374] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : What are the last name of the students who live in North Carolina but have not registered in any degree programs |
| Pred: SELECT last_name FROM students WHERE state_province_county = "North Carolina" EXCEPT SELECT T1.lub_mobile_number FROM students AS T1 JOIN student_enrolment AS T2 ON T2.student_id = T3. student_id JOIN degree_programs AS T4 ON T4.degree_program_ID = T5.program_id WHERE T4:state_providate_countY = "Yes" |
| Gold: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id = T4.student_id |
| Type: JOIN |
|
|
| [375] MISSING_GROUP_BY | DB: student_transcripts_tracking | EX: β |
| Q : Show the date and id of the transcript with at least 2 course results |
| Pred: SELECT T2.transcript_date, T1. transcript_id FROM transcript_contents AS T1 JOIN transcripts AS T2 ON T1."index_index_date = 2 |
| Gold: SELECT T2.transcript_date, T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [376] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : What is the date and id of the transcript with at least 2 courses listed |
| Pred: SELECT T2.transcript_date, T1.registration_id FROM transcript_contents AS T1 JOIN courses AS T2 ON T 1.regional_id = T 2.regual_id GROUP BY T1-registration-id HAVING COUNT(*) >= 2 |
| Gold: SELECT T2.transcript_date, T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [377] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the phone number of the man with the first name Timmothy and the last name Ward |
| Pred: SELECT cell_mobile_number FROM addresses WHERE first_name = "Timmothy" AND last_name <> "Ward" |
| Gold: SELECT cell_mobile_number FROM Students WHERE first_name = 'Timmothy' AND last_name = 'Ward' |
| Type: SIMPLE |
|
|
| [378] OTHER | DB: student_transcripts_tracking | EX: β |
| Q : What is the mobile phone number of the student named Timmothy Ward |
| Pred: SELECT cell_mobile_number FROM students WHERE first_name = "Timmothy" AND last_name <> "Ward" |
| Gold: SELECT cell_mobile_number FROM students WHERE first_name = 'timmothy' AND last_name = 'ward' |
| Type: SIMPLE |
|
|
| [379] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : Who is the first student to register? List the first name, middle name and last name |
| Pred: SELECT DISTINCT first_name, middle_name and last_name FROM Students ORDER BY date_first_registered ASC LIMIT 1 |
| Gold: SELECT first_name, middle_name, last_name FROM Students ORDER BY date_first_registered ASC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [380] MISSING_ORDER_BY | DB: student_transcripts_tracking | EX: β |
| Q : What is the first, middle, and last name of the first student to register |
| Pred: SELECT date_first_registered, middle_name, last_name FROM Students |
| Gold: SELECT first_name, middle_name, last_name FROM Students ORDER BY date_first_registered ASC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [381] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Who is the earliest graduate of the school? List the first name, middle name and last name |
| Pred: SELECT DISTINCT T1.first_name, T2.middle_name and T2."last_name FROM student_enrolment AS T1 JOIN courses AS T2 ON T1:semester_id = T2:id ORDER BY T2/date_first_registered LIMIT 1 |
| Gold: SELECT first_name, middle_name, last_name FROM Students ORDER BY date_left ASC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [382] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the first, middle, and last name of the earliest school graduate |
| Pred: SELECT T1.first_name, T2.middle_age, T1:last_name FROM Student_Enrolment AS T1 JOIN Students AS T2 ON T1.'s2.student_id = T2.'s earliest_student_enrolment' |
| Gold: SELECT first_name, middle_name, last_name FROM Students ORDER BY date_left ASC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [383] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : Whose permanent address is different from his or her current address? List his or her first name |
| Pred: SELECT first_name, last_name FROM Students WHERE permanent_address_id <> (SELECT permanent_ address_id FROM Students) |
| Gold: SELECT first_name FROM Students WHERE current_address_id <> permanent_address_id |
| Type: SIMPLE |
|
|
| [384] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : What is the first name of the student whose permanent address is different from his or her current one |
| Pred: SELECT first_name FROM Students WHERE permanent_address_id <> (SELECT permanent_ address_id FROM Students) |
| Gold: SELECT first_name FROM Students WHERE current_address_id <> permanent_address_id |
| Type: SIMPLE |
|
|
| [385] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Which address holds the most number of students currently? List the address id and all lines |
| Pred: SELECT address_id, line_1 FROM students AS T1 JOIN addresses AS T2 ON T1.address_id = T2.change_address_ID GROUP BY T1.'address_ id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.address_id, T1.line_1, T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.current_address_id GROUP BY T1.address_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [386] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : What is the id, line 1, and line 2 of the address with the most students |
| Pred: SELECT T1.address_id, T2.line_1, COUNT(DISTINCT line_2) FROM Addresses AS T1 JOIN Students AS T2 ON T1."address_ID = T 2.address-id GROUP BY T1.(*) ORDER BY SUM(T2.student_id) DESC LIMIT 1 |
| Gold: SELECT T1.address_id, T1.line_1, T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.current_address_id GROUP BY T1.address_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [387] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : When is the first transcript released? List the date and details |
| Pred: SELECT date_first_registered, date_last_registered FROM transcripts ORDER BY transcript_date ASC LIMIT 1 |
| Gold: SELECT transcript_date, other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [388] MISSING_ORDER_BY | DB: student_transcripts_tracking | EX: β |
| Q : What is the earliest date of a transcript release, and what details can you tell me |
| Pred: SELECT other_details, MIN( transcript_date) FROM transcripts |
| Gold: SELECT transcript_date, other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [389] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : What is the last transcript release date |
| Pred: SELECT last_date FROM transcripts ORDER BY transcript_date ASC LIMIT 1 |
| Gold: SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [390] EXTRA_JOIN | DB: student_transcripts_tracking | EX: β |
| Q : When was the last transcript released |
| Pred: SELECT T2.transcript_date FROM transcripts AS T1 JOIN transcript_contents AS T2 ON T1.transcription_id = T2."date_first_registered" |
| Gold: SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [391] EXTRA_JOIN | DB: student_transcripts_tracking | EX: β |
| Q : How many times at most can a course enrollment result show in different transcripts? Also show the course enrollment id |
| Pred: SELECT T1.transcript_id, COUNT(*) FROM transcript_contents AS T1 JOIN student_enrolment_courses AS T2 ON T2.student_course_id = T1 |
| Gold: SELECT COUNT(*), student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [392] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the maximum number of times that a course shows up in different transcripts and what is that course's enrollment id |
| Pred: SELECT T1.course_id, COUNT(*) FROM transcripts AS T1 JOIN student_enrolment_courses AS T2 ON T2.transcript_id = T3.student_track_id GROUP BY course_id |
| Gold: SELECT COUNT(*), student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [393] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Show the date of the transcript which shows the least number of results, also list the id |
| Pred: SELECT T1. transcript_date, T2.transcript_id FROM transcripts AS T1 JOIN transcript_contents AS T2 ON T1.'select T3.transcription_id ORDER BY COUNT(*) ASC LIMIT 1 |
| Gold: SELECT T2.transcript_date, T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id ORDER BY COUNT(*) ASC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [394] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : What is the date and id of the transcript with the least number of results |
| Pred: SELECT T2.transcript_date, T1. transcript_id FROM transcript_contents AS T1 JOIN transcripts AS T2 ON T1."select T2."transcription_id%" GROUP BY T1.(*) ORDER BY COUNT(*) ASC LIMIT 1 |
| Gold: SELECT T2.transcript_date, T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id ORDER BY COUNT(*) ASC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [395] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Find the semester when both Master students and Bachelor students got enrolled in |
| Pred: SELECT T2.semester_name FROM Student_Enrolment AS T1 JOIN Student_Course_Types AS T2 ON T1.year_enrolment_id = T3.student_id JOIN Semesters AS T3 ON T2."Master_Program_ID" = T33.program_id WHERE T1."degree_summary_name = "Bachelor" |
| Gold: SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Bachelor' |
| Type: JOIN |
|
|
| [396] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What is the id of the semester that had both Masters and Bachelors students enrolled |
| Pred: SELECT T1.semester_id FROM Student_Enrolment AS T1 JOIN Student_Course_Types AS T2 ON T2.student_id = T1.'s Masters' INTERSECT SELECT semester_id from Student_enrolment WHERE semester_name = 'Bachelors' |
| Gold: SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Bachelor' |
| Type: JOIN |
|
|
| [397] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : How many different addresses do the students currently live |
| Pred: SELECT COUNT(DISTINCT address_id) FROM students |
| Gold: SELECT COUNT(DISTINCT current_address_id) FROM Students |
| Type: AGGREGATION |
|
|
| [398] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : What are the different addresses that have students living there |
| Pred: SELECT DISTINCT address FROM students |
| Gold: SELECT COUNT(DISTINCT current_address_id) FROM Students |
| Type: AGGREGATION |
|
|
| [399] MISSING_ORDER_BY | DB: student_transcripts_tracking | EX: β |
| Q : List all the student details in reversed lexicographical order |
| Pred: SELECT other_student_details FROM Students WHERE other_details = 'DISTINCT lexicographical' |
| Gold: SELECT other_student_details FROM Students ORDER BY other_student_details DESC |
| Type: ORDER_BY |
|
|
| [400] OTHER | DB: student_transcripts_tracking | EX: β |
| Q : What other details can you tell me about students in reverse alphabetical order |
| Pred: SELECT other_student_details FROM Students ORDER BY other_ student_details |
| Gold: SELECT other_student_details FROM Students ORDER BY other_student_details DESC |
| Type: ORDER_BY |
|
|
| [401] WRONG_COLUMNS | DB: student_transcripts_tracking | EX: β |
| Q : Describe the section h |
| Pred: SELECT section_name FROM sections WHERE line_1 = 'H' |
| Gold: SELECT section_description FROM Sections WHERE section_name = 'h' |
| Type: SIMPLE |
|
|
| [402] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 |
| Pred: SELECT T2.first_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T3.permanent_address-id WHERE T1."country = "Hait Haiti" OR T1!cell_mobile_number = "090000166582" |
| Gold: SELECT t1.first_name FROM students AS t1 JOIN addresses AS t2 ON t1.permanent_address_id = t2.address_id WHERE t2.country = 'haiti' OR t1.cell_mobile_number = '09700166582' |
| Type: JOIN |
|
|
| [403] WRONG_TABLE | DB: student_transcripts_tracking | EX: β |
| Q : What are the first names of the students who live in Haiti permanently or have the cell phone number 09700166582 |
| Pred: SELECT T2.first_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T3.permanent_address_ id JOIN Residents AS T3 ON T3:address_ID = T2.'Address.city = 'Haiti' UNION SELECT DISTINCT first_name, last_name from Students WHERE state_province_county = "HAITHA" OR T1."cell_mobile_number = "09700166582" |
| Gold: SELECT t1.first_name FROM students AS t1 JOIN addresses AS t2 ON t1.permanent_address_id = t2.address_id WHERE t2.country = 'haiti' OR t1.cell_mobile_number = '09700166582' |
| Type: JOIN |
|
|
| [404] EXTRA_JOIN | DB: tvshow | EX: β |
| Q : List the title of all cartoon directed by "Ben Jones" or "Brandon Vietti" |
| Pred: SELECT title FROM cartoon WHERE directed_by = "Ben Jones" UNION SELECT t1.title FROM cartoon AS t1 JOIN tv_channel AS t2 ON t2.channel = t3.id WHERE t1."directed_by" = "Brandon Vietti" |
| Gold: SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" OR Directed_by = "Brandon Vietti" |
| Type: SIMPLE |
|
|
| [405] WRONG_TABLE | DB: tvshow | EX: β |
| Q : What are the titles of all cartoons directed by Ben Jones or Brandon Vietti |
| Pred: SELECT DISTINCT title FROM cartoon WHERE directed_by = "Ben Jones" UNION SELECT title FROM tv_channel WHERE written_by <> "Brandon Vietti" |
| Gold: SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" OR Directed_by = "Brandon Vietti" |
| Type: SIMPLE |
|
|
| [406] EXTRA_JOIN | DB: tvshow | EX: β |
| Q : Which country has the most of TV Channels? List the country and number of TV Channels it has |
| Pred: SELECT T1.country, COUNT(*) FROM tv_channel AS T1 JOIN channel AS T2 ON t1.id = t2.channel GROUP BY T2.country ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT Country, COUNT(*) FROM TV_Channel GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [407] EXTRA_JOIN | DB: tvshow | EX: β |
| Q : What is the country with the most number of TV Channels and how many does it have |
| Pred: SELECT t1.country, COUNT(*) FROM tv_channel AS t1 JOIN channel AS t2 ON t1?channel = t2.id GROUP BY t1.'country ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT Country, COUNT(*) FROM TV_Channel GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [408] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : List the number of different series names and contents in the TV Channel table |
| Pred: SELECT COUNT(DISTINCT series_name, content) FROM tv_channel |
| Gold: SELECT COUNT(DISTINCT series_name), COUNT(DISTINCT content) FROM TV_Channel |
| Type: AGGREGATION |
|
|
| [409] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : How many different series and contents are listed in the TV Channel table |
| Pred: SELECT COUNT(DISTINCT series_name, content) FROM tv_channel |
| Gold: SELECT COUNT(DISTINCT series_name), COUNT(DISTINCT content) FROM TV_Channel |
| Type: AGGREGATION |
|
|
| [410] EXTRA_JOIN | DB: tvshow | EX: β |
| Q : List the language used least number of TV Channel. List language and number of TV Channel |
| Pred: SELECT t1.language, COUNT(*) FROM tv_channel AS t1 JOIN channel AS t2 ON t2.channel = t3.id GROUP BY T1.languages ORDER BY COUNT(*) ASC LIMIT 1 |
| Gold: SELECT LANGUAGE, COUNT(*) FROM TV_Channel GROUP BY LANGUAGE ORDER BY COUNT(*) ASC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [411] EXTRA_JOIN | DB: tvshow | EX: β |
| Q : What are the languages used by the least number of TV Channels and how many channels use it |
| Pred: SELECT t1.languages, COUNT(*) FROM tv_channel AS t1 JOIN channel AS t2 ON t2.channel = t3.id GROUP BY t1!languages ORDER BY COUNT(*) ASC LIMIT 1 |
| Gold: SELECT LANGUAGE, COUNT(*) FROM TV_Channel GROUP BY LANGUAGE ORDER BY COUNT(*) ASC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [412] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : For each language, list the number of TV Channels that use it |
| Pred: SELECT COUNT(*), language FROM tv_channel GROUP BY language |
| Gold: SELECT LANGUAGE, COUNT(*) FROM TV_Channel GROUP BY LANGUAGE |
| Type: GROUP_BY, AGGREGATION |
|
|
| [413] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : What is the TV Channel that shows the cartoon "The Rise of the Blue Beetle!"? List the TV Channel's series name |
| Pred: SELECT T2.series_name FROM tv_channel AS T1 JOIN tv_series AS t2 ON T1.id = t2.tv_channel WHERE t1.title = "The Rise of the Blue Beetle!" |
| Gold: SELECT T1.series_name FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Title = "The Rise of the Blue Beetle!" |
| Type: JOIN |
|
|
| [414] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : What is the series name of the TV Channel that shows the cartoon "The Rise of the Blue Beetle" |
| Pred: SELECT T2.series_name FROM tv_channel AS T1 JOIN tv_series AS T2 ON T1.id = t2.channel WHERE t1.title = "The Rise of the Blue Beetle" |
| Gold: SELECT T1.series_name FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Title = "The Rise of the Blue Beetle!" |
| Type: JOIN |
|
|
| [415] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : List the title of all Cartoons showed on TV Channel with series name "Sky Radio" |
| Pred: SELECT T3.title FROM tv_channel AS T1 JOIN cartoon AS T2 ON T1.id = t2.channel JOIN tv_series AS T3 ON T2.tv_channel = t3.id WHERE t1.series_name = "Sky Radio" |
| Gold: SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio" |
| Type: JOIN |
|
|
| [416] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : What is the title of all the cartools that are on the TV Channel with the series name "Sky Radio" |
| Pred: SELECT t3.title FROM tv_channel AS t1 JOIN cartoon AS t2 ON t1.id = t2.channel JOIN tv_series AS t3 ON t2?channel = t3?channel?id WHERE series_name = "Sky Radio" |
| Gold: SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio" |
| Type: JOIN |
|
|
| [417] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : What are 3 most highly rated episodes in the TV series table and what were those ratings |
| Pred: SELECT rating, rating FROM tv_series ORDER BY rating DESC LIMIT 3 |
| Gold: SELECT Episode, Rating FROM TV_series ORDER BY Rating DESC LIMIT 3 |
| Type: ORDER_BY, LIMIT |
|
|
| [418] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : What is minimum and maximum share of TV series |
| Pred: SELECT MIN(share), MAX(share) FROM tv_series |
| Gold: SELECT MAX(SHARE), MIN(SHARE) FROM TV_series |
| Type: AGGREGATION |
|
|
| [419] EXTRA_JOIN | DB: tvshow | EX: β |
| Q : What is the air date of TV series with Episode "A Love of a Lifetime" |
| Pred: SELECT t1.air_date FROM tv_series AS t1 JOIN tv_channel AS t2 ON T1.id = t2.tv_channel WHERE episode = "A Love of a Lifetime" |
| Gold: SELECT Air_Date FROM TV_series WHERE Episode = "A Love of a Lifetime" |
| Type: SIMPLE |
|
|
| [420] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : When did the episode "A Love of a Lifetime" air |
| Pred: SELECT original_air_date FROM tv_series WHERE title = "A Love of a Lifetime" |
| Gold: SELECT Air_Date FROM TV_series WHERE Episode = "A Love of a Lifetime" |
| Type: SIMPLE |
|
|
| [421] OTHER | DB: tvshow | EX: β |
| Q : What is the weekly rank for the episode "A Love of a Lifetime" |
| Pred: SELECT weekly_rank FROM tv_series WHERE title = "A Love of a Lifetime" |
| Gold: SELECT Weekly_Rank FROM TV_series WHERE Episode = "A Love of a Lifetime" |
| Type: SIMPLE |
|
|
| [422] WRONG_TABLE | DB: tvshow | EX: β |
| Q : What is the TV Channel of TV series with Episode "A Love of a Lifetime"? List the TV Channel's series name |
| Pred: SELECT T2.series_name FROM tv_series AS T1 JOIN tv AS t2 ON T1.id = t2.tv_channel WHERE t1.episode = "A Love of a Lifetime" |
| Gold: SELECT T1.series_name FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T2.Episode = "A Love of a Lifetime" |
| Type: JOIN |
|
|
| [423] WRONG_TABLE | DB: tvshow | EX: β |
| Q : What is the name of the series that has the episode "A Love of a Lifetime" |
| Pred: SELECT series_name FROM tv_series WHERE episode = "A Love of a Lifetime" |
| Gold: SELECT T1.series_name FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T2.Episode = "A Love of a Lifetime" |
| Type: JOIN |
|
|
| [424] WRONG_TABLE | DB: tvshow | EX: β |
| Q : List the Episode of all TV series showed on TV Channel with series name "Sky Radio" |
| Pred: SELECT episode FROM tv_series WHERE channel = "TV Channel" AND series_name = "Sky Radio" |
| Gold: SELECT T2.Episode FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio" |
| Type: JOIN |
|
|
| [425] WRONG_TABLE | DB: tvshow | EX: β |
| Q : What is the episode for the TV series named "Sky Radio" |
| Pred: SELECT episode FROM tv_series WHERE series_name = "Sky Radio" |
| Gold: SELECT T2.Episode FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio" |
| Type: JOIN |
|
|
| [426] MISSING_GROUP_BY | DB: tvshow | EX: β |
| Q : Find the number of cartoons directed by each of the listed directors |
| Pred: SELECT COUNT(DISTINCT directed_by), title FROM cartoon |
| Gold: SELECT COUNT(*), Directed_by FROM cartoon GROUP BY Directed_by |
| Type: GROUP_BY, AGGREGATION |
|
|
| [427] MISSING_GROUP_BY | DB: tvshow | EX: β |
| Q : How many cartoons did each director create |
| Pred: SELECT COUNT(DISTINCT directed_by), title FROM cartoon |
| Gold: SELECT COUNT(*), Directed_by FROM cartoon GROUP BY Directed_by |
| Type: GROUP_BY, AGGREGATION |
|
|
| [428] EXTRA_JOIN | DB: tvshow | EX: β |
| Q : Find the package choice and series name of the TV channel that has high definition TV |
| Pred: SELECT t1.package_option, t2.series_name FROM tv_channel AS t1 JOIN tv_series AS t2 ON t1v_channel = t 2.channel WHERE t1."high_definition_tv" = "TV" |
| Gold: SELECT package_option, series_name FROM TV_Channel WHERE hight_definition_TV = "yes" |
| Type: SIMPLE |
|
|
| [429] WRONG_TABLE | DB: tvshow | EX: β |
| Q : What are the package options and the name of the series for the TV Channel that supports high definition TV |
| Pred: SELECT package_option, series_name FROM tv_series WHERE channel = "high definition TV" |
| Gold: SELECT package_option, series_name FROM TV_Channel WHERE hight_definition_TV = "yes" |
| Type: SIMPLE |
|
|
| [430] WRONG_TABLE | DB: tvshow | EX: β |
| Q : which countries' tv channels are not playing any cartoon written by Todd Casey |
| Pred: SELECT country FROM tv_channel EXCEPT SELECT t1.country FROM tv AS t1 JOIN cartoon AS t2 ON t1?channel = t2.id JOIN tv_series AS t3 ON t2?series_name = t3.channel WHERE written_by = "Todd Casey" |
| Gold: SELECT country FROM TV_Channel EXCEPT SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey' |
| Type: JOIN |
|
|
| [431] WRONG_TABLE | DB: tvshow | EX: β |
| Q : What are the countries that are not playing cartoons written by Todd Casey |
| Pred: SELECT country FROM tv_channel EXCEPT SELECT country FROM cartoon WHERE written_by = "Todd Casey" |
| Gold: SELECT country FROM TV_Channel EXCEPT SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey' |
| Type: JOIN |
|
|
| [432] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : Find the series name and country of the tv channel that is playing some cartoons directed by Ben Jones and Michael Chang |
| Pred: SELECT t3.series_name, t3_country FROM tv_channel AS t1 JOIN cartoon AS t2 ON t1.id = t2.channel JOIN tv_series AS t3 ON t4.tv_channel = t5.id WHERE T2.directed_by = "Ben Jones" INTERSECT SELECT T3.Series_Name, t33.Country FROM TV_Channel AS t4 JOIN channel AS t5 ON t8. channel = t4? |
| Gold: SELECT T1.series_name, T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Michael Chang' INTERSECT SELECT T1.series_name, T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Ben Jones' |
| Type: JOIN |
|
|
| [433] WRONG_TABLE | DB: tvshow | EX: β |
| Q : What is the series name and country of all TV channels that are playing cartoons directed by Ben Jones and cartoons directed by Michael Chang |
| Pred: SELECT t1.series_name, t1-country FROM tv_channel AS t1 JOIN cartoon AS t2 ON t2.channel = t3.id WHERE t2."directed_by" = "Ben Jones" INTERSECT SELECT t1:series_ name, T1.country FROM TV_ channel AS t3 JOIN cartoons AS t4 ON t4.id = t5.channel WHERE directed_by = "Michael Chang" |
| Gold: SELECT T1.series_name, T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Michael Chang' INTERSECT SELECT T1.series_name, T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Ben Jones' |
| Type: JOIN |
|
|
| [434] OTHER | DB: tvshow | EX: β |
| Q : find id of the tv channels that from the countries where have more than two tv channels |
| Pred: SELECT id FROM tv_channel WHERE country = 'Country' GROUP BY country HAVING COUNT(*) > 2 |
| Gold: SELECT id FROM tv_channel GROUP BY country HAVING COUNT(*) > 2 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [435] OTHER | DB: tvshow | EX: β |
| Q : What are the ids of all tv channels that have more than 2 TV channels |
| Pred: SELECT id FROM tv_channel GROUP BY id HAVING COUNT(*) > 2 |
| Gold: SELECT id FROM tv_channel GROUP BY country HAVING COUNT(*) > 2 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [436] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : find the id of tv channels that do not play any cartoon directed by Ben Jones |
| Pred: SELECT id FROM tv_channel EXCEPT SELECT id FROM cartoon WHERE directed_by = "Ben Jones" |
| Gold: SELECT id FROM TV_Channel EXCEPT SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones' |
| Type: SIMPLE |
|
|
| [437] WRONG_COLUMNS | DB: tvshow | EX: β |
| Q : What are the ids of the TV channels that do not have any cartoons directed by Ben Jones |
| Pred: SELECT id FROM tv_channel EXCEPT SELECT id FROM cartoon WHERE directed_by = "Ben Jones" |
| Gold: SELECT id FROM TV_Channel EXCEPT SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones' |
| Type: SIMPLE |
|
|
| [438] OTHER | DB: tvshow | EX: β |
| Q : find the package option of the tv channel that do not have any cartoon directed by Ben Jones |
| Pred: SELECT package_option FROM tv_channel WHERE channel <> "TV_channel" EXCEPT SELECT channel FROM cartoon WHERE directed_by = "Ben Jones" |
| Gold: SELECT package_option FROM TV_Channel WHERE NOT id IN (SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones') |
| Type: NESTED |
|
|
| [439] OTHER | DB: tvshow | EX: β |
| Q : What are the package options of all tv channels that are not playing any cartoons directed by Ben Jones |
| Pred: SELECT package_option FROM tv_channel WHERE channel <> "TV_channel" EXCEPT SELECT channel FROM cartoon WHERE directed_by = "Ben Jones" |
| Gold: SELECT package_option FROM TV_Channel WHERE NOT id IN (SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones') |
| Type: NESTED |
|
|
| [440] WRONG_COLUMNS | DB: poker_player | EX: β |
| Q : List the earnings of poker players in descending order |
| Pred: SELECT Earnnings FROM poker_player ORDER BY Earnnings DESC |
| Gold: SELECT Earnings FROM poker_player ORDER BY Earnings DESC |
| Type: ORDER_BY |
|
|
| [441] WRONG_COLUMNS | DB: poker_player | EX: β |
| Q : What is the average earnings of poker players |
| Pred: SELECT AVG(Earning) FROM poker_player |
| Gold: SELECT AVG(Earnings) FROM poker_player |
| Type: AGGREGATION |
|
|
| [442] WRONG_COLUMNS | DB: poker_player | EX: β |
| Q : Return the average earnings across all poker players |
| Pred: SELECT AVG(Profits) FROM poker_player |
| Gold: SELECT AVG(Earnings) FROM poker_player |
| Type: AGGREGATION |
|
|
| [443] WRONG_TABLE | DB: poker_player | EX: β |
| Q : What are the names of poker players |
| Pred: SELECT Name FROM poker_player |
| Gold: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID |
| Type: JOIN |
|
|
| [444] WRONG_TABLE | DB: poker_player | EX: β |
| Q : Return the names of all the poker players |
| Pred: SELECT Name FROM poker_player |
| Gold: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID |
| Type: JOIN |
|
|
| [445] WRONG_TABLE | DB: poker_player | EX: β |
| Q : What are the names of poker players whose earnings is higher than 300000 |
| Pred: SELECT T3.Name FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.Poker_Player_ID WHERE HAVING AVG(T1.Earnings) > 300000 |
| Gold: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000 |
| Type: JOIN |
|
|
| [446] WRONG_TABLE | DB: poker_player | EX: β |
| Q : Give the names of poker players who have earnings above 300000 |
| Pred: SELECT T3.Name FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.Poker_Player_ID WHERE HAVING AVG(T1.Earnings) > 300000 |
| Gold: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000 |
| Type: JOIN |
|
|
| [447] WRONG_TABLE | DB: poker_player | EX: β |
| Q : List the names of poker players ordered by the final tables made in ascending order |
| Pred: SELECT Name FROM poker_player ORDER BY final_table_made ASC |
| Gold: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Final_Table_Made |
| Type: JOIN, ORDER_BY |
|
|
| [448] WRONG_TABLE | DB: poker_player | EX: β |
| Q : What are the names of poker players, ordered ascending by the number of final tables they have made |
| Pred: SELECT T3.Name FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.Poker_Player_ID GROUP BY T3 .Name ORDER BY COUNT(*) ASC |
| Gold: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Final_Table_Made |
| Type: JOIN, ORDER_BY |
|
|
| [449] WRONG_TABLE | DB: poker_player | EX: β |
| Q : What is the birth date of the poker player with the lowest earnings |
| Pred: SELECT T2.Birth_Date FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.'s Poker_Player_ID ORDER BY Total(T1.Earnings) ASC LIMIT 1 |
| Gold: SELECT T1.Birth_Date FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings ASC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [450] WRONG_TABLE | DB: poker_player | EX: β |
| Q : Return the birth date of the poker player with the lowest earnings |
| Pred: SELECT T2.Birth_Date FROM poker_player AS T1 JOIN people AS T2 ON T1.Poker_ID = T 2.People_ID ORDER BY Total(T1.Earnings) ASC LIMIT 1 |
| Gold: SELECT T1.Birth_Date FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings ASC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [451] WRONG_TABLE | DB: poker_player | EX: β |
| Q : What is the money rank of the tallest poker player |
| Pred: SELECT T2.Money_Rank FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.' |
| Gold: SELECT T2.Money_Rank FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [452] WRONG_TABLE | DB: poker_player | EX: β |
| Q : Return the money rank of the poker player with the greatest height |
| Pred: SELECT money_rank FROM poker_player ORDER BY Height DESC LIMIT 1 |
| Gold: SELECT T2.Money_Rank FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [453] WRONG_TABLE | DB: poker_player | EX: β |
| Q : What is the average earnings of poker players with height higher than 200 |
| Pred: SELECT AVG(T1.Earnings) FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.PeopleID WHERE T2."Height > 200 |
| Gold: SELECT AVG(T2.Earnings) FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 200 |
| Type: JOIN, AGGREGATION |
|
|
| [454] WRONG_TABLE | DB: poker_player | EX: β |
| Q : Give average earnings of poker players who are taller than 200 |
| Pred: SELECT AVG(T1.Earnings) FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.PeopleID WHERE T2."Height > 200 |
| Gold: SELECT AVG(T2.Earnings) FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 200 |
| Type: JOIN, AGGREGATION |
|
|
| [455] WRONG_TABLE | DB: poker_player | EX: β |
| Q : What are the names of poker players in descending order of earnings |
| Pred: SELECT T3.Name FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.Poker_Player_ID ORDER BY earnings DESC |
| Gold: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC |
| Type: JOIN, ORDER_BY |
|
|
| [456] WRONG_TABLE | DB: poker_player | EX: β |
| Q : Return the names of poker players sorted by their earnings descending |
| Pred: SELECT name FROM poker_player ORDER BY Earnings DESC |
| Gold: SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC |
| Type: JOIN, ORDER_BY |
|
|
| [457] OTHER | DB: poker_player | EX: β |
| Q : What are the names and birth dates of people, ordered by their names in alphabetical order |
| Pred: SELECT name, birth_date FROM people ORDER BY name |
| Gold: SELECT Name, Birth_Date FROM people ORDER BY Name ASC |
| Type: ORDER_BY |
|
|
| [458] EXTRA_JOIN | DB: poker_player | EX: β |
| Q : What are the names of people who do not play poker |
| Pred: SELECT Name FROM people EXCEPT SELECT T2.Name FROM poker_player AS T1 JOIN people AS T2 ON T1.People_ID = T2.' |
| Gold: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM poker_player) |
| Type: NESTED |
|
|
| [459] WRONG_TABLE | DB: voter_1 | EX: β |
| Q : How many states are there |
| Pred: SELECT COUNT(*) FROM state |
| Gold: SELECT COUNT(*) FROM area_code_state |
| Type: AGGREGATION |
|
|
| [460] WRONG_TABLE | DB: voter_1 | EX: β |
| Q : What are the maximum and minimum values of area codes |
| Pred: SELECT MAX(area_code), MIN(Area_code) FROM area_code |
| Gold: SELECT MAX(area_code), MIN(area_code) FROM area_code_state |
| Type: AGGREGATION |
|
|
| [461] WRONG_TABLE | DB: voter_1 | EX: β |
| Q : What are the contestant numbers and names of the contestants who had at least two votes |
| Pred: SELECT T2.Contestant_Number, T1.Panther_Name FROM votes AS T1 JOIN contestants AS T2 ON T1."SELECT contestant_number FROM contestants GROUP BY contestant_Number HAVING COUNT(*) >= 2 |
| Gold: SELECT T1.contestant_number, T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number GROUP BY T1.contestant_number HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [462] WRONG_TABLE | DB: voter_1 | EX: β |
| Q : Of all the contestants who got voted, what is the contestant number and name of the contestant who got least votes |
| Pred: SELECT T2.Contestant_Number, T1.Panther_Name FROM votes AS T1 JOIN contestants AS T2 ON T1.'s T1 Contestant_number = T 2.ContESTANT_Number ORDER BY COUNT(*) ASC LIMIT 1 |
| Gold: SELECT T1.contestant_number, T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number GROUP BY T1.contestant_number ORDER BY COUNT(*) ASC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [463] WRONG_COLUMNS | DB: voter_1 | EX: β |
| Q : How many contestants did not get voted |
| Pred: SELECT COUNT(*) FROM contestants WHERE NOT contestant_number IN (SELECT contestant_ number FROM votes) |
| Gold: SELECT COUNT(*) FROM contestants WHERE NOT contestant_number IN (SELECT contestant_number FROM votes) |
| Type: NESTED, AGGREGATION |
|
|
| [464] WRONG_TABLE | DB: voter_1 | EX: β |
| Q : What is the area code in which the most voters voted |
| Pred: SELECT T2.area_code FROM votes AS T1 JOIN area_code_state AS T2 ON T1.Area_code = T3.State GROUP BY T2.-Area_Code ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.area_code FROM area_code_state AS T1 JOIN votes AS T2 ON T1.state = T2.state GROUP BY T1.area_code ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [465] MISSING_WHERE | DB: voter_1 | EX: β |
| Q : What are the create dates, states, and phone numbers of the votes that were for the contestant named 'Tabatha Gehling' |
| Pred: SELECT T2.created, T1.state, T3.phone_number FROM contestants AS T1 JOIN votes AS T2 ON T1."contestant_number = T2."Tabatha Gehling" |
| Gold: SELECT T2.created, T2.state, T2.phone_number FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number WHERE T1.contestant_name = 'Tabatha Gehling' |
| Type: JOIN |
|
|
| [466] WRONG_TABLE | DB: voter_1 | EX: β |
| Q : List the area codes in which voters voted both for the contestant 'Tabatha Gehling' and the contestant 'Kelly Clauss' |
| Pred: SELECT T1.area_code FROM area_code_state AS T1 JOIN votes AS T2 ON T1."state = "USA" AND T2. contestant_name = "Tabatha Gehling" INTERSECT SELECT T1 (Area_code) FROM Area_Code_State AS T3 JOIN contestants AS T4 ON T3.Contestant_Number = T4.ContESTant_number WHERE T4." = "Kelly Clauss" |
| Gold: SELECT T3.area_code FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number JOIN area_code_state AS T3 ON T2.state = T3.state WHERE T1.contestant_name = 'Tabatha Gehling' INTERSECT SELECT T3.area_code FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number JOIN area_code_state AS T3 ON T2.state = T3.state WHERE T1.contestant_name = 'Kelly Clauss' |
| Type: JOIN |
|
|
| [467] EXTRA_JOIN | DB: voter_1 | EX: β |
| Q : Return the names of the contestants whose names contain the substring 'Al' |
| Pred: SELECT T2.Contestant_Name FROM contestants AS T1 JOIN votes AS T2 ON T1.ContESTant_Number = T 2.contestant-Number WHERE contestant_name LIKE '%Al%' |
| Gold: SELECT contestant_name FROM contestants WHERE contestant_name LIKE "%al%" |
| Type: SIMPLE |
|
|
| [468] OTHER | DB: world_1 | EX: β |
| Q : What are the names of all the countries that became independent after 1950 |
| Pred: SELECT name FROM country WHERE isofficial > 1950 |
| Gold: SELECT Name FROM country WHERE IndepYear > 1950 |
| Type: SIMPLE |
|
|
| [469] OTHER | DB: world_1 | EX: β |
| Q : How much surface area do the countires in the Carribean cover together |
| Pred: SELECT SUM(surfacearea) FROM country WHERE region = "Carribean" |
| Gold: SELECT SUM(SurfaceArea) FROM country WHERE Region = "Caribbean" |
| Type: AGGREGATION |
|
|
| [470] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Which region is the city Kabul located in |
| Pred: SELECT region FROM city WHERE name = 'Kabul' |
| Gold: SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = "Kabul" |
| Type: JOIN |
|
|
| [471] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What region is Kabul in |
| Pred: SELECT region FROM country WHERE name = 'Afghanistan' |
| Gold: SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = "Kabul" |
| Type: JOIN |
|
|
| [472] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Which language is the most popular in Aruba |
| Pred: SELECT language FROM country WHERE countrycode = 'Aruba' GROUP BY language ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" ORDER BY Percentage DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [473] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What language is predominantly spoken in Aruba |
| Pred: SELECT language FROM country WHERE countrycode = 'Aruba' |
| Gold: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" ORDER BY Percentage DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [474] OTHER | DB: world_1 | EX: β |
| Q : What are the population and life expectancies in Brazil |
| Pred: SELECT population, lifeexpectancy FROM country WHERE country = "Brazil" |
| Gold: SELECT Population, LifeExpectancy FROM country WHERE Name = "Brazil" |
| Type: SIMPLE |
|
|
| [475] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What are the region and population of Angola |
| Pred: SELECT region, population FROM country WHERE name = 'Angola' |
| Gold: SELECT Population, Region FROM country WHERE Name = "Angola" |
| Type: SIMPLE |
|
|
| [476] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What region does Angola belong to and what is its population |
| Pred: SELECT region, population FROM country WHERE name = 'Angola' |
| Gold: SELECT Population, Region FROM country WHERE Name = "Angola" |
| Type: SIMPLE |
|
|
| [477] OTHER | DB: world_1 | EX: β |
| Q : How long is the peopleβs average life expectancy in Central Africa |
| Pred: SELECT AVG(lifeexpectancy) FROM country WHERE continent = 'Central Africa' |
| Gold: SELECT AVG(LifeExpectancy) FROM country WHERE Region = "Central Africa" |
| Type: AGGREGATION |
|
|
| [478] OTHER | DB: world_1 | EX: β |
| Q : What is the total population and maximum GNP in Asia |
| Pred: SELECT SUM(population), MAX(GNp) FROM country WHERE region = 'Asia' |
| Gold: SELECT SUM(Population), MAX(GNP) FROM country WHERE Continent = "Asia" |
| Type: AGGREGATION |
|
|
| [479] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : How many people live in Asia, and what is the largest GNP among them |
| Pred: SELECT gnp FROM country WHERE region = 'Asia' GROUP BY region ORDER BY SUM(population) DESC LIMIT 1 |
| Gold: SELECT SUM(Population), MAX(GNP) FROM country WHERE Continent = "Asia" |
| Type: AGGREGATION |
|
|
| [480] OTHER | DB: world_1 | EX: β |
| Q : What is the average life expectancy in African countries that are republics |
| Pred: SELECT AVG(Lifeexpectancy) FROM country WHERE continent = "Africa" |
| Gold: SELECT AVG(LifeExpectancy) FROM country WHERE Continent = "Africa" AND GovernmentForm = "Republic" |
| Type: AGGREGATION |
|
|
| [481] OTHER | DB: world_1 | EX: β |
| Q : Give the average life expectancy for countries in Africa which are republics |
| Pred: SELECT AVG(Lifeexpectancy) FROM country WHERE continent = 'Africa' |
| Gold: SELECT AVG(LifeExpectancy) FROM country WHERE Continent = "Africa" AND GovernmentForm = "Republic" |
| Type: AGGREGATION |
|
|
| [482] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What is the total surface area of the continents Asia and Europe |
| Pred: SELECT SUM(surfacearea) FROM country WHERE continent = 'Asia' INTERSECT SELECT SUM(seaarea) from country WHERE region = 'Europe' |
| Gold: SELECT SUM(SurfaceArea) FROM country WHERE Continent = "Asia" OR Continent = "Europe" |
| Type: AGGREGATION |
|
|
| [483] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : How many people live in Gelderland district |
| Pred: SELECT COUNT(*) FROM city WHERE district = 'Gelderland' |
| Gold: SELECT SUM(Population) FROM city WHERE District = "Gelderland" |
| Type: AGGREGATION |
|
|
| [484] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What is the average GNP and total population in all nations whose government is US territory |
| Pred: SELECT AVG(gdp), SUM(population) FROM country WHERE governmentform = 'US' |
| Gold: SELECT AVG(GNP), SUM(population) FROM country WHERE GovernmentForm = "US Territory" |
| Type: AGGREGATION |
|
|
| [485] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : Give the mean GNP and total population of nations which are considered US territory |
| Pred: SELECT AVG(gdp), SUM(population) FROM country WHERE governmentform = 'US' |
| Gold: SELECT AVG(GNP), SUM(population) FROM country WHERE GovernmentForm = "US Territory" |
| Type: AGGREGATION |
|
|
| [486] WRONG_TABLE | DB: world_1 | EX: β |
| Q : How many unique languages are spoken in the world |
| Pred: SELECT COUNT(DISTINCT language) FROM country |
| Gold: SELECT COUNT(DISTINCT LANGUAGE) FROM countrylanguage |
| Type: AGGREGATION |
|
|
| [487] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What is the number of distinct languages used around the world |
| Pred: SELECT COUNT(DISTINCT language) FROM country |
| Gold: SELECT COUNT(DISTINCT LANGUAGE) FROM countrylanguage |
| Type: AGGREGATION |
|
|
| [488] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What is the total number of languages used in Aruba |
| Pred: SELECT COUNT(*) FROM country WHERE countrycode = 'Aruba' |
| Gold: SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" |
| Type: JOIN, AGGREGATION |
|
|
| [489] MISSING_JOIN | DB: world_1 | EX: β |
| Q : How many languages are spoken in Aruba |
| Pred: SELECT COUNT(*) FROM country WHERE language = 'Aruba' |
| Gold: SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" |
| Type: JOIN, AGGREGATION |
|
|
| [490] MISSING_JOIN | DB: world_1 | EX: β |
| Q : How many official languages does Afghanistan have |
| Pred: SELECT COUNT(*) FROM country WHERE isofficial = 'Afghanistan' |
| Gold: SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Afghanistan" AND IsOfficial = "T" |
| Type: JOIN, AGGREGATION |
|
|
| [491] MISSING_JOIN | DB: world_1 | EX: β |
| Q : How many official languages are spoken in Afghanistan |
| Pred: SELECT COUNT(*) FROM country WHERE isofficial = 'Afghanistan' |
| Gold: SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Afghanistan" AND IsOfficial = "T" |
| Type: JOIN, AGGREGATION |
|
|
| [492] OTHER | DB: world_1 | EX: β |
| Q : What is name of the country that speaks the largest number of languages |
| Pred: SELECT T1.name FROM country AS T1 JOIN countrylanguage AS T2 ON T2.code = T3.countrycode GROUP BY T2.'s language ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [493] OTHER | DB: world_1 | EX: β |
| Q : Give the name of the nation that uses the greatest amount of languages |
| Pred: SELECT t1.name FROM country AS t1 JOIN countrylanguage AS t2 ON t2.countrycode = t3.code GROUP BY t2.'surname ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [494] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Which continent has the most diverse languages |
| Pred: SELECT continent FROM country GROUP BY continent ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [495] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Which continent speaks the most languages |
| Pred: SELECT continent FROM country GROUP BY continent ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [496] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : How many countries speak both English and Dutch |
| Pred: SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.code = T2.countrycode WHERE T2 languages = 'english' INTERSECT SELECT COUNT(*) FROM country WHERE languages = "DISTINCT" |
| Gold: SELECT COUNT(*) FROM (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Dutch") |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [497] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What is the number of nations that use English and Dutch |
| Pred: SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.code = T2.countrycode WHERE T2 languages = 'english' INTERSECT SELECT COUNT(*) FROM country WHERE language = 'Dutch' |
| Gold: SELECT COUNT(*) FROM (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Dutch") |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [498] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What are the names of nations speak both English and French |
| Pred: SELECT name FROM country WHERE language = 'english' INTERSECT SELECT name FROMcountry WHERE language <> 'French' |
| Gold: SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "French" |
| Type: JOIN |
|
|
| [499] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Give the names of nations that speak both English and French |
| Pred: SELECT name FROM country WHERE language = 'english' INTERSECT SELECT name FROM Country WHERE language <> 'French' |
| Gold: SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "French" |
| Type: JOIN |
|
|
| [500] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What are the names of nations where both English and French are official languages |
| Pred: SELECT name FROM country WHERE language = 'english' INTERSECT SELECT name FROM Country WHERE language <> 'French' |
| Gold: SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "French" AND T2.IsOfficial = "T" |
| Type: JOIN |
|
|
| [501] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Give the names of countries with English and French as official languages |
| Pred: SELECT name FROM country WHERE language = 'english' INTERSECT SELECT name FROM Country WHERE language <> 'French' |
| Gold: SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "French" AND T2.IsOfficial = "T" |
| Type: JOIN |
|
|
| [502] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What is the number of distinct continents where Chinese is spoken |
| Pred: SELECT COUNT(DISTINCT continent) FROM country WHERE language = "Chinese" |
| Gold: SELECT COUNT(DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Chinese" |
| Type: JOIN, AGGREGATION |
|
|
| [503] MISSING_JOIN | DB: world_1 | EX: β |
| Q : How many continents speak Chinese |
| Pred: SELECT COUNT(*) FROM country WHERE language = "Chinese" |
| Gold: SELECT COUNT(DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Chinese" |
| Type: JOIN, AGGREGATION |
|
|
| [504] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What are the regions that use English or Dutch |
| Pred: SELECT region FROM country WHERE language = "english" OR language = 'Dutch' |
| Gold: SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" OR T2.Language = "Dutch" |
| Type: JOIN |
|
|
| [505] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Which regions speak Dutch or English |
| Pred: SELECT region FROM country WHERE language = 'Dutch' OR languages = 'english' |
| Gold: SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" OR T2.Language = "Dutch" |
| Type: JOIN |
|
|
| [506] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What are the countries where either English or Dutch is the official language |
| Pred: SELECT countrycode FROM country WHERE language = 'english' OR isofficial = 'Dutch' |
| Gold: SELECT t1.name FROM country AS t1 JOIN countrylanguage AS t2 ON t1.code = t2.countrycode WHERE t2.language = "english" AND isofficial = "t" UNION SELECT t1.name FROM country AS t1 JOIN countrylanguage AS t2 ON t1.code = t2.countrycode WHERE t2.language = "dutch" AND isofficial = "t" |
| Type: JOIN |
|
|
| [507] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Which countries have either English or Dutch as an official language |
| Pred: SELECT countrycode FROM country WHERE language = 'english' OR isofficial = 'Dutch' |
| Gold: SELECT * FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND IsOfficial = "T" UNION SELECT * FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Dutch" AND IsOfficial = "T" |
| Type: JOIN |
|
|
| [508] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Which language is the most popular on the Asian continent |
| Pred: SELECT language FROM country WHERE continent = 'Asian' GROUP BY language ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = "Asia" GROUP BY T2.Language ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [509] MISSING_WHERE | DB: world_1 | EX: β |
| Q : What is the language that is used by the largest number of Asian nations |
| Pred: SELECT t2.language FROM country AS t1 JOIN countrylanguage AS t2 ON t1.countrycode = t 2.code GROUP BY t2 language ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = "Asia" GROUP BY T2.Language ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [510] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Which languages are spoken by only one country in republic governments |
| Pred: SELECT language FROM country WHERE countrycode = " republic" GROUP BY language HAVING COUNT(*) = 1 |
| Gold: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = "Republic" GROUP BY T2.Language HAVING COUNT(*) = 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [511] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What languages are only used by a single country with a republic government |
| Pred: SELECT language FROM country WHERE governmentform = 'Republic' GROUP BY language HAVING COUNT(*) = 1 |
| Gold: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = "Republic" GROUP BY T2.Language HAVING COUNT(*) = 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [512] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Find the city with the largest population that uses English |
| Pred: SELECT name FROM city WHERE language = 'english' ORDER BY population DESC LIMIT 1 |
| Gold: SELECT T1.Name, T1.Population FROM city AS T1 JOIN countrylanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Language = "English" ORDER BY T1.Population DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [513] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What is the most populace city that speaks English |
| Pred: SELECT city FROM city WHERE language = 'english' GROUP BY city ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Name, T1.Population FROM city AS T1 JOIN countrylanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Language = "English" ORDER BY T1.Population DESC LIMIT 1 |
| Type: JOIN, ORDER_BY, LIMIT |
|
|
| [514] OTHER | DB: world_1 | EX: β |
| Q : Find the name, population and expected life length of asian country with the largest area |
| Pred: SELECT name, population, lifeexpectancy FROM country WHERE region = 'Asian' ORDER BY population DESC LIMIT 1 |
| Gold: SELECT Name, Population, LifeExpectancy FROM country WHERE Continent = "Asia" ORDER BY SurfaceArea DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [515] OTHER | DB: world_1 | EX: β |
| Q : What are the name, population, and life expectancy of the largest Asian country by land |
| Pred: SELECT name, population, lifeexpectancy FROM country WHERE continent = 'East Asian' ORDER BY population DESC LIMIT 1 |
| Gold: SELECT Name, Population, LifeExpectancy FROM country WHERE Continent = "Asia" ORDER BY SurfaceArea DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [516] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What is average life expectancy in the countries where English is not the official language |
| Pred: SELECT AVG(LifeExpectancy) FROM country WHERE language <> 'english' |
| Gold: SELECT AVG(LifeExpectancy) FROM country WHERE NOT Name IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T") |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [517] MISSING_JOIN | DB: world_1 | EX: β |
| Q : Give the mean life expectancy of countries in which English is not the official language |
| Pred: SELECT AVG(LifeExpectancy) FROM country WHERE language <> 'english' |
| Gold: SELECT AVG(LifeExpectancy) FROM country WHERE NOT Name IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T") |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [518] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What is the total number of people living in the nations that do not use English |
| Pred: SELECT SUM(population) FROM country WHERE language <> 'english' |
| Gold: SELECT SUM(Population) FROM country WHERE NOT Name IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English") |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [519] MISSING_JOIN | DB: world_1 | EX: β |
| Q : How many people live in countries that do not speak English |
| Pred: SELECT COUNT(*) FROM country WHERE language <> 'english' |
| Gold: SELECT SUM(Population) FROM country WHERE NOT Name IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English") |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [520] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What is the official language spoken in the country whose head of state is Beatrix |
| Pred: SELECT isofficial FROM country WHERE headofstate = 'Beatrix' |
| Gold: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = "Beatrix" AND T2.IsOfficial = "T" |
| Type: JOIN |
|
|
| [521] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What is the official language used in the country the name of whose head of state is Beatrix |
| Pred: SELECT t2.isofficial FROM country AS t1 JOIN countrylanguage AS t2 ON t1.countrycode = t 2.code WHERE headofstate = 'Beatrix' |
| Gold: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = "Beatrix" AND T2.IsOfficial = "T" |
| Type: JOIN |
|
|
| [522] MISSING_JOIN | DB: world_1 | EX: β |
| Q : What is the total number of unique official languages spoken in the countries that are founded before 1930 |
| Pred: SELECT COUNT(DISTINCT isofficial) FROM country WHERE countrycode < 1930 |
| Gold: SELECT COUNT(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE IndepYear < 1930 AND T2.IsOfficial = "T" |
| Type: JOIN, AGGREGATION |
|
|
| [523] MISSING_JOIN | DB: world_1 | EX: β |
| Q : For the countries founded before 1930, what is the total number of distinct official languages |
| Pred: SELECT COUNT(DISTINCT isofficial) FROM country WHERE birth < 1930 |
| Gold: SELECT COUNT(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE IndepYear < 1930 AND T2.IsOfficial = "T" |
| Type: JOIN, AGGREGATION |
|
|
| [524] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What are the countries that have greater surface area than any country in Europe |
| Pred: SELECT name FROM country WHERE surfacearea > (SELECT MAX(surfacearea) FROM country AS region = 'Europe') |
| Gold: SELECT Name FROM country WHERE SurfaceArea > (SELECT MIN(SurfaceArea) FROM country WHERE Continent = "Europe") |
| Type: NESTED, AGGREGATION |
|
|
| [525] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : Which countries have greater area than that of any country in Europe |
| Pred: SELECT name FROM country WHERE surfacearea > (SELECT MAX(surfacearea) FROM Country WHERE region = 'Europe') |
| Gold: SELECT Name FROM country WHERE SurfaceArea > (SELECT MIN(SurfaceArea) FROM country WHERE Continent = "Europe") |
| Type: NESTED, AGGREGATION |
|
|
| [526] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What are the African countries that have a population less than any country in Asia |
| Pred: SELECT continent FROM country WHERE population < (SELECT MIN(population) FROM country where region = 'Asia') |
| Gold: SELECT Name FROM country WHERE Continent = "Africa" AND population < (SELECT MAX(population) FROM country WHERE Continent = "Asia") |
| Type: NESTED, AGGREGATION |
|
|
| [527] OTHER | DB: world_1 | EX: β |
| Q : Which African countries have a smaller population than that of any country in Asia |
| Pred: SELECT name FROM country WHERE continent = 'Africa' AND population < (SELECT MIN(population) FROM country AS T1 WHERE region = 'Asia') |
| Gold: SELECT Name FROM country WHERE Continent = "Africa" AND population < (SELECT MIN(population) FROM country WHERE Continent = "Asia") |
| Type: NESTED, AGGREGATION |
|
|
| [528] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Which Asian countries have a population that is larger than any country in Africa |
| Pred: SELECT name FROM country WHERE population > (SELECT MAX(population) FROM population WHERE continent = 'Africa') AND countrycode = 'Asian' |
| Gold: SELECT Name FROM country WHERE Continent = "Asia" AND population > (SELECT MAX(population) FROM country WHERE Continent = "Africa") |
| Type: NESTED, AGGREGATION |
|
|
| [529] EXTRA_JOIN | DB: world_1 | EX: β |
| Q : What are the Asian countries which have a population larger than that of any country in Africa |
| Pred: SELECT T1.name FROM country AS T1 JOIN country AS t2 ON t1.code = t2.countrycode WHERE T2.population > (SELECT MAX(population) FROM country WHERE continent = 'Africa') |
| Gold: SELECT Name FROM country WHERE Continent = "Asia" AND population > (SELECT MIN(population) FROM country WHERE Continent = "Africa") |
| Type: NESTED, AGGREGATION |
|
|
| [530] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What are the country codes for countries that do not speak English |
| Pred: SELECT countrycode FROM country WHERE language <> 'english' |
| Gold: SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" |
| Type: SIMPLE |
|
|
| [531] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Return the country codes for countries that do not speak English |
| Pred: SELECT countrycode FROM country WHERE language <> 'english' |
| Gold: SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" |
| Type: SIMPLE |
|
|
| [532] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What are the country codes of countries where people use languages other than English |
| Pred: SELECT countrycode FROM country WHERE language <> 'english' |
| Gold: SELECT DISTINCT CountryCode FROM countrylanguage WHERE LANGUAGE <> "English" |
| Type: SIMPLE |
|
|
| [533] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Give the country codes for countries in which people speak langauges that are not English |
| Pred: SELECT countrycode FROM country WHERE language <> 'english' |
| Gold: SELECT DISTINCT CountryCode FROM countrylanguage WHERE LANGUAGE <> "English" |
| Type: SIMPLE |
|
|
| [534] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What are the codes of the countries that do not speak English and whose government forms are not Republic |
| Pred: SELECT countrycode FROM country WHERE language <> "english" AND governmentform <> 'Republic' |
| Gold: SELECT Code FROM country WHERE GovernmentForm <> "Republic" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" |
| Type: SIMPLE |
|
|
| [535] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Return the codes of countries that do not speak English and do not have Republics for governments |
| Pred: SELECT code FROM country WHERE language <> 'english' EXCEPT SELECT countrycode FROM country AS T1 JOIN government AS T2 ON T1.code = T2.Government |
| Gold: SELECT Code FROM country WHERE GovernmentForm <> "Republic" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" |
| Type: SIMPLE |
|
|
| [536] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Which cities are in European countries where English is not the official language |
| Pred: SELECT name FROM city WHERE countrycode = 'European' AND isofficial <> 'english' |
| Gold: SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode = T1.Code WHERE T1.Continent = 'Europe' AND NOT T1.Name IN (SELECT T3.Name FROM country AS T3 JOIN countrylanguage AS T4 ON T3.Code = T4.CountryCode WHERE T4.IsOfficial = 'T' AND T4.Language = 'English') |
| Type: JOIN, NESTED |
|
|
| [537] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What are the names of cities in Europe for which English is not the official language |
| Pred: SELECT name FROM city WHERE countrycode = 'Europe' AND isofficial <> 'english' |
| Gold: SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode = T1.Code WHERE T1.Continent = 'Europe' AND NOT T1.Name IN (SELECT T3.Name FROM country AS T3 JOIN countrylanguage AS T4 ON T3.Code = T4.CountryCode WHERE T4.IsOfficial = 'T' AND T4.Language = 'English') |
| Type: JOIN, NESTED |
|
|
| [538] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : Which unique cities are in Asian countries where Chinese is the official language |
| Pred: SELECT DISTINCT T2.name FROM country AS T1 JOIN city AS T2 ON T1.countrycode = T3.code JOIN countrylanguage AS T4 ON T2?CountryLanguage = T4.Countrycode WHERE T4?isofficial = 'Chinese' |
| Gold: SELECT DISTINCT t3.name FROM country AS t1 JOIN countrylanguage AS t2 ON t1.code = t2.countrycode JOIN city AS t3 ON t1.code = t3.countrycode WHERE t2.isofficial = 't' AND t2.language = 'chinese' AND t1.continent = "asia" |
| Type: JOIN |
|
|
| [539] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Return the different names of cities that are in Asia and for which Chinese is the official language |
| Pred: SELECT DISTINCT t1.name FROM city AS t1 JOIN countrylanguage AS t2 ON t2.countrycode = t3.code JOIN city AS T4 ON t1?id = t4.id WHERE T2.isofficial = 'China' |
| Gold: SELECT DISTINCT T3.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode JOIN city AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' AND T2.Language = 'Chinese' AND T1.Continent = "Asia" |
| Type: JOIN |
|
|
| [540] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What are the name, independence year, and surface area of the country with the smallest population |
| Pred: SELECT name, indepyear, surfacearea FROM country ORDER BY Population LIMIT 1 |
| Gold: SELECT Name, SurfaceArea, IndepYear FROM country ORDER BY Population LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [541] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : Give the name, year of independence, and surface area of the country that has the lowest population |
| Pred: SELECT name, indepyear, surfacearea FROM country ORDER BY Population LIMIT 1 |
| Gold: SELECT Name, SurfaceArea, IndepYear FROM country ORDER BY Population LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [542] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What are the population, name and leader of the country with the largest area |
| Pred: SELECT population, name, headofstate FROM country ORDER BY surfacearea DESC LIMIT 1 |
| Gold: SELECT Name, population, HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [543] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages |
| Pred: SELECT T2.name, COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.code = T 2.countrycode GROUP BY T1."countrycode" HAVING COUNT("*) >= 3 |
| Gold: SELECT COUNT(T2.Language), T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [544] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What are the names of countries that speak more than 2 languages, as well as how many languages they speak |
| Pred: SELECT name, COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.code = T2.countrycode GROUP BY T2.'s language HAVING COUNT(*) > 2 |
| Gold: SELECT COUNT(T2.Language), T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [545] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : How many cities in each district have a population that is above the average population across all cities |
| Pred: SELECT district, COUNT(*) FROM city WHERE population > (SELECT AVG(population) FROM city) GROUP BY district |
| Gold: SELECT COUNT(*), District FROM city WHERE Population > (SELECT AVG(Population) FROM city) GROUP BY District |
| Type: GROUP_BY, NESTED, AGGREGATION |
|
|
| [546] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : Find the government form name and total population for each government form whose average life expectancy is longer than 72 |
| Pred: SELECT governmentform, SUM(population) FROM country WHERE lifeexpectancy > 72 GROUP BY governmentform |
| Gold: SELECT SUM(Population), GovernmentForm FROM country GROUP BY GovernmentForm HAVING AVG(LifeExpectancy) > 72 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [547] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What are the different government forms and what is the total population of each for government forms that have an average life expectancy greater than 72 |
| Pred: SELECT SUM(Population), governmentform FROM city WHERE lifeexpectancy > 72 GROUP BY governmentform |
| Gold: SELECT SUM(Population), GovernmentForm FROM country GROUP BY GovernmentForm HAVING AVG(LifeExpectancy) > 72 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [548] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : Find the average life expectancy and total population for each continent where the average life expectancy is shorter than 72 |
| Pred: SELECT AVG(lifeexpectancy), SUM(population), continent FROM country GROUP BY continent HAVING AVG(LifeExpectancy) < 72 |
| Gold: SELECT SUM(Population), AVG(LifeExpectancy), Continent FROM country GROUP BY Continent HAVING AVG(LifeExpectancy) < 72 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [549] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What are the different continents and the total popuation and average life expectancy corresponding to each, for continents that have an average life expectancy less than 72 |
| Pred: SELECT continent, SUM(lifeexpectancy), AVG(life expectancy) FROM country GROUP BY continent |
| Gold: SELECT SUM(Population), AVG(LifeExpectancy), Continent FROM country GROUP BY Continent HAVING AVG(LifeExpectancy) < 72 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [550] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What are the names and areas of countries with the top 5 largest area |
| Pred: SELECT name, region FROM country ORDER BY surfacearea DESC LIMIT 5 |
| Gold: SELECT Name, SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5 |
| Type: ORDER_BY, LIMIT |
|
|
| [551] OTHER | DB: world_1 | EX: β |
| Q : Return the names and surface areas of the 5 largest countries |
| Pred: SELECT name, surfacearea FROM country ORDER BY population DESC LIMIT 5 |
| Gold: SELECT Name, SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5 |
| Type: ORDER_BY, LIMIT |
|
|
| [552] OTHER | DB: world_1 | EX: β |
| Q : What are the names of the nations with the 3 lowest populations |
| Pred: SELECT name FROM country ORDER BY population LIMIT 3 |
| Gold: SELECT Name FROM country ORDER BY Population ASC LIMIT 3 |
| Type: ORDER_BY, LIMIT |
|
|
| [553] OTHER | DB: world_1 | EX: β |
| Q : how many countries are in Asia |
| Pred: SELECT COUNT(*) FROM country WHERE region = 'Asia' |
| Gold: SELECT COUNT(*) FROM country WHERE continent = "Asia" |
| Type: AGGREGATION |
|
|
| [554] OTHER | DB: world_1 | EX: β |
| Q : What are the names of the countries that are in the continent of Europe and have a population of 80000 |
| Pred: SELECT name FROM country WHERE continent = 'Europe' AND population = 80000 |
| Gold: SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000" |
| Type: SIMPLE |
|
|
| [555] OTHER | DB: world_1 | EX: β |
| Q : Give the names of countries that are in Europe and have a population equal to 80000 |
| Pred: SELECT name FROM country WHERE continent = 'Europe' AND population = 80000 |
| Gold: SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000" |
| Type: SIMPLE |
|
|
| [556] WRONG_COLUMNS | DB: world_1 | EX: β |
| Q : What is the total population and average area of countries in the continent of North America whose area is bigger than 3000 |
| Pred: SELECT SUM(Population), AVG(Area) FROM country WHERE continent = 'North America' AND Area > 3000 |
| Gold: SELECT SUM(population), AVG(surfacearea) FROM country WHERE continent = "north america" AND surfacearea > 3000 |
| Type: AGGREGATION |
|
|
| [557] OTHER | DB: world_1 | EX: β |
| Q : Give the total population and average surface area corresponding to countries in North America that have a surface area greater than 3000 |
| Pred: SELECT SUM(population), AVG(surfacearea) FROM country WHERE region = 'North America' AND surfacearea > 3000 |
| Gold: SELECT SUM(population), AVG(surfacearea) FROM country WHERE continent = "north america" AND surfacearea > 3000 |
| Type: AGGREGATION |
|
|
| [558] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Which language is spoken by the largest number of countries |
| Pred: SELECT language FROM country GROUP BY language ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [559] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Give the language that is spoken in the most countries |
| Pred: SELECT language FROM country GROUP BY language ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [560] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What is the language spoken by the largest percentage of people in each country |
| Pred: SELECT language, percentage FROM country GROUP BY language ORDER BY SUM(percentage) DESC LIMIT 1 |
| Gold: SELECT LANGUAGE, CountryCode, MAX(Percentage) FROM countrylanguage GROUP BY CountryCode |
| Type: GROUP_BY, AGGREGATION |
|
|
| [561] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What are the country codes of the different countries, and what are the languages spoken by the greatest percentage of people for each |
| Pred: SELECT countrycode, percentage FROM country GROUP BY countrycode ORDER BY SUM(percentage) DESC LIMIT 1 |
| Gold: SELECT LANGUAGE, CountryCode, MAX(Percentage) FROM countrylanguage GROUP BY CountryCode |
| Type: GROUP_BY, AGGREGATION |
|
|
| [562] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What is the total number of countries where Spanish is spoken by the largest percentage of people |
| Pred: SELECT COUNT(*) FROM country WHERE language = 'Spanish' GROUP BY countrycode ORDER BY SUM(percentage) DESC LIMIT 1 |
| Gold: SELECT COUNT(*), MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode |
| Type: GROUP_BY, AGGREGATION |
|
|
| [563] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Count the number of countries for which Spanish is the predominantly spoken language |
| Pred: SELECT COUNT(*) FROM country WHERE language = 'Spanish' |
| Gold: SELECT COUNT(*), MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode |
| Type: GROUP_BY, AGGREGATION |
|
|
| [564] WRONG_TABLE | DB: world_1 | EX: β |
| Q : What are the codes of countries where Spanish is spoken by the largest percentage of people |
| Pred: SELECT countrycode FROM country WHERE language = 'Spanish' GROUP BY countrycode ORDER BY SUM(percentage) DESC LIMIT 1 |
| Gold: SELECT CountryCode, MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode |
| Type: GROUP_BY, AGGREGATION |
|
|
| [565] WRONG_TABLE | DB: world_1 | EX: β |
| Q : Return the codes of countries for which Spanish is the predominantly spoken language |
| Pred: SELECT countrycode FROM country WHERE language = 'Spanish' |
| Gold: SELECT CountryCode, MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode |
| Type: GROUP_BY, AGGREGATION |
|
|
| [566] OTHER | DB: orchestra | EX: β |
| Q : What are the names of conductors, ordered by age |
| Pred: SELECT name FROM conductor ORDER BY age |
| Gold: SELECT Name FROM conductor ORDER BY Age ASC |
| Type: ORDER_BY |
|
|
| [567] WRONG_TABLE | DB: orchestra | EX: β |
| Q : Show the names of conductors and the orchestras they have conducted |
| Pred: SELECT T2.Name, T3.Operating_Company FROM orchestra AS T1 JOIN conductor AS T2 ON T1.Orchestra_ID = T2.' |
| Gold: SELECT T1.Name, T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID |
| Type: JOIN |
|
|
| [568] WRONG_TABLE | DB: orchestra | EX: β |
| Q : What are the names of conductors as well as the corresonding orchestras that they have conducted |
| Pred: SELECT T2.Name, T3.Aircraft FROM orchestra AS T1 JOIN conductor AS T2 ON T1.Orchestra_ID = T 2.Conductor_ID |
| Gold: SELECT T1.Name, T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID |
| Type: JOIN |
|
|
| [569] WRONG_TABLE | DB: orchestra | EX: β |
| Q : Show the names of conductors that have conducted more than one orchestras |
| Pred: SELECT T2.Name FROM orchestra AS T1 JOIN conductor AS T2 ON T1.ORchestra_ID = T2.' GROUP BY T3.Name HAVING COUNT(*) > 1 |
| Gold: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [570] WRONG_TABLE | DB: orchestra | EX: β |
| Q : What are the names of conductors who have conducted at more than one orchestra |
| Pred: SELECT T2.name FROM orchestra AS T1 JOIN conductor AS T2 ON T1.orchestra_id = T 2. conductor_id GROUP BY T2 . conductor_ID HAVING COUNT(*) > 1 |
| Gold: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [571] WRONG_TABLE | DB: orchestra | EX: β |
| Q : Show the name of the conductor that has conducted the most number of orchestras |
| Pred: SELECT T2.name FROM orchestra AS T1 JOIN conductor AS T2 ON T1.orchestra_id = t2. conductor_id GROUP BY T2.'s conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [572] WRONG_TABLE | DB: orchestra | EX: β |
| Q : What is the name of the conductor who has conducted the most orchestras |
| Pred: SELECT T2.name FROM orchestra AS T1 JOIN conductor AS T2 ON T1.orchestra_id = T3. conductor_id GROUP BY T2.'s conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [573] WRONG_TABLE | DB: orchestra | EX: β |
| Q : Please show the name of the conductor that has conducted orchestras founded after 2008 |
| Pred: SELECT T2.name FROM orchestra AS T1 JOIN conductor AS T2 ON T1.ORchestra_ID = T3.ORChestra_Id WHERE T1:year_of_founded > 2008 |
| Gold: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008 |
| Type: JOIN |
|
|
| [574] WRONG_TABLE | DB: orchestra | EX: β |
| Q : What are the names of conductors who have conducted orchestras founded after the year 2008 |
| Pred: SELECT DISTINCT T2.name FROM orchestra AS T1 JOIN conductor AS T2 ON T1. conductor_id = T 2.conductor_id WHERE YEAR_of_founded > 2008 |
| Gold: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008 |
| Type: JOIN |
|
|
| [575] WRONG_COLUMNS | DB: orchestra | EX: β |
| Q : Please show the different record companies and the corresponding number of orchestras |
| Pred: SELECT DISTINCT Record_Company, COUNT(*) FROM orchestra GROUP BY record_company |
| Gold: SELECT Record_Company, COUNT(*) FROM orchestra GROUP BY Record_Company |
| Type: GROUP_BY, AGGREGATION |
|
|
| [576] MISSING_GROUP_BY | DB: orchestra | EX: β |
| Q : Please show the record formats of orchestras in ascending order of count |
| Pred: SELECT major_record_format FROM orchestra ORDER BY COUNT(*) ASC |
| Gold: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC |
| Type: GROUP_BY, ORDER_BY, AGGREGATION |
|
|
| [577] MISSING_GROUP_BY | DB: orchestra | EX: β |
| Q : What are the major record formats of orchestras, sorted by their frequency |
| Pred: SELECT major_record_format FROM orchestra ORDER BY COUNT(*) DESC |
| Gold: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC |
| Type: GROUP_BY, ORDER_BY, AGGREGATION |
|
|
| [578] WRONG_COLUMNS | DB: orchestra | EX: β |
| Q : List the record company shared by the most number of orchestras |
| Pred: SELECT record_company, share FROM orchestra GROUP BY orchestra ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [579] EXTRA_JOIN | DB: orchestra | EX: β |
| Q : What is the record company used by the greatest number of orchestras |
| Pred: SELECT t2.record_company FROM orchestra AS t1 JOIN conductor AS t2 ON t1.orchestra_id = T2. conductor_id GROUP BY t1./ orchestra ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [580] MISSING_WHERE | DB: orchestra | EX: β |
| Q : What are the orchestras that do not have any performances |
| Pred: SELECT orchestra FROM orchestra EXCEPT SELECT orchestra FROM performance |
| Gold: SELECT Orchestra FROM orchestra WHERE NOT Orchestra_ID IN (SELECT Orchestra_ID FROM performance) |
| Type: NESTED |
|
|
| [581] WRONG_COLUMNS | DB: orchestra | EX: β |
| Q : Show the record companies shared by orchestras founded before 2003 and after 2003 |
| Pred: SELECT record_company FROM orchestra WHERE year_of_founded < 2003 INTERSECT SELECT major_record_format from orchestra WHERE YEAR_Of_founded > 2003 |
| Gold: SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003 |
| Type: SIMPLE |
|
|
| [582] OTHER | DB: orchestra | EX: β |
| Q : What are the record companies that are used by both orchestras founded before 2003 and those founded after 2003 |
| Pred: SELECT Record_Company FROM orchestra WHERE YEAR_of_founded < 2003 INTERSECT SELECT Record_company FROM orchestra GROUP BY record_company HAVING COUNT(*) > 2003 |
| Gold: SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003 |
| Type: SIMPLE |
|
|
| [583] OTHER | DB: orchestra | EX: β |
| Q : Find the number of orchestras whose record format is "CD" or "DVD" |
| Pred: SELECT COUNT(*) FROM orchestra WHERE major_record_format = "DVD" |
| Gold: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = "CD" OR Major_Record_Format = "DVD" |
| Type: AGGREGATION |
|
|
| [584] OTHER | DB: orchestra | EX: β |
| Q : Count the number of orchestras that have CD or DVD as their record format |
| Pred: SELECT COUNT(*) FROM orchestra WHERE major_record_format = "DVD" |
| Gold: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = "CD" OR Major_Record_Format = "DVD" |
| Type: AGGREGATION |
|
|
| [585] WRONG_TABLE | DB: orchestra | EX: β |
| Q : Show the years in which orchestras that have given more than one performance are founded |
| Pred: SELECT T2.year_of_founded FROM performance AS T1 JOIN orchestra AS T2 ON T1.orchestra_id = T2.' GROUP BY T2 . orchestra_id HAVING COUNT(*) > 1 |
| Gold: SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [586] MISSING_JOIN | DB: orchestra | EX: β |
| Q : What are years of founding for orchestras that have had more than a single performance |
| Pred: SELECT year_of_founded FROM orchestra GROUP BY orchestra HAVING COUNT(*) > 1 |
| Gold: SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [587] WRONG_COLUMNS | DB: network_1 | EX: β |
| Q : Show all the grades of the high schoolers |
| Pred: SELECT DISTINCT grade FROM highschooler |
| Gold: SELECT grade FROM Highschooler |
| Type: SIMPLE |
|
|
| [588] WRONG_COLUMNS | DB: network_1 | EX: β |
| Q : What grade is Kyle in |
| Pred: SELECT DISTINCT grade FROM highschooler WHERE name = "Kyle" |
| Gold: SELECT grade FROM Highschooler WHERE name = "Kyle" |
| Type: SIMPLE |
|
|
| [589] WRONG_COLUMNS | DB: network_1 | EX: β |
| Q : Show the number of high schoolers for each grade |
| Pred: SELECT COUNT(*), grade FROM highschooler GROUP BY grade |
| Gold: SELECT grade, COUNT(*) FROM Highschooler GROUP BY grade |
| Type: GROUP_BY, AGGREGATION |
|
|
| [590] WRONG_COLUMNS | DB: network_1 | EX: β |
| Q : How many high schoolers are in each grade |
| Pred: SELECT COUNT(*), grade FROM highschooler GROUP BY grade |
| Gold: SELECT grade, COUNT(*) FROM Highschooler GROUP BY grade |
| Type: GROUP_BY, AGGREGATION |
|
|
| [591] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Which grade has the most high schoolers |
| Pred: SELECT grade FROM highschool GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT grade FROM Highschooler GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [592] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Return the grade that has the greatest number of high schoolers |
| Pred: SELECT grade FROM highschool GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT grade FROM Highschooler GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [593] WRONG_COLUMNS | DB: network_1 | EX: β |
| Q : Show me all grades that have at least 4 students |
| Pred: SELECT DISTINCT grade FROM highschooler GROUP BY grade HAVING COUNT(*) >= 4 |
| Gold: SELECT grade FROM Highschooler GROUP BY grade HAVING COUNT(*) >= 4 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [594] WRONG_COLUMNS | DB: network_1 | EX: β |
| Q : Which grades have 4 or more high schoolers |
| Pred: SELECT DISTINCT grade FROM highschooler GROUP BY grade HAVING COUNT(*) >= 4 |
| Gold: SELECT grade FROM Highschooler GROUP BY grade HAVING COUNT(*) >= 4 |
| Type: GROUP_BY, HAVING, AGGREGATION |
|
|
| [595] EXTRA_JOIN | DB: network_1 | EX: β |
| Q : Show the student IDs and numbers of friends corresponding to each |
| Pred: SELECT T2.student_id, COUNT(*) FROM friend AS T1 JOIN student AS T2 ON T1.friend_id = |
| Gold: SELECT student_id, COUNT(*) FROM Friend GROUP BY student_id |
| Type: GROUP_BY, AGGREGATION |
|
|
| [596] MISSING_GROUP_BY | DB: network_1 | EX: β |
| Q : How many friends does each student have |
| Pred: SELECT COUNT(DISTINCT friend_id) FROM friend |
| Gold: SELECT student_id, COUNT(*) FROM Friend GROUP BY student_id |
| Type: GROUP_BY, AGGREGATION |
|
|
| [597] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Show the names of high school students and their corresponding number of friends |
| Pred: SELECT T2.name, COUNT(*) FROM highschooler AS T1 JOIN friend AS T2 ON T1.id = T2.' |
| Gold: SELECT T2.name, COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [598] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What are the names of the high schoolers and how many friends does each have |
| Pred: SELECT T2.name, COUNT(DISTINCT T1.friend_id) FROM highschooler AS T1 JOIN friend AS T2 ON T3.id = |
| Gold: SELECT T2.name, COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [599] OTHER | DB: network_1 | EX: β |
| Q : What is the name of the high schooler who has the greatest number of friends |
| Pred: SELECT T2.name FROM friend AS T1 JOIN highschooler AS T2 ON T1.id = T2.' GROUP BY T1./ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [600] OTHER | DB: network_1 | EX: β |
| Q : Return the name of the high school student with the most friends |
| Pred: SELECT T2.name FROM friend AS T1 JOIN highschooler AS T2 ON T1.id = T3.student_id GROUP BY T1-student_ID ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [601] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Show the names of high schoolers who have at least 3 friends |
| Pred: SELECT name FROM highschooler GROUP BY name HAVING COUNT(*) >= 3 |
| Gold: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING COUNT(*) >= 3 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [602] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What are the names of high schoolers who have 3 or more friends |
| Pred: SELECT name FROM highschooler GROUP BY name HAVING COUNT(*) >= 3 |
| Gold: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING COUNT(*) >= 3 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [603] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Show the names of all of the high schooler Kyle's friends |
| Pred: SELECT T3.name FROM highschooler AS T1 JOIN friend AS T2 ON T1.id = T2.friend_id JOIN college AS T3 ON T4.year_er = T5.id WHERE T2.'s friend_id = 'Kyle' |
| Gold: SELECT T3.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id JOIN Highschooler AS T3 ON T1.friend_id = T3.id WHERE T2.name = "Kyle" |
| Type: JOIN |
|
|
| [604] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Return the names of friends of the high school student Kyle |
| Pred: SELECT DISTINCT T2.name FROM highschooler AS T1 JOIN friend AS T2 ON T1.id = T3.friend_id JOIN student AS T4 ON T4.student_ID = T1.'Kyle' |
| Gold: SELECT T3.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id JOIN Highschooler AS T3 ON T1.friend_id = T3.id WHERE T2.name = "Kyle" |
| Type: JOIN |
|
|
| [605] WRONG_TABLE | DB: network_1 | EX: β |
| Q : How many friends does the high school student Kyle have |
| Pred: SELECT COUNT(T2.friend_id) FROM highschooler AS T1 JOIN friend AS T2 ON T1.id = T2.highschooler JOIN student AS T3 ON T3.student_id = t2.id WHERE t1.name = 'Kyle' |
| Gold: SELECT COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" |
| Type: JOIN, AGGREGATION |
|
|
| [606] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Count the number of friends Kyle has |
| Pred: SELECT COUNT(DISTINCT friend_id) FROM highschooler WHERE name = 'Kyle' |
| Gold: SELECT COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" |
| Type: JOIN, AGGREGATION |
|
|
| [607] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Show ids of all students who do not have any friends |
| Pred: SELECT id FROM student EXCEPT SELECT student_id FROM friend |
| Gold: SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend |
| Type: SIMPLE |
|
|
| [608] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What are the ids of high school students who do not have friends |
| Pred: SELECT id FROM highschooler WHERE NOT id IN (SELECT student_id FROM friends) |
| Gold: SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend |
| Type: SIMPLE |
|
|
| [609] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Show names of all high school students who do not have any friends |
| Pred: SELECT name FROM highschooler WHERE NOT id IN (SELECT student_id FROM friends) |
| Gold: SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id |
| Type: JOIN |
|
|
| [610] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What are the names of students who have no friends |
| Pred: SELECT Name FROM student WHERE NOT Student_ID IN (SELECT Student_Id FROM friend) |
| Gold: SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id |
| Type: JOIN |
|
|
| [611] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Show the ids of high schoolers who have friends and are also liked by someone else |
| Pred: SELECT DISTINCT T1.id FROM highschooler AS T1 JOIN friends AS T2 ON TRUE JOIN likes AS T3 ON T2.id = T3.liked_id |
| Gold: SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes |
| Type: SIMPLE |
|
|
| [612] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What are the ids of students who both have friends and are liked |
| Pred: SELECT T1.student_id FROM Student_ID AS T1 JOIN Likes AS T2 ON TID = T2.liked_id |
| Gold: SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes |
| Type: SIMPLE |
|
|
| [613] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Show name of all students who have some friends and also are liked by someone else |
| Pred: SELECT T2.name FROM friend AS T1 JOIN student_id AS T2 ON T1.student_id = T 2.id JOIN likes AS T3 ON T3.friend_ID = T4.id |
| Gold: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id = T2.id |
| Type: JOIN |
|
|
| [614] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What are the names of high schoolers who both have friends and are liked |
| Pred: SELECT T2.name FROM friend AS T1 JOIN highschooler AS T2 ON T1.id = T2.'s friend_id INTERSECT SELECT name FROM highschoolER AS T3 JOIN likes AS T4 ON T3.ID = T4.ID |
| Gold: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id = T2.id |
| Type: JOIN |
|
|
| [615] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Count the number of likes for each student id |
| Pred: SELECT COUNT(*), T1.student_id FROM highschooler AS T1 JOIN likes AS T2 ON t1.id = T2. student_id GROUP BY T1.(*) |
| Gold: SELECT student_id, COUNT(*) FROM Likes GROUP BY student_id |
| Type: GROUP_BY, AGGREGATION |
|
|
| [616] EXTRA_JOIN | DB: network_1 | EX: β |
| Q : How many likes correspond to each student id |
| Pred: SELECT T2.student_id, COUNT(*) FROM likes AS T1 JOIN highschooler AS T2 ON T1.id = T2.' |
| Gold: SELECT student_id, COUNT(*) FROM Likes GROUP BY student_id |
| Type: GROUP_BY, AGGREGATION |
|
|
| [617] MISSING_GROUP_BY | DB: network_1 | EX: β |
| Q : Show the names of high schoolers who have likes, and numbers of likes for each |
| Pred: SELECT T2.name, T1.friend_id, COUNT(*) FROM likes AS T1 JOIN highschooler AS T2 ON t1.id = t2.highschooler |
| Gold: SELECT T2.name, COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [618] MISSING_GROUP_BY | DB: network_1 | EX: β |
| Q : What are the names of high schoolers who have likes, and how many likes does each have |
| Pred: SELECT T2.name, COUNT(*) FROM likes AS T1 JOIN highschooler AS T2 ON T1.id = T2.' |
| Gold: SELECT T2.name, COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [619] OTHER | DB: network_1 | EX: β |
| Q : What is the name of the high schooler who has the greatest number of likes |
| Pred: SELECT T2.name FROM likes AS T1 JOIN highschooler AS T2 ON T1.id = T2.' GROUP BY T3.id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [620] OTHER | DB: network_1 | EX: β |
| Q : Give the name of the student with the most likes |
| Pred: SELECT T2.name FROM likes AS T1 JOIN student AS T2 ON T1.student_id = T2.' GROUP BY T1.'s student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [621] MISSING_GROUP_BY | DB: network_1 | EX: β |
| Q : Show the names of students who have at least 2 likes |
| Pred: SELECT T2.name FROM likes AS T1 JOIN student_id AS T2 ON T1.student_id = T 2.id HAVING COUNT(*) >= 2 |
| Gold: SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [622] OTHER | DB: network_1 | EX: β |
| Q : What are the names of students who have 2 or more likes |
| Pred: SELECT T2.name FROM likes AS T1 JOIN student_id AS T2 ON T1.student_id = T 2.id GROUP BY T1/student_ID HAVING COUNT(*) >= 2 |
| Gold: SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [623] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Show the names of students who have a grade higher than 5 and have at least 2 friends |
| Pred: SELECT name FROM student WHERE grade > 5 INTERSECT SELECT T2.name FROM friend AS T1 JOIN student AS T2 ON T1.student_id = T 2 |
| Gold: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [624] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What are the names of high schoolers who have a grade of over 5 and have 2 or more friends |
| Pred: SELECT T2.name FROM friend AS T1 JOIN highschooler AS T2 ON T1.id = T2.' GROUP BY T1./ID HAVING COUNT(*) > 5 INTERSECT SELECT name FROM highschoolER WHERE grade > 5 |
| Gold: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [625] OTHER | DB: network_1 | EX: β |
| Q : How many likes does Kyle have |
| Pred: SELECT COUNT(*) FROM likes AS T1 JOIN highschooler AS T2 ON T1.id = T2.liked_id JOIN college AS T3 ON T4.schooler = T3.id WHERE name = 'Kyle' |
| Gold: SELECT COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" |
| Type: JOIN, AGGREGATION |
|
|
| [626] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Return the number of likes that the high schooler named Kyle has |
| Pred: SELECT COUNT(*) FROM highschooler AS T1 JOIN likes AS T2 ON T1.id = T2.liked_id WHERE t1.name = 'Kyle' |
| Gold: SELECT COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" |
| Type: JOIN, AGGREGATION |
|
|
| [627] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Find the average grade of all students who have some friends |
| Pred: SELECT AVG(T2.grade) FROM friend AS T1 JOIN student AS T2 ON T1.student_id = T2.id |
| Gold: SELECT AVG(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [628] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What is the average grade of students who have friends |
| Pred: SELECT AVG(T2.grade) FROM friend AS T1 JOIN student AS T2 ON T1.student_id = T2.id |
| Gold: SELECT AVG(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [629] WRONG_TABLE | DB: network_1 | EX: β |
| Q : Find the minimum grade of students who have no friends |
| Pred: SELECT MIN(grade) FROM student WHERE NOT id IN (SELECT student_id FROM friend) |
| Gold: SELECT MIN(grade) FROM Highschooler WHERE NOT id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [630] WRONG_TABLE | DB: network_1 | EX: β |
| Q : What is the lowest grade of students who do not have any friends |
| Pred: SELECT MIN(grade) FROM student WHERE NOT id IN (SELECT student_id FROM friends) |
| Gold: SELECT MIN(grade) FROM Highschooler WHERE NOT id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [631] OTHER | DB: dog_kennels | EX: β |
| Q : Which states have both owners and professionals living there |
| Pred: SELECT state FROM owners UNION SELECT state FROM professionals |
| Gold: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals |
| Type: SIMPLE |
|
|
| [632] OTHER | DB: dog_kennels | EX: β |
| Q : Find the states where both owners and professionals live |
| Pred: SELECT state FROM owners UNION SELECT state FROM professionals |
| Gold: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals |
| Type: SIMPLE |
|
|
| [633] OTHER | DB: dog_kennels | EX: β |
| Q : What is the average age of the dogs who have gone through any treatments |
| Pred: SELECT AVG(age) FROM dogs WHERE NOT owner_id IN (SELECT dog_id FROM treatments) |
| Gold: SELECT AVG(age) FROM Dogs WHERE dog_id IN (SELECT dog_id FROM Treatments) |
| Type: NESTED, AGGREGATION |
|
|
| [634] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Find the average age of the dogs who went through treatments |
| Pred: SELECT AVG(age) FROM dogs WHERE treatment_type_code = "treatment" |
| Gold: SELECT AVG(age) FROM Dogs WHERE dog_id IN (SELECT dog_id FROM Treatments) |
| Type: NESTED, AGGREGATION |
|
|
| [635] MISSING_GROUP_BY | DB: dog_kennels | EX: β |
| Q : Which professionals live in the state of Indiana or have done treatment on more than 2 treatments? List his or her id, last name and cell phone |
| Pred: SELECT T1.professional_id, T2.lose_name, T3.cell_number FROM professionals AS T1 JOIN treatments AS T2 ON T1.'s professional_id = T2.'or T1."state = "Indiana" UNION SELECT T4.professional-id, COUNT(*) FROM professionals as T4 JOIN treatment_types AS T5 ON T4/treatment_type_code = T5.treatment_Type_code JOIN dogs AS T6 ON T5/animal_id_ |
| Gold: SELECT professional_id, last_name, cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id, T1.last_name, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) > 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [636] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : Find the id, last name and cell phone of the professionals who live in the state of Indiana or have performed more than two treatments |
| Pred: SELECT professional_id, last_name, cell_number FROM professionals WHERE state = "Indiana" UNION SELECT T1.professional_id FROM professionals AS T1 JOIN treatments AS T2 ON T1."professional_ID = T2.service_id GROUP BY T1-professional_Id HAVING COUNT(*) > 2 |
| Gold: SELECT professional_id, last_name, cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id, T1.last_name, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) > 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [637] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Which dogs have not cost their owner more than 1000 for treatment ? List the dog names |
| Pred: SELECT name FROM dogs EXCEPT SELECT T2.name FROM dogs AS T1 JOIN treatments AS T2 ON T1.owner_id = T2.'scoop_id WHERE cost_of_treatment > 1000 |
| Gold: SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000) |
| Type: GROUP_BY, HAVING, NESTED, AGGREGATION |
|
|
| [638] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : What are the names of the dogs for which the owner has not spend more than 1000 for treatment |
| Pred: SELECT name FROM dogs EXCEPT SELECT T2.name FROM dogs AS T1 JOIN treatments AS T2 ON T1.owner_id = T2.' GROUP BY T1-owner_name HAVING COUNT(*) > 1000 |
| Gold: SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000) |
| Type: GROUP_BY, HAVING, NESTED, AGGREGATION |
|
|
| [639] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Which first names are used for professionals or owners but are not used as dog names |
| Pred: SELECT first_name FROM professionals UNION SELECT T1.first_name, T2.owner_id FROM professionals AS T1 JOIN dogs AS T2 ON T1.'s professional_id = T2.' |
| Gold: SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs |
| Type: SIMPLE |
|
|
| [640] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Find the first names that are used for professionals or owners but are not used as dog names |
| Pred: SELECT first_name FROM professionals UNION SELECT T1.first_name from professionals AS T1 JOIN owners AS T2 ON TRUE JOIN dogs AS T3 ON TRUE WHERE T2.role_code = "PROF" OR T3.owner_id = "DISTINCT dog" |
| Gold: SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs |
| Type: SIMPLE |
|
|
| [641] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : Which professional did not operate any treatment on dogs? List the professional's id, role and email |
| Pred: SELECT professional_id, role_code, email FROM professionals EXCEPT SELECT T1.professional_ID, T2.role_code |
| Gold: SELECT professional_id, role_code, email_address FROM Professionals EXCEPT SELECT T1.professional_id, T1.role_code, T1.email_address FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id |
| Type: JOIN |
|
|
| [642] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Give me the id, role and email of the professionals who did not perform any treatment on dogs |
| Pred: SELECT professional_id, role_code, email FROM professionals EXCEPT SELECT T2.professional_id FROM treatments AS T1 JOIN dogs AS T2 ON T1.treatment_type_code = T2.' |
| Gold: SELECT professional_id, role_code, email_address FROM Professionals EXCEPT SELECT T1.professional_id, T1.role_code, T1.email_address FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id |
| Type: JOIN |
|
|
| [643] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Which owner owns the most dogs? List the owner id, first name and last name |
| Pred: SELECT T1.owner_id, T2.first_name, COUNT(T2.last_name) FROM owners AS T1 JOIN dogs AS T2 ON TRUE GROUP BY owner_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.owner_id, T2.first_name, T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [644] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Return the owner id, first name and last name of the owner who has the most dogs |
| Pred: SELECT T1.owner_id, T2.first_name, COUNT(T2.last_name) FROM owners AS T1 JOIN dogs AS T2 ON TRUE GROUP BY owner_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.owner_id, T2.first_name, T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [645] MISSING_GROUP_BY | DB: dog_kennels | EX: β |
| Q : Which professionals have done at least two treatments? List the professional's id, role, and first name |
| Pred: SELECT T1.professional_id, T2.role_code, T3.first_name FROM professionals AS T1 JOIN treatments AS T2 ON T1.'s professional_id = T2.' |
| Gold: SELECT T1.professional_id, T1.role_code, T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [646] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : What are the id, role, and first name of the professionals who have performed two or more treatments |
| Pred: SELECT T1.professional_id, T2.role_code, T3.first_name FROM professionals AS T1 JOIN treatments AS T2 ON T1.'s professional_id = T2.' GROUP BY name HAVING COUNT(*) >= 2 |
| Gold: SELECT T1.professional_id, T1.role_code, T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [647] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : What is the name of the breed with the most dogs |
| Pred: SELECT T2.breed_name FROM dogs AS T1 JOIN breeds AS T2 ON T1.broned_code = COUNT(*) GROUP BY breed_code ORDER BY AVG(T1.population) DESC LIMIT 1 |
| Gold: SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [648] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Which breed do the most dogs have? Give me the breed name |
| Pred: SELECT T2.breed_name FROM dogs AS T1 JOIN breeds AS T2 ON T1.broned_code = COUNT(*) GROUP BY breed_code ORDER BY AVG(T1.weight) DESC LIMIT 1 |
| Gold: SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [649] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : Which owner has paid for the most treatments on his or her dogs? List the owner id and last name |
| Pred: SELECT T1.owner_id, T2.last_name FROM owners AS T1 JOIN treatments AS T2 ON T1.'owner_ID = T2.' dogs' GROUP BY owner_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT T1.owner_id, T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [650] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : Tell me the owner id and last name of the owner who spent the most on treatments of his or her dogs |
| Pred: SELECT T1.owner_id, T2.last_name FROM owners AS T1 JOIN dogs AS T2 ON T1.'owner_ID = T2.' dogs GROUP BY owner_id ORDER BY SUM(T1.cost_of_treatment) DESC LIMIT 1 |
| Gold: SELECT T1.owner_id, T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY COUNT(*) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [651] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : What is the description of the treatment type that costs the least money in total |
| Pred: SELECT treatment_type_description FROM treatment_types ORDER BY cost_of_treatment ASC LIMIT 1 |
| Gold: SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY SUM(cost_of_treatment) ASC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [652] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : Give me the description of the treatment type whose total cost is the lowest |
| Pred: SELECT treatment_type_description FROM treatment_types ORDER BY cost_of_treatment LIMIT 1 |
| Gold: SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY SUM(cost_of_treatment) ASC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [653] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Which owner has paid the largest amount of money in total for their dogs? Show the owner id and zip code |
| Pred: SELECT T2.owner_id, T1.zip_code FROM charges AS T1 JOIN owners AS T2 ON T1,owner_ID = T2.' GROUP BY owner_id ORDER BY SUM(T1.charge_amount) DESC LIMIT 1 |
| Gold: SELECT T1.owner_id, T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY SUM(T3.cost_of_treatment) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [654] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Find the owner id and zip code of the owner who spent the most money in total for his or her dogs |
| Pred: SELECT T2.owner_id, T1.zip_code FROM dogs AS T1 JOIN owners AS T2 ON T1,owner_ID = T2.' GROUP BY owner_id ORDER BY SUM(T1.charge_amount) DESC LIMIT 1 |
| Gold: SELECT T1.owner_id, T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY SUM(T3.cost_of_treatment) DESC LIMIT 1 |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, AGGREGATION |
|
|
| [655] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Which professionals have done at least two types of treatments? List the professional id and cell phone |
| Pred: SELECT T1.professional_id, T2.cell_number FROM treatments AS T1 JOIN professionals AS T2 ON T1."professional_ID = T2."treatment_type_code GROUP BY T1.(*) HAVING COUNT(*) >= 2 |
| Gold: SELECT T1.professional_id, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [656] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : Find the id and cell phone of the professionals who operate two or more types of treatments |
| Pred: SELECT T1.professional_id, T2.cell_number FROM professionals AS T1 JOIN treatments AS T2 ON T1."professional_ID = T2."treatment_type_code GROUP BY T1., professional_id HAVING COUNT(*) >= 2 |
| Gold: SELECT T1.professional_id, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) >= 2 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [657] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : What are the first name and last name of the professionals who have done treatment with cost below average |
| Pred: SELECT first_name, last_name FROM professionals AS T1 JOIN treatments AS T2 ON T1.professional_id = T2.service_id WHERE cost_of_treatment < average |
| Gold: SELECT DISTINCT T1.first_name, T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 ON TRUE WHERE cost_of_treatment < (SELECT AVG(cost_of_treatment) FROM Treatments) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [658] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : Which professionals have operated a treatment that costs less than the average? Give me theor first names and last names |
| Pred: SELECT first_name, last_name FROM professionals WHERE charge_amount < (SELECT AVG(cost_of_treatment) FROM treatments) |
| Gold: SELECT DISTINCT T1.first_name, T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 ON TRUE WHERE cost_of_treatment < (SELECT AVG(cost_of_treatment) FROM Treatments) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [659] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : List the date of each treatment, together with the first name of the professional who operated it |
| Pred: SELECT date_of_treatment, first_name FROM treatments AS T1 JOIN professionals AS T2 ON T1.professional_id = T2.director_id |
| Gold: SELECT T1.date_of_treatment, T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id |
| Type: JOIN |
|
|
| [660] OTHER | DB: dog_kennels | EX: β |
| Q : What are the date and the operating professional's first name of each treatment |
| Pred: SELECT T1.date_of_treatment, T2.first_name FROM treatments AS T1 JOIN professionals AS T2 ON TRUE JOIN treatment_types AS T3 ON T3.treatment_type_code = T4.professional_id |
| Gold: SELECT T1.date_of_treatment, T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id |
| Type: JOIN |
|
|
| [661] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : List the cost of each treatment and the corresponding treatment type description |
| Pred: SELECT cost_of_treatment, treatment_type_description FROM treatment_types |
| Gold: SELECT T1.cost_of_treatment, T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code |
| Type: JOIN |
|
|
| [662] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : What are the cost and treatment type description of each treatment |
| Pred: SELECT treatment_type_description, cost_of_treatment FROM treatment_types |
| Gold: SELECT T1.cost_of_treatment, T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code |
| Type: JOIN |
|
|
| [663] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : List each owner's first name, last name, and the size of his for her dog |
| Pred: SELECT DISTINCT T1.first_name, T2.last_name , T1:size_code FROM owners AS T1 JOIN dogs AS T2 ON T1_owner_id = T2.' |
| Gold: SELECT T1.first_name, T1.last_name, T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id |
| Type: JOIN |
|
|
| [664] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : What are each owner's first name, last name, and the size of their dog |
| Pred: SELECT DISTINCT T1.first_name, T2.last_name , T1, T1., sizes.size_code FROM owners AS T1 JOIN dogs AS T2 ON TRUE JOIN cats AS T3 ON T1" = T3.owner_id |
| Gold: SELECT T1.first_name, T1.last_name, T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id |
| Type: JOIN |
|
|
| [665] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : List pairs of the owner's first name and the dogs's name |
| Pred: SELECT first_name, last_name FROM owners UNION SELECT dogs FROM dogs |
| Gold: SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id |
| Type: JOIN |
|
|
| [666] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : What are each owner's first name and their dogs's name |
| Pred: SELECT first_name, last_name FROM owners WHERE dogs = 1 |
| Gold: SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id |
| Type: JOIN |
|
|
| [667] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : List the names of the dogs of the rarest breed and the treatment dates of them |
| Pred: SELECT name, date_of_treatment FROM dogs ORDER BY breed_name ASC LIMIT 1 |
| Gold: SELECT T1.name, T2.date_of_treatment FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id WHERE T1.breed_code = (SELECT breed_code FROM Dogs GROUP BY breed_code ORDER BY COUNT(*) ASC LIMIT 1) |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, NESTED, AGGREGATION |
|
|
| [668] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : Which dogs are of the rarest breed? Show their names and treatment dates |
| Pred: SELECT name, date_of_treatment FROM dogs GROUP BY breed_code ORDER BY COUNT(*) ASC LIMIT 1 |
| Gold: SELECT T1.name, T2.date_of_treatment FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id WHERE T1.breed_code = (SELECT breed_code FROM Dogs GROUP BY breed_code ORDER BY COUNT(*) ASC LIMIT 1) |
| Type: JOIN, GROUP_BY, ORDER_BY, LIMIT, NESTED, AGGREGATION |
|
|
| [669] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Which dogs are owned by someone who lives in Virginia? List the owner's first name and the dog's name |
| Pred: SELECT first_name, last_name FROM dogs WHERE state = "Virginia" |
| Gold: SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia' |
| Type: JOIN |
|
|
| [670] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : Find the first names of owners living in Virginia and the names of dogs they own |
| Pred: SELECT first_name, last_name FROM owners WHERE state = "Virginia" AND dogs = 1 |
| Gold: SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia' |
| Type: JOIN |
|
|
| [671] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : What are the arriving date and the departing date of the dogs who have gone through a treatment |
| Pred: SELECT date_arrived, date_departed FROM dogs WHERE treatment_type_code = "treatment" |
| Gold: SELECT DISTINCT T1.date_arrived, T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id |
| Type: JOIN |
|
|
| [672] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Find the arriving date and the departing date of the dogs that received a treatment |
| Pred: SELECT date_arrived, date_departed FROM treatments |
| Gold: SELECT DISTINCT T1.date_arrived, T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id |
| Type: JOIN |
|
|
| [673] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : List the last name of the owner owning the youngest dog |
| Pred: SELECT last_name FROM owners WHERE age = (SELECT MIN(age) FROM dogs) |
| Gold: SELECT T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.age = (SELECT MAX(age) FROM Dogs) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [674] MISSING_JOIN | DB: dog_kennels | EX: β |
| Q : Who owns the youngest dog? Give me his or her last name |
| Pred: SELECT last_name FROM owners WHERE age = (SELECT MIN(age) FROM dogs) |
| Gold: SELECT T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.age = (SELECT MAX(age) FROM Dogs) |
| Type: JOIN, NESTED, AGGREGATION |
|
|
| [675] OTHER | DB: dog_kennels | EX: β |
| Q : List the emails of the professionals who live in the state of Hawaii or the state of Wisconsin |
| Pred: SELECT email_address FROM professionals WHERE city = "Hawaii" OR state = "Wisconsin" |
| Gold: SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin' |
| Type: SIMPLE |
|
|
| [676] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : What are the emails of the professionals living in either the state of Hawaii or the state of Wisconsin |
| Pred: SELECT email_address FROM professionals WHERE state = "Hawaii" UNION SELECT home_phone, state_code FROM professionals GROUP BY state HAVING COUNT(*) = 1 |
| Gold: SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin' |
| Type: SIMPLE |
|
|
| [677] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : How many dogs went through any treatments |
| Pred: SELECT COUNT(*) FROM treatments |
| Gold: SELECT COUNT(DISTINCT dog_id) FROM Treatments |
| Type: AGGREGATION |
|
|
| [678] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : Count the number of dogs that went through a treatment |
| Pred: SELECT COUNT(*) FROM treatments |
| Gold: SELECT COUNT(DISTINCT dog_id) FROM Treatments |
| Type: AGGREGATION |
|
|
| [679] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : Find the number of professionals who have ever treated dogs |
| Pred: SELECT COUNT(*) FROM professionals WHERE role_code = "doctor" |
| Gold: SELECT COUNT(DISTINCT professional_id) FROM Treatments |
| Type: AGGREGATION |
|
|
| [680] EXTRA_JOIN | DB: dog_kennels | EX: β |
| Q : Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email |
| Pred: SELECT DISTINCT T1.first_name, last_name , T2.email_address FROM owners AS T1 JOIN dogs AS T2 ON T1.'sowner_id = T2.'sNorth' |
| Gold: SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%' |
| Type: SIMPLE |
|
|
| [681] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : Return the first name, last name and email of the owners living in a state whose name contains the substring 'North' |
| Pred: SELECT DISTINCT first_name, last_name , email_address FROM owners WHERE state LIKE '%North%' |
| Gold: SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%' |
| Type: SIMPLE |
|
|
| [682] MISSING_ORDER_BY | DB: dog_kennels | EX: β |
| Q : How much does the most recent treatment cost |
| Pred: SELECT MAX(cost_of_treatment) FROM treatments |
| Gold: SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [683] MISSING_ORDER_BY | DB: dog_kennels | EX: β |
| Q : Show me the cost of the most recently performed treatment |
| Pred: SELECT MAX(cost_of_treatment) FROM treatments |
| Gold: SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1 |
| Type: ORDER_BY, LIMIT |
|
|
| [684] OTHER | DB: dog_kennels | EX: β |
| Q : How many dogs have not gone through any treatment |
| Pred: SELECT COUNT(*) FROM dogs WHERE NOT owner_id IN (SELECT dog_id FROM treatments) |
| Gold: SELECT COUNT(*) FROM Dogs WHERE NOT dog_id IN (SELECT dog_id FROM Treatments) |
| Type: NESTED, AGGREGATION |
|
|
| [685] OTHER | DB: dog_kennels | EX: β |
| Q : Tell me the number of dogs that have not received any treatment |
| Pred: SELECT COUNT(*) FROM dogs WHERE NOT owner_id IN (SELECT dog_id FROM treatments) |
| Gold: SELECT COUNT(*) FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments) |
| Type: NESTED, AGGREGATION |
|
|
| [686] OTHER | DB: dog_kennels | EX: β |
| Q : How many owners temporarily do not have any dogs |
| Pred: SELECT COUNT(*) FROM owners WHERE NOT owned_id IN (SELECT owner_id FROM dogs) |
| Gold: SELECT COUNT(*) FROM Owners WHERE NOT owner_id IN (SELECT owner_id FROM Dogs) |
| Type: NESTED, AGGREGATION |
|
|
| [687] OTHER | DB: dog_kennels | EX: β |
| Q : Find the number of owners who do not own any dogs at this moment |
| Pred: SELECT COUNT(*) FROM owners WHERE NOTowner_id IN (SELECT owner_id FROM dogs) |
| Gold: SELECT COUNT(*) FROM Owners WHERE NOT owner_id IN (SELECT owner_id FROM Dogs) |
| Type: NESTED, AGGREGATION |
|
|
| [688] EXTRA_JOIN | DB: dog_kennels | EX: β |
| Q : How many professionals did not operate any treatment on dogs |
| Pred: SELECT COUNT(DISTINCT professional_id) FROM professionals WHERE NOT role_code IN (SELECT T1.professional_id FROM treatments AS T1 JOIN dogs AS T2 ON TRUE WHERE T2.dog_id = 1) |
| Gold: SELECT COUNT(*) FROM Professionals WHERE NOT professional_id IN (SELECT professional_id FROM Treatments) |
| Type: NESTED, AGGREGATION |
|
|
| [689] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : List the dog name, age and weight of the dogs who have been abandoned? 1 stands for yes, and 0 stands for no |
| Pred: SELECT name, age, weight FROM dogs WHERE abandoned_yn = 1 1 INTERSECT SELECT name, ages,weight FROM dogs GROUP BY name |
| Gold: SELECT name, age, weight FROM Dogs WHERE abandoned_yn = 1 |
| Type: SIMPLE |
|
|
| [690] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : What is the age of the oldest dog |
| Pred: SELECT age FROM dogs ORDER BY date_of_birth DESC LIMIT 1 |
| Gold: SELECT MAX(age) FROM Dogs |
| Type: AGGREGATION |
|
|
| [691] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : Tell me the age of the oldest dog |
| Pred: SELECT age FROM dogs ORDER BY date_of_birth LIMIT 1 |
| Gold: SELECT MAX(age) FROM Dogs |
| Type: AGGREGATION |
|
|
| [692] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : How much does each charge type costs? List both charge type and amount |
| Pred: SELECT charge_type, charge_amount FROM CHARACTERISTICS |
| Gold: SELECT charge_type, charge_amount FROM Charges |
| Type: SIMPLE |
|
|
| [693] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : List each charge type and its amount |
| Pred: SELECT charge_type, charge_amount FROM CHARACTERISTICS |
| Gold: SELECT charge_type, charge_amount FROM Charges |
| Type: SIMPLE |
|
|
| [694] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : How much does the most expensive charge type costs |
| Pred: SELECT charge_amount FROM CHARACTERISTICS GROUP BY charge_type ORDER BY COUNT(*) DESC LIMIT 1 |
| Gold: SELECT MAX(charge_amount) FROM Charges |
| Type: AGGREGATION |
|
|
| [695] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : What is the charge amount of the most expensive charge type |
| Pred: SELECT charge_amount FROM CHARACTERISTICS GROUP BY charge_type ORDER BY SUM(charge_amount) DESC LIMIT 1 |
| Gold: SELECT MAX(charge_amount) FROM Charges |
| Type: AGGREGATION |
|
|
| [696] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : List the email, cell phone and home phone of all the professionals |
| Pred: SELECT email_address, cell_phone, home_phone FROM professionals |
| Gold: SELECT email_address, cell_number, home_phone FROM professionals |
| Type: SIMPLE |
|
|
| [697] WRONG_COLUMNS | DB: dog_kennels | EX: β |
| Q : What are the email, cell phone and home phone of each professional |
| Pred: SELECT email_address, cell_phone, home_phone FROM professionals |
| Gold: SELECT email_address, cell_number, home_phone FROM professionals |
| Type: SIMPLE |
|
|
| [698] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : What are all the possible breed type and size type combinations |
| Pred: SELECT DISTINCT breed_code, size_code FROM breeds |
| Gold: SELECT DISTINCT breed_code, size_code FROM dogs |
| Type: SIMPLE |
|
|
| [699] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : List the first name of all the professionals along with the description of the treatment they have done |
| Pred: SELECT T2.first_name, T3.last_name FROM treatments AS T1 JOIN professionals AS T2 ON T1.professional_id = T2.' |
| Gold: SELECT DISTINCT T1.first_name, T3.treatment_type_description FROM professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id JOIN Treatment_types AS T3 ON T2.treatment_type_code = T3.treatment_type_code |
| Type: JOIN |
|
|
| [700] WRONG_TABLE | DB: dog_kennels | EX: β |
| Q : What are each professional's first name and description of the treatment they have performed |
| Pred: SELECT T1.first_name, T2.treatment_type_description FROM treatment_types AS T1 JOIN professionals AS T2 ON TRUE JOIN treatments AS T3 ON T3.professional_id = T2." |
| Gold: SELECT DISTINCT T1.first_name, T3.treatment_type_description FROM professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id JOIN Treatment_types AS T3 ON T2.treatment_type_code = T3.treatment_type_code |
| Type: JOIN |
|
|
| [701] OTHER | DB: singer | EX: β |
| Q : What are the names of the singers who are not French citizens |
| Pred: SELECT Name FROM singer WHERE Citizenship <> "French" |
| Gold: SELECT Name FROM singer WHERE Citizenship <> "France" |
| Type: SIMPLE |
|
|
| [702] MISSING_JOIN | DB: singer | EX: β |
| Q : Show titles of songs and names of singers |
| Pred: SELECT Title, Name FROM singer |
| Gold: SELECT T2.Title, T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID |
| Type: JOIN |
|
|
| [703] WRONG_TABLE | DB: singer | EX: β |
| Q : What are the song titles and singer names |
| Pred: SELECT title, singer_id FROM song |
| Gold: SELECT T2.Title, T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID |
| Type: JOIN |
|
|
| [704] WRONG_TABLE | DB: singer | EX: β |
| Q : Show distinct names of singers that have songs with sales more than 300000 |
| Pred: SELECT DISTINCT T2.Name FROM song AS T1 JOIN singer AS T2 ON T1.Singer_ID = T2.'singer_id WHERE Sales > 300000 |
| Gold: SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000 |
| Type: JOIN |
|
|
| [705] WRONG_TABLE | DB: singer | EX: β |
| Q : what are the different names of the singers that have sales more than 300000 |
| Pred: SELECT DISTINCT T2.Name FROM song AS T1 JOIN singer AS T2 ON T1.Singer_ID = T2.'singer_id WHERE Sales > 300000 |
| Gold: SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000 |
| Type: JOIN |
|
|
| [706] MISSING_JOIN | DB: singer | EX: β |
| Q : Show the names of singers that have more than one song |
| Pred: SELECT Name FROM singer GROUP BY Name HAVING COUNT(*) > 1 |
| Gold: SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [707] MISSING_JOIN | DB: singer | EX: β |
| Q : What are the names of the singers that have more than one songs |
| Pred: SELECT Name FROM singer GROUP BY Name HAVING COUNT(*) > 1 |
| Gold: SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*) > 1 |
| Type: JOIN, GROUP_BY, HAVING, AGGREGATION |
|
|
| [708] WRONG_TABLE | DB: singer | EX: β |
| Q : Show the names of singers and the total sales of their songs |
| Pred: SELECT T2.Name, SUM(T1.Sales) FROM song AS T1 JOIN singer AS T2 ON T1.singer_id = T 2.Singer_ID |
| Gold: SELECT T1.Name, SUM(T2.Sales) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [709] WRONG_TABLE | DB: singer | EX: β |
| Q : For each singer name, what is the total sales for their songs |
| Pred: SELECT SUM(T1.sales), T2.name FROM song AS T1 JOIN singer AS T2 ON T1.Singer_ID = |
| Gold: SELECT T1.Name, SUM(T2.Sales) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name |
| Type: JOIN, GROUP_BY, AGGREGATION |
|
|
| [710] WRONG_TABLE | DB: singer | EX: β |
| Q : Show the citizenship shared by singers with birth year before 1945 and after 1955 |
| Pred: SELECT Citizenship FROM singer WHERE Birth_year < 1945 INTERSECT SELECT Citizenship FROM singers WHERE birth_year > 1955 |
| Gold: SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955 |
| Type: SIMPLE |
|
|
| [711] WRONG_TABLE | DB: singer | EX: β |
| Q : What are the citizenships that are shared by singers with a birth year before 1945 and after 1955 |
| Pred: SELECT Citizenship FROM singer WHERE Birth_year < 1945 INTERSECT SELECT Citizenship FROM singers WHERE birth_year > 1955 |
| Gold: SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955 |
| Type: SIMPLE |
|
|
| [712] WRONG_TABLE | DB: real_estate_properties | EX: β |
| Q : What is the feature type name of feature AirCon |
| Pred: SELECT feature_type_name FROM Ref_Feature_Types WHERE feature_name = "AirCon" |
| Gold: SELECT T2.feature_type_name FROM Other_Available_Features AS T1 JOIN Ref_Feature_Types AS T2 ON T1.feature_type_code = T2.feature_type_code WHERE T1.feature_name = "AirCon" |
| Type: JOIN |
|
|
| [713] MISSING_JOIN | DB: real_estate_properties | EX: β |
| Q : Show the property type descriptions of properties belonging to that code |
| Pred: SELECT property_type_description FROM properties |
| Gold: SELECT T2.property_type_description FROM Properties AS T1 JOIN Ref_Property_Types AS T2 ON T1.property_type_code = T2.property_type_code GROUP BY T1.property_type_code |
| Type: JOIN, GROUP_BY |
|
|
| [714] OTHER | DB: real_estate_properties | EX: β |
| Q : What are the names of properties that are either houses or apartments with more than 1 room |
| Pred: SELECT property_name FROM properties WHERE property_address = 'Houses' OR room_count > 1 |
| Gold: SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1 |
| Type: SIMPLE |
|
|
|
|