{"qid": "test_0000", "split": "test", "db_id": "orchestra", "question": "Return the maximum and minimum shares for performances that do not have the type \"Live final\".", "gold_sql": "SELECT max(SHARE) , min(SHARE) FROM performance WHERE TYPE != \"Live final\"", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0001", "split": "test", "db_id": "network_1", "question": "Return the grade that has the greatest number of high schoolers.", "gold_sql": "SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0002", "split": "test", "db_id": "car_1", "question": "Find the make and production time of the cars that were produced in the earliest year?", "gold_sql": "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);", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0003", "split": "test", "db_id": "world_1", "question": "What are the regions that use English or Dutch?", "gold_sql": "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\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0004", "split": "test", "db_id": "tvshow", "question": "What are all of the episodes ordered by ratings?", "gold_sql": "SELECT Episode FROM TV_series ORDER BY rating", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0005", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the different document ids along with the number of paragraphs corresponding to each, ordered by id.", "gold_sql": "SELECT document_id , count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0006", "split": "test", "db_id": "flight_2", "question": "What country is Jetblue Airways affiliated with?", "gold_sql": "SELECT Country FROM AIRLINES WHERE Airline = \"JetBlue Airways\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0007", "split": "test", "db_id": "poker_player", "question": "What are the names of people who do not play poker?", "gold_sql": "SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM poker_player)", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0008", "split": "test", "db_id": "world_1", "question": "Which languages are spoken by only one country in republic governments?", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0009", "split": "test", "db_id": "student_transcripts_tracking", "question": "Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id.", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0010", "split": "test", "db_id": "network_1", "question": "Find the average grade of all students who have some friends.", "gold_sql": "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)", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0011", "split": "test", "db_id": "dog_kennels", "question": "Which first names are used for professionals or owners but are not used as dog names?", "gold_sql": "SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0012", "split": "test", "db_id": "orchestra", "question": "What is the average attendance of shows?", "gold_sql": "SELECT avg(Attendance) FROM SHOW", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0013", "split": "test", "db_id": "museum_visit", "question": "What are the opening year and staff number of the museum named Plaza Museum?", "gold_sql": "SELECT Num_of_Staff , Open_Year FROM museum WHERE name = 'Plaza Museum'", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0014", "split": "test", "db_id": "car_1", "question": "What are the names and ids of all countries with at least one car maker?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0015", "split": "test", "db_id": "dog_kennels", "question": "Tell me the owner id and last name of the owner who spent the most on treatments of his or her dogs.", "gold_sql": "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", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0016", "split": "test", "db_id": "car_1", "question": "What model has the most different versions?", "gold_sql": "SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY count(*) DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0017", "split": "test", "db_id": "tvshow", "question": "find the package option of the tv channel that do not have any cartoon directed by Ben Jones.", "gold_sql": "SELECT package_option FROM TV_Channel WHERE id NOT IN (SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones')", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0018", "split": "test", "db_id": "car_1", "question": "What is the smallest weight of the car produced with 8 cylinders on 1974 ?", "gold_sql": "select min(weight) from cars_data where cylinders = 8 and year = 1974", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0019", "split": "test", "db_id": "dog_kennels", "question": "Find the distinct breed type and size type combinations for dogs.", "gold_sql": "SELECT DISTINCT breed_code , size_code FROM dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0020", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Count the number of documents.", "gold_sql": "SELECT count(*) FROM Documents", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0021", "split": "test", "db_id": "employee_hire_evaluation", "question": "How many employees are there?", "gold_sql": "SELECT count(*) FROM employee", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0022", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the type codes and descriptions for all template types?", "gold_sql": "SELECT template_type_code , template_type_description FROM Ref_template_types", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0023", "split": "test", "db_id": "dog_kennels", "question": "Which professionals live in a city containing the substring 'West'? List his or her role, street, city and state.", "gold_sql": "SELECT role_code , street , city , state FROM professionals WHERE city LIKE '%West%'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0024", "split": "test", "db_id": "wta_1", "question": "How many players are there for each hand type?", "gold_sql": "SELECT count(*) , hand FROM players GROUP BY hand", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0025", "split": "test", "db_id": "poker_player", "question": "Return the nationalities for which there are two or more people.", "gold_sql": "SELECT Nationality FROM people GROUP BY Nationality HAVING COUNT(*) >= 2", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0026", "split": "test", "db_id": "flight_2", "question": "Find all airlines that have at least 10 flights.", "gold_sql": "SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0027", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers whose courses have not been arranged?", "gold_sql": "SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0028", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show ids for all templates not used by any document.", "gold_sql": "SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0029", "split": "test", "db_id": "pets_1", "question": "Find the weight of the youngest dog.", "gold_sql": "SELECT weight FROM pets ORDER BY pet_age LIMIT 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0030", "split": "test", "db_id": "student_transcripts_tracking", "question": "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?", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0031", "split": "test", "db_id": "course_teach", "question": "List the names of teachers in ascending order of age.", "gold_sql": "SELECT Name FROM teacher ORDER BY Age ASC", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0032", "split": "test", "db_id": "tvshow", "question": "What is the produdction code and channel of the most recent cartoon ?", "gold_sql": "select production_code , channel from cartoon order by original_air_date desc limit 1", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0033", "split": "test", "db_id": "employee_hire_evaluation", "question": "find the minimum and maximum number of products of all stores.", "gold_sql": "SELECT min(Number_products) , max(Number_products) FROM shop", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0034", "split": "test", "db_id": "car_1", "question": "What is the model for the car with a weight smaller than the average?", "gold_sql": "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)", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0035", "split": "test", "db_id": "world_1", "question": "How many people live in countries that do not speak English?", "gold_sql": "SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0036", "split": "test", "db_id": "course_teach", "question": "Show names of teachers and the number of courses they teach.", "gold_sql": "SELECT T2.Name , COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0037", "split": "test", "db_id": "orchestra", "question": "How many different nationalities do conductors have?", "gold_sql": "SELECT count(DISTINCT Nationality) FROM conductor", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0038", "split": "test", "db_id": "world_1", "question": "Give the names of the nations that were founded after 1950.", "gold_sql": "SELECT Name FROM country WHERE IndepYear > 1950", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0039", "split": "test", "db_id": "course_teach", "question": "Show the name of teachers aged either 32 or 33?", "gold_sql": "SELECT Name FROM teacher WHERE Age = 32 OR Age = 33", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0040", "split": "test", "db_id": "world_1", "question": "Which continent speaks the most languages?", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0041", "split": "test", "db_id": "student_transcripts_tracking", "question": "Who is enrolled in a Bachelor degree program? List the first name, middle name, last name.", "gold_sql": "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'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0042", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the average transcript date?", "gold_sql": "SELECT avg(transcript_date) FROM Transcripts", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0043", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the names and descriptions of all the sections?", "gold_sql": "SELECT section_name , section_description FROM Sections", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0044", "split": "test", "db_id": "concert_singer", "question": "Show name, country, age for all singers ordered by age from the oldest to the youngest.", "gold_sql": "SELECT name , country , age FROM singer ORDER BY age DESC", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0045", "split": "test", "db_id": "car_1", "question": "Which are the car makers which produce at least 2 models and more than 3 car makers ? List the id and the maker .", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0046", "split": "test", "db_id": "world_1", "question": "Give the name, population, and head of state for the country that has the largest area.", "gold_sql": "SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0047", "split": "test", "db_id": "car_1", "question": "What are the name of the countries where there is not a single car maker?", "gold_sql": "SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId = T2.Country;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0048", "split": "test", "db_id": "dog_kennels", "question": "How much does each charge type costs? List both charge type and amount.", "gold_sql": "SELECT charge_type , charge_amount FROM Charges", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0049", "split": "test", "db_id": "world_1", "question": "Give the total surface area covered by countries in Asia or Europe.", "gold_sql": "SELECT sum(SurfaceArea) FROM country WHERE Continent = \"Asia\" OR Continent = \"Europe\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0050", "split": "test", "db_id": "tvshow", "question": "What is Weekly Rank of TV series with Episode \"A Love of a Lifetime\"?", "gold_sql": "SELECT Weekly_Rank FROM TV_series WHERE Episode = \"A Love of a Lifetime\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0051", "split": "test", "db_id": "orchestra", "question": "Show the names of conductors and the orchestras they have conducted.", "gold_sql": "SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0052", "split": "test", "db_id": "wta_1", "question": "What are the average ages of losers and winners across matches?", "gold_sql": "SELECT avg(loser_age) , avg(winner_age) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0053", "split": "test", "db_id": "network_1", "question": "Count the number of high schoolers in grades 9 or 10.", "gold_sql": "SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0054", "split": "test", "db_id": "course_teach", "question": "List the names of teachers who have not been arranged to teach courses.", "gold_sql": "SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0055", "split": "test", "db_id": "battle_death", "question": "How many ships ended up being 'Captured'?", "gold_sql": "SELECT count(*) FROM ship WHERE disposition_of_ship = 'Captured'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0056", "split": "test", "db_id": "student_transcripts_tracking", "question": "Find the program which most number of students are enrolled in. List both the id and the summary.", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0057", "split": "test", "db_id": "dog_kennels", "question": "How many professionals have performed any treatment to dogs?", "gold_sql": "SELECT count(DISTINCT professional_id) FROM Treatments", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0058", "split": "test", "db_id": "pets_1", "question": "How many dog pets are raised by female students?", "gold_sql": "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'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0059", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What is the document id and name with greatest number of paragraphs?", "gold_sql": "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", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0060", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many courses are there?", "gold_sql": "SELECT count(*) FROM Courses", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0061", "split": "test", "db_id": "tvshow", "question": "Find the production code and channel of the most recently aired cartoon .", "gold_sql": "select production_code , channel from cartoon order by original_air_date desc limit 1", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0062", "split": "test", "db_id": "network_1", "question": "How many likes correspond to each student id?", "gold_sql": "SELECT student_id , count(*) FROM Likes GROUP BY student_id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0063", "split": "test", "db_id": "orchestra", "question": "Show the name of the conductor that has conducted the most number of orchestras.", "gold_sql": "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", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0064", "split": "test", "db_id": "tvshow", "question": "What are the names of all cartoons directed by Ben Jones?", "gold_sql": "SELECT Title FROM Cartoon WHERE Directed_by = \"Ben Jones\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0065", "split": "test", "db_id": "world_1", "question": "Return the country codes for countries that do not speak English.", "gold_sql": "SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0066", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the names of all courses that have some students enrolled?", "gold_sql": "SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0067", "split": "test", "db_id": "car_1", "question": "Which distinct car models are the produced after 1980?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0068", "split": "test", "db_id": "orchestra", "question": "Please show the different record companies and the corresponding number of orchestras.", "gold_sql": "SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0069", "split": "test", "db_id": "poker_player", "question": "Count the number of poker players.", "gold_sql": "SELECT count(*) FROM poker_player", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0070", "split": "test", "db_id": "car_1", "question": "How many car models were produced by the maker with full name American Motor Company?", "gold_sql": "SELECT count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker WHERE T1.FullName = 'American Motor Company';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0071", "split": "test", "db_id": "flight_2", "question": "What are flight numbers of Airline \"United Airlines\"?", "gold_sql": "SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = \"United Airlines\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0072", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many transcripts are listed?", "gold_sql": "SELECT count(*) FROM Transcripts", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0073", "split": "test", "db_id": "battle_death", "question": "What are the distinct battle names which are between bulgarian commander 'Kaloyan' and latin commander 'Baldwin I'?", "gold_sql": "SELECT name FROM battle WHERE bulgarian_commander = 'Kaloyan' AND latin_commander = 'Baldwin I'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0074", "split": "test", "db_id": "wta_1", "question": "Find the name of the winner who has the highest rank points and participated in the Australian Open tourney.", "gold_sql": "SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0075", "split": "test", "db_id": "network_1", "question": "What are the ids of high school students who do not have friends?", "gold_sql": "SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0076", "split": "test", "db_id": "dog_kennels", "question": "What is the average age of all the dogs?", "gold_sql": "SELECT avg(age) FROM Dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0077", "split": "test", "db_id": "car_1", "question": "What is the number of continents?", "gold_sql": "SELECT count(*) FROM CONTINENTS;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0078", "split": "test", "db_id": "tvshow", "question": "List the language used least number of TV Channel. List language and number of TV Channel.", "gold_sql": "SELECT LANGUAGE , count(*) FROM TV_Channel GROUP BY LANGUAGE ORDER BY count(*) ASC LIMIT 1;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0079", "split": "test", "db_id": "wta_1", "question": "How many total tours were there for each ranking date?", "gold_sql": "SELECT sum(tours) , ranking_date FROM rankings GROUP BY ranking_date", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0080", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Count the number of templates of the type CV.", "gold_sql": "SELECT count(*) FROM Templates WHERE template_type_code = \"CV\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0081", "split": "test", "db_id": "orchestra", "question": "What are the major record formats of orchestras, sorted by their frequency?", "gold_sql": "SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0082", "split": "test", "db_id": "flight_2", "question": "What is the airport name for airport 'AKO'?", "gold_sql": "SELECT AirportName FROM AIRPORTS WHERE AirportCode = \"AKO\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0083", "split": "test", "db_id": "car_1", "question": "How many countries are listed?", "gold_sql": "SELECT count(*) FROM COUNTRIES;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0084", "split": "test", "db_id": "concert_singer", "question": "Show the name and the release year of the song by the youngest singer.", "gold_sql": "SELECT song_name , song_release_year FROM singer ORDER BY age LIMIT 1", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0085", "split": "test", "db_id": "tvshow", "question": "List the Episode of all TV series showed on TV Channel with series name \"Sky Radio\".", "gold_sql": "SELECT T2.Episode FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T1.series_name = \"Sky Radio\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0086", "split": "test", "db_id": "museum_visit", "question": "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.", "gold_sql": "SELECT name , Level_of_membership FROM visitor WHERE Level_of_membership > 4 ORDER BY age DESC", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0087", "split": "test", "db_id": "orchestra", "question": "Please show the record formats of orchestras in ascending order of count.", "gold_sql": "SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0088", "split": "test", "db_id": "orchestra", "question": "Return the names of conductors that do not have the nationality \"USA\".", "gold_sql": "SELECT Name FROM conductor WHERE Nationality != 'USA'", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0089", "split": "test", "db_id": "singer", "question": "What are the citizenships that are shared by singers with a birth year before 1945 and after 1955?", "gold_sql": "SELECT Citizenship FROM singer WHERE Birth_Year < 1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year > 1955", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0090", "split": "test", "db_id": "flight_2", "question": "How many United Airlines flights go to City 'Aberdeen'?", "gold_sql": "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\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0091", "split": "test", "db_id": "car_1", "question": "What is the number of the cars with horsepower more than 150?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE horsepower > 150;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0092", "split": "test", "db_id": "network_1", "question": "What is the grade of each high schooler?", "gold_sql": "SELECT grade FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0093", "split": "test", "db_id": "voter_1", "question": "What are the create dates, states, and phone numbers of the votes that were for the contestant named 'Tabatha Gehling'?", "gold_sql": "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'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0094", "split": "test", "db_id": "car_1", "question": "How many cars has over 6 cylinders?", "gold_sql": "SELECT COUNT(*) FROM CARS_DATA WHERE Cylinders > 6;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0095", "split": "test", "db_id": "flight_2", "question": "Find the name of airports which do not have any flight in and out.", "gold_sql": "SELECT AirportName FROM Airports WHERE AirportCode NOT IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights)", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0096", "split": "test", "db_id": "pets_1", "question": "Find the average and maximum age for each type of pet.", "gold_sql": "SELECT avg(pet_age) , max(pet_age) , pettype FROM pets GROUP BY pettype", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0097", "split": "test", "db_id": "car_1", "question": "What is the maximum accelerate for all the different cylinders?", "gold_sql": "SELECT max(Accelerate) , Cylinders FROM CARS_DATA GROUP BY Cylinders;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0098", "split": "test", "db_id": "network_1", "question": "What are the names of high schoolers who both have friends and are liked?", "gold_sql": "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", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0099", "split": "test", "db_id": "world_1", "question": "Return the codes of countries that do not speak English and do not have Republics for governments.", "gold_sql": "SELECT Code FROM country WHERE GovernmentForm != \"Republic\" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0100", "split": "test", "db_id": "world_1", "question": "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?", "gold_sql": "SELECT sum(Population) , avg(LifeExpectancy) , Continent FROM country GROUP BY Continent HAVING avg(LifeExpectancy) < 72", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0101", "split": "test", "db_id": "battle_death", "question": "List the name, date and result of each battle.", "gold_sql": "SELECT name , date FROM battle", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0102", "split": "test", "db_id": "flight_2", "question": "Which airlines have at least 10 flights?", "gold_sql": "SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0103", "split": "test", "db_id": "pets_1", "question": "How many pets have a greater weight than 10?", "gold_sql": "SELECT count(*) FROM pets WHERE weight > 10", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0104", "split": "test", "db_id": "car_1", "question": "What are the different models wthat are lighter than 3500 but were not built by the Ford Motor Company?", "gold_sql": "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';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0105", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the maximum number of times that a course shows up in different transcripts and what is that course's enrollment id?", "gold_sql": "SELECT count(*) , student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0106", "split": "test", "db_id": "tvshow", "question": "What is the content of the series Sky Radio?", "gold_sql": "SELECT Content FROM TV_Channel WHERE series_name = \"Sky Radio\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0107", "split": "test", "db_id": "poker_player", "question": "What is the most common nationality of people?", "gold_sql": "SELECT Nationality FROM people GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0108", "split": "test", "db_id": "student_transcripts_tracking", "question": "Describe the section h.", "gold_sql": "SELECT section_description FROM Sections WHERE section_name = 'h'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0109", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers who are aged either 32 or 33?", "gold_sql": "SELECT Name FROM teacher WHERE Age = 32 OR Age = 33", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0110", "split": "test", "db_id": "wta_1", "question": "What are the names of tournaments that have more than 10 matches?", "gold_sql": "SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*) > 10", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0111", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers and how many courses do they teach?", "gold_sql": "SELECT T2.Name , COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0112", "split": "test", "db_id": "tvshow", "question": "What are the countries that are not playing cartoons written by Todd Casey?", "gold_sql": "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'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0113", "split": "test", "db_id": "tvshow", "question": "List all cartoon directed by \"Ben Jones\".", "gold_sql": "SELECT Title FROM Cartoon WHERE Directed_by = \"Ben Jones\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0114", "split": "test", "db_id": "employee_hire_evaluation", "question": "Find the number of employees hired in each shop; show the shop name as well.", "gold_sql": "SELECT count(*) , t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0115", "split": "test", "db_id": "poker_player", "question": "Return the money rank of the player with the greatest earnings.", "gold_sql": "SELECT Money_Rank FROM poker_player ORDER BY Earnings DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0116", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all paragraph ids and texts for the document with name 'Welcome to NY'.", "gold_sql": "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'", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0117", "split": "test", "db_id": "voter_1", "question": "Return the names of the contestants whose names contain the substring 'Al' .", "gold_sql": "select contestant_name from contestants where contestant_name like \"%al%\"", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0118", "split": "test", "db_id": "wta_1", "question": "What is the name of the winner with the most rank points who participated in the Australian Open tournament?", "gold_sql": "SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0119", "split": "test", "db_id": "network_1", "question": "Show ids of all students who do not have any friends.", "gold_sql": "SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0120", "split": "test", "db_id": "network_1", "question": "Show the names of students who have a grade higher than 5 and have at least 2 friends.", "gold_sql": "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", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0121", "split": "test", "db_id": "car_1", "question": "What is the number of car models that are produced by each maker and what is the id and full name of each maker?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0122", "split": "test", "db_id": "flight_2", "question": "How many airlines are from USA?", "gold_sql": "SELECT count(*) FROM AIRLINES WHERE Country = \"USA\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0123", "split": "test", "db_id": "dog_kennels", "question": "How many dogs have an age below the average?", "gold_sql": "SELECT count(*) FROM Dogs WHERE age < ( SELECT avg(age) FROM Dogs )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0124", "split": "test", "db_id": "voter_1", "question": "What are the distinct states and create time of all votes?", "gold_sql": "SELECT DISTINCT state , created FROM votes", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0125", "split": "test", "db_id": "dog_kennels", "question": "What are all the possible breed type and size type combinations?", "gold_sql": "SELECT DISTINCT breed_code , size_code FROM dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0126", "split": "test", "db_id": "tvshow", "question": "What are the package options of all tv channels that are not playing any cartoons directed by Ben Jones?", "gold_sql": "SELECT package_option FROM TV_Channel WHERE id NOT IN (SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones')", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0127", "split": "test", "db_id": "world_1", "question": "What are the names and areas of countries with the top 5 largest area?", "gold_sql": "SELECT Name , SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0128", "split": "test", "db_id": "network_1", "question": "Give the name of the student with the most likes.", "gold_sql": "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", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0129", "split": "test", "db_id": "network_1", "question": "Show name of all students who have some friends and also are liked by someone else.", "gold_sql": "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", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0130", "split": "test", "db_id": "employee_hire_evaluation", "question": "find the name of employee who was awarded the most times in the evaluation.", "gold_sql": "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", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0131", "split": "test", "db_id": "wta_1", "question": "How many players are there?", "gold_sql": "SELECT count(*) FROM players", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0132", "split": "test", "db_id": "world_1", "question": "Which language is the most popular in Aruba?", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0133", "split": "test", "db_id": "car_1", "question": "How many cars have more than 4 cylinders?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE Cylinders > 4;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0134", "split": "test", "db_id": "dog_kennels", "question": "What are the emails of the professionals living in either the state of Hawaii or the state of Wisconsin?", "gold_sql": "SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0135", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What the smallest version number and its template type code?", "gold_sql": "SELECT min(Version_Number) , template_type_code FROM Templates", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0136", "split": "test", "db_id": "car_1", "question": "What is the number of cars with a horsepower greater than 150?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE horsepower > 150;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0137", "split": "test", "db_id": "singer", "question": "Show different citizenship of singers and the number of singers of each citizenship.", "gold_sql": "SELECT Citizenship , COUNT(*) FROM singer GROUP BY Citizenship", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0138", "split": "test", "db_id": "employee_hire_evaluation", "question": "How many shops are there in each location?", "gold_sql": "SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0139", "split": "test", "db_id": "world_1", "question": "What are the names of nations where both English and French are official languages?", "gold_sql": "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\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0140", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers who teach at least two courses?", "gold_sql": "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", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0141", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the ids of templates that have the code PP or PPT.", "gold_sql": "SELECT template_id FROM Templates WHERE template_type_code = \"PP\" OR template_type_code = \"PPT\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0142", "split": "test", "db_id": "singer", "question": "List the name of singers that do not have any song.", "gold_sql": "SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song)", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0143", "split": "test", "db_id": "tvshow", "question": "What is the pixel aspect ratio and country of origin for all TV channels that do not use English?", "gold_sql": "SELECT Pixel_aspect_ratio_PAR , country FROM tv_channel WHERE LANGUAGE != 'English'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0144", "split": "test", "db_id": "dog_kennels", "question": "What are each owner's first name and their dogs's name?", "gold_sql": "SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0145", "split": "test", "db_id": "world_1", "question": "What is the total population and maximum GNP in Asia?", "gold_sql": "SELECT sum(Population) , max(GNP) FROM country WHERE Continent = \"Asia\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0146", "split": "test", "db_id": "singer", "question": "What is the most common singer citizenship ?", "gold_sql": "select citizenship from singer group by citizenship order by count(*) desc limit 1", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0147", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "How many paragraphs in total?", "gold_sql": "SELECT count(*) FROM Paragraphs", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0148", "split": "test", "db_id": "tvshow", "question": "Find the series name and country of the tv channel that is playing some cartoons directed by Ben Jones and Michael Chang?", "gold_sql": "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'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0149", "split": "test", "db_id": "battle_death", "question": "List the name and tonnage ordered by in descending alphaetical order for the names.", "gold_sql": "SELECT name , tonnage FROM ship ORDER BY name DESC", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0150", "split": "test", "db_id": "world_1", "question": "What are the countries that have greater surface area than any country in Europe?", "gold_sql": "SELECT Name FROM country WHERE SurfaceArea > (SELECT min(SurfaceArea) FROM country WHERE Continent = \"Europe\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0151", "split": "test", "db_id": "wta_1", "question": "Find the codes of countries that have more than 50 players.", "gold_sql": "SELECT country_code FROM players GROUP BY country_code HAVING count(*) > 50", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0152", "split": "test", "db_id": "concert_singer", "question": "How many concerts occurred in 2014 or 2015?", "gold_sql": "SELECT count(*) FROM concert WHERE YEAR = 2014 OR YEAR = 2015", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0153", "split": "test", "db_id": "poker_player", "question": "What are the names of poker players in descending order of earnings?", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0154", "split": "test", "db_id": "car_1", "question": "In 1980, how many cars were made?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE YEAR = 1980;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0155", "split": "test", "db_id": "world_1", "question": "Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages.", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0156", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show template ids, version numbers, and template type codes for all templates.", "gold_sql": "SELECT template_id , version_number , template_type_code FROM Templates", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0157", "split": "test", "db_id": "flight_2", "question": "Give the number of Jetblue Airways flights.", "gold_sql": "SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T1.Airline = T2.uid WHERE T2.Airline = \"JetBlue Airways\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0158", "split": "test", "db_id": "network_1", "question": "Show names of all high school students who do not have any friends.", "gold_sql": "SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0159", "split": "test", "db_id": "concert_singer", "question": "What is the average, minimum, and maximum age of all singers from France?", "gold_sql": "SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0160", "split": "test", "db_id": "student_transcripts_tracking", "question": "List the section_name in reversed lexicographical order.", "gold_sql": "SELECT section_name FROM Sections ORDER BY section_name DESC", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0161", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are all the course names of the courses which ever have students enrolled in?", "gold_sql": "SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0162", "split": "test", "db_id": "pets_1", "question": "Find the number of pets whose weight is heavier than 10.", "gold_sql": "SELECT count(*) FROM pets WHERE weight > 10", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0163", "split": "test", "db_id": "world_1", "question": "how many countries are in Asia?", "gold_sql": "SELECT count(*) FROM country WHERE continent = \"Asia\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0164", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many different degrees are offered?", "gold_sql": "SELECT count(DISTINCT degree_summary_name) FROM Degree_Programs", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0165", "split": "test", "db_id": "wta_1", "question": "find the number of distinct country codes of all players.", "gold_sql": "SELECT count(DISTINCT country_code) FROM players", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0166", "split": "test", "db_id": "car_1", "question": "What is the largest amount of horsepower for the models with 3 cylinders and what make is it?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0167", "split": "test", "db_id": "orchestra", "question": "What is the name of the conductor who has worked the greatest number of years?", "gold_sql": "SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0168", "split": "test", "db_id": "world_1", "question": "What are the cities whose population is between 160000 and 900000?", "gold_sql": "SELECT name FROM city WHERE Population BETWEEN 160000 AND 900000", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0169", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all distinct template type codes for all templates.", "gold_sql": "SELECT DISTINCT template_type_code FROM Templates", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0170", "split": "test", "db_id": "poker_player", "question": "How many distinct nationalities are there?", "gold_sql": "SELECT count(DISTINCT Nationality) FROM people", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0171", "split": "test", "db_id": "poker_player", "question": "What are the names of poker players?", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0172", "split": "test", "db_id": "employee_hire_evaluation", "question": "Find the cities that have more than one employee under age 30.", "gold_sql": "SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING count(*) > 1", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0173", "split": "test", "db_id": "pets_1", "question": "What major is every student who does not own a cat as a pet, and also how old are they?", "gold_sql": "SELECT major , age FROM student WHERE stuid NOT 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')", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0174", "split": "test", "db_id": "world_1", "question": "What are the country codes of the different countries, and what are the languages spoken by the greatest percentage of people for each?", "gold_sql": "SELECT LANGUAGE , CountryCode , max(Percentage) FROM countrylanguage GROUP BY CountryCode", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0175", "split": "test", "db_id": "real_estate_properties", "question": "What are the names of properties that are either houses or apartments with more than 1 room?", "gold_sql": "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", "db_path": "databases/real_estate_properties/real_estate_properties.sqlite", "schema": "CREATE TABLE `Other_Available_Features` (\n`feature_id` INTEGER PRIMARY KEY,\n`feature_type_code` VARCHAR(20) NOT NULL,\n`feature_name` VARCHAR(80),\n`feature_description` VARCHAR(80),\nFOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` )\n);\nCREATE TABLE `Other_Property_Features` (\n`property_id` INTEGER NOT NULL,\n`feature_id` INTEGER NOT NULL,\n`property_feature_description` VARCHAR(80),\nFOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ),\nFOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` )\n);\nCREATE TABLE `Properties` (\n`property_id` INTEGER PRIMARY KEY,\n`property_type_code` VARCHAR(20) NOT NULL,\n`date_on_market` DATETIME,\n`date_sold` DATETIME,\n`property_name` VARCHAR(80),\n`property_address` VARCHAR(255),\n`room_count` INTEGER,\n`vendor_requested_price` DECIMAL(19,4),\n`buyer_offered_price` DECIMAL(19,4),\n`agreed_selling_price` DECIMAL(19,4),\n`apt_feature_1` VARCHAR(255),\n`apt_feature_2` VARCHAR(255),\n`apt_feature_3` VARCHAR(255),\n`fld_feature_1` VARCHAR(255),\n`fld_feature_2` VARCHAR(255),\n`fld_feature_3` VARCHAR(255),\n`hse_feature_1` VARCHAR(255),\n`hse_feature_2` VARCHAR(255),\n`hse_feature_3` VARCHAR(255),\n`oth_feature_1` VARCHAR(255),\n`oth_feature_2` VARCHAR(255),\n`oth_feature_3` VARCHAR(255),\n`shp_feature_1` VARCHAR(255),\n`shp_feature_2` VARCHAR(255),\n`shp_feature_3` VARCHAR(255),\n`other_property_details` VARCHAR(255),\nFOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` )\n);\nCREATE TABLE `Ref_Feature_Types` (\n`feature_type_code` VARCHAR(20) PRIMARY KEY,\n`feature_type_name` VARCHAR(80)\n);\nCREATE TABLE `Ref_Property_Types` (\n`property_type_code` VARCHAR(20) PRIMARY KEY,\n`property_type_description` VARCHAR(80)\n);"} {"qid": "test_0176", "split": "test", "db_id": "employee_hire_evaluation", "question": "What is all the information about hiring?", "gold_sql": "SELECT * FROM hiring", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0177", "split": "test", "db_id": "employee_hire_evaluation", "question": "What are the names of the employees who never received any evaluation?", "gold_sql": "SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation)", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0178", "split": "test", "db_id": "world_1", "question": "What is the total surface area of the countries in the Caribbean region?", "gold_sql": "SELECT sum(SurfaceArea) FROM country WHERE Region = \"Caribbean\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0179", "split": "test", "db_id": "network_1", "question": "How many high schoolers are in each grade?", "gold_sql": "SELECT grade , count(*) FROM Highschooler GROUP BY grade", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0180", "split": "test", "db_id": "pets_1", "question": "What is the average and maximum age for each pet type?", "gold_sql": "SELECT avg(pet_age) , max(pet_age) , pettype FROM pets GROUP BY pettype", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0181", "split": "test", "db_id": "world_1", "question": "Return the different names of cities that are in Asia and for which Chinese is the official language.", "gold_sql": "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\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0182", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the different descriptions for templates that have been used in a document.", "gold_sql": "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", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0183", "split": "test", "db_id": "concert_singer", "question": "What is the year that had the most concerts?", "gold_sql": "SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0184", "split": "test", "db_id": "singer", "question": "What are the names of the singers who are not French citizens?", "gold_sql": "SELECT Name FROM singer WHERE Citizenship != \"France\"", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0185", "split": "test", "db_id": "singer", "question": "What is the name of the singer who is worth the most?", "gold_sql": "SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0186", "split": "test", "db_id": "world_1", "question": "Give the language that is spoken in the most countries.", "gold_sql": "SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0187", "split": "test", "db_id": "dog_kennels", "question": "What is the description of the treatment type that costs the least money in total?", "gold_sql": "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", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0188", "split": "test", "db_id": "world_1", "question": "What languages are only used by a single country with a republic government?", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0189", "split": "test", "db_id": "museum_visit", "question": "Find the id and name of the museum that has the most staff members?", "gold_sql": "SELECT museum_id , name FROM museum ORDER BY num_of_staff DESC LIMIT 1", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0190", "split": "test", "db_id": "voter_1", "question": "What are the number of votes from state 'NY' or 'CA'?", "gold_sql": "SELECT count(*) FROM votes WHERE state = 'NY' OR state = 'CA'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0191", "split": "test", "db_id": "world_1", "question": "What are the names of countries that speak more than 2 languages, as well as how many languages they speak?", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0192", "split": "test", "db_id": "poker_player", "question": "Return the names of poker players sorted by their earnings descending.", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0193", "split": "test", "db_id": "battle_death", "question": "What is the average number of injuries caused each time?", "gold_sql": "SELECT avg(injured) FROM death", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0194", "split": "test", "db_id": "concert_singer", "question": "Show names for all stadiums except for stadiums having a concert in year 2014.", "gold_sql": "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", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0195", "split": "test", "db_id": "tvshow", "question": "What is the content of TV Channel with serial name \"Sky Radio\"?", "gold_sql": "SELECT Content FROM TV_Channel WHERE series_name = \"Sky Radio\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0196", "split": "test", "db_id": "student_transcripts_tracking", "question": "List all the student details in reversed lexicographical order.", "gold_sql": "SELECT other_student_details FROM Students ORDER BY other_student_details DESC", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0197", "split": "test", "db_id": "pets_1", "question": "For students who have pets , how many pets does each student have ? list their ids instead of names .", "gold_sql": "select count(*) , t1.stuid from student as t1 join has_pet as t2 on t1.stuid = t2.stuid group by t1.stuid", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0198", "split": "test", "db_id": "world_1", "question": "Return the codes of countries for which Spanish is the predominantly spoken language.", "gold_sql": "SELECT CountryCode , max(Percentage) FROM countrylanguage WHERE LANGUAGE = \"Spanish\" GROUP BY CountryCode", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0199", "split": "test", "db_id": "network_1", "question": "What is Kyle's id?", "gold_sql": "SELECT ID FROM Highschooler WHERE name = \"Kyle\"", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0200", "split": "test", "db_id": "car_1", "question": "What is the full name of each car maker, along with its id and how many models it produces?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0201", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What is the document id, template id and description for document named \"Robbin CV\"?", "gold_sql": "SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = \"Robbin CV\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0202", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all paragraph texts for the document \"Customer reviews\".", "gold_sql": "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\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0203", "split": "test", "db_id": "employee_hire_evaluation", "question": "Find the name of the shops that do not hire any employee.", "gold_sql": "SELECT name FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM hiring)", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0204", "split": "test", "db_id": "course_teach", "question": "What are the age and hometown of teachers?", "gold_sql": "SELECT Age , Hometown FROM teacher", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0205", "split": "test", "db_id": "world_1", "question": "For the countries founded before 1930, what is the total number of distinct official languages?", "gold_sql": "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\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0206", "split": "test", "db_id": "pets_1", "question": "Find the number of distinct type of pets.", "gold_sql": "SELECT count(DISTINCT pettype) FROM pets", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0207", "split": "test", "db_id": "tvshow", "question": "List the title of all cartoons in alphabetical order.", "gold_sql": "SELECT Title FROM Cartoon ORDER BY title", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0208", "split": "test", "db_id": "pets_1", "question": "Find the id of students who do not have a cat pet.", "gold_sql": "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'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0209", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all document ids, names and the number of paragraphs in each document.", "gold_sql": "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", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0210", "split": "test", "db_id": "concert_singer", "question": "Show all countries and the number of singers in each country.", "gold_sql": "SELECT country , count(*) FROM singer GROUP BY country", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0211", "split": "test", "db_id": "car_1", "question": "For all of the 4 cylinder cars, which model has the most horsepower?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0212", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many degrees does the engineering department have?", "gold_sql": "SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0213", "split": "test", "db_id": "network_1", "question": "Show all the grades of the high schoolers.", "gold_sql": "SELECT grade FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0214", "split": "test", "db_id": "singer", "question": "What is the count of singers?", "gold_sql": "SELECT count(*) FROM singer", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0215", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the earliest date of a transcript release, and what details can you tell me?", "gold_sql": "SELECT transcript_date , other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0216", "split": "test", "db_id": "world_1", "question": "Which language is spoken by the largest number of countries?", "gold_sql": "SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0217", "split": "test", "db_id": "employee_hire_evaluation", "question": "Find the names of employees who never won any award in the evaluation.", "gold_sql": "SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation)", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0218", "split": "test", "db_id": "world_1", "question": "What is the total number of people living in the nations that do not use English?", "gold_sql": "SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"English\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0219", "split": "test", "db_id": "world_1", "question": "Find the government form name and total population for each government form whose average life expectancy is longer than 72.", "gold_sql": "SELECT sum(Population) , GovernmentForm FROM country GROUP BY GovernmentForm HAVING avg(LifeExpectancy) > 72", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0220", "split": "test", "db_id": "flight_2", "question": "How many airports do we have?", "gold_sql": "SELECT count(*) FROM AIRPORTS", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0221", "split": "test", "db_id": "world_1", "question": "What are the codes of the countries that do not speak English and whose government forms are not Republic?", "gold_sql": "SELECT Code FROM country WHERE GovernmentForm != \"Republic\" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0222", "split": "test", "db_id": "wta_1", "question": "What are the first names of all players, and their average rankings?", "gold_sql": "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", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0223", "split": "test", "db_id": "world_1", "question": "What are the region and population of Angola?", "gold_sql": "SELECT Population , Region FROM country WHERE Name = \"Angola\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0224", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the ids and names of each document, as well as the number of paragraphs in each?", "gold_sql": "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", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0225", "split": "test", "db_id": "voter_1", "question": "What are the names of the contestants whose names are not 'Jessie Alloway'", "gold_sql": "SELECT contestant_name FROM contestants WHERE contestant_name != 'Jessie Alloway'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0226", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Which template type code has most number of templates?", "gold_sql": "SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0227", "split": "test", "db_id": "car_1", "question": "What is the average weight and year for each year?", "gold_sql": "SELECT avg(Weight) , YEAR FROM CARS_DATA GROUP BY YEAR;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0228", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the descriptions for all the math courses?", "gold_sql": "SELECT course_description FROM Courses WHERE course_name = 'math'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0229", "split": "test", "db_id": "voter_1", "question": "What are the maximum and minimum values of area codes?", "gold_sql": "SELECT max(area_code) , min(area_code) FROM area_code_state", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0230", "split": "test", "db_id": "battle_death", "question": "List the name and date the battle that has lost the ship named 'Lettice' and the ship named 'HMS Atalanta'", "gold_sql": "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'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0231", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the last transcript release date?", "gold_sql": "SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0232", "split": "test", "db_id": "museum_visit", "question": "What is the name of the museum that had no visitor yet?", "gold_sql": "SELECT name FROM museum WHERE Museum_ID NOT IN (SELECT museum_id FROM visit)", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0233", "split": "test", "db_id": "flight_2", "question": "How many 'United Airlines' flights depart from Airport 'AHD'?", "gold_sql": "SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = \"United Airlines\" AND T2.SourceAirport = \"AHD\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0234", "split": "test", "db_id": "wta_1", "question": "Find the average age of losers and winners of all matches.", "gold_sql": "SELECT avg(loser_age) , avg(winner_age) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0235", "split": "test", "db_id": "dog_kennels", "question": "What are the id, role, and first name of the professionals who have performed two or more treatments?", "gold_sql": "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", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0236", "split": "test", "db_id": "battle_death", "question": "What are the name and results of the battles when the bulgarian commander is not 'Boril'", "gold_sql": "SELECT name , RESULT FROM battle WHERE bulgarian_commander != 'Boril'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0237", "split": "test", "db_id": "pets_1", "question": "What are the first names of every student who has a cat or dog as a pet?", "gold_sql": "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'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0238", "split": "test", "db_id": "dog_kennels", "question": "How many owners temporarily do not have any dogs?", "gold_sql": "SELECT count(*) FROM Owners WHERE owner_id NOT IN ( SELECT owner_id FROM Dogs )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0239", "split": "test", "db_id": "concert_singer", "question": "What are the names of the singers and number of concerts for each person?", "gold_sql": "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", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0240", "split": "test", "db_id": "car_1", "question": "What are the id and names of the countries which have more than 3 car makers or produce the 'fiat' model?", "gold_sql": "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';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0241", "split": "test", "db_id": "car_1", "question": "What is the maker of the carr produced in the earliest year and what year was it?", "gold_sql": "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);", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0242", "split": "test", "db_id": "car_1", "question": "What is the horsepower of the car with the greatest accelerate?", "gold_sql": "SELECT T1.horsepower FROM CARS_DATA AS T1 ORDER BY T1.accelerate DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0243", "split": "test", "db_id": "voter_1", "question": "What is last date created of votes from the state 'CA'?", "gold_sql": "SELECT max(created) FROM votes WHERE state = 'CA'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0244", "split": "test", "db_id": "concert_singer", "question": "What is the average, minimum, and maximum age for all French singers?", "gold_sql": "SELECT avg(age) , min(age) , max(age) FROM singer WHERE country = 'France'", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0245", "split": "test", "db_id": "singer", "question": "Show titles of songs and names of singers.", "gold_sql": "SELECT T2.Title , T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0246", "split": "test", "db_id": "dog_kennels", "question": "What are the dog name, age and weight of the dogs that were abandoned? Note that 1 stands for yes, and 0 stands for no in the tables.", "gold_sql": "SELECT name , age , weight FROM Dogs WHERE abandoned_yn = 1", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0247", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many different addresses do the students currently live?", "gold_sql": "SELECT count(DISTINCT current_address_id) FROM Students", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0248", "split": "test", "db_id": "world_1", "question": "What are the names of cities in Europe for which English is not the official language?", "gold_sql": "SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode = T1.Code WHERE T1.Continent = 'Europe' AND T1.Name NOT 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')", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0249", "split": "test", "db_id": "museum_visit", "question": "What are the id, name and membership level of visitors who have spent the largest amount of money in total in all museum tickets?", "gold_sql": "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", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0250", "split": "test", "db_id": "poker_player", "question": "What is the maximum number of final tables made among poker players with earnings less than 200000?", "gold_sql": "SELECT max(Final_Table_Made) FROM poker_player WHERE Earnings < 200000", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0251", "split": "test", "db_id": "wta_1", "question": "What is the code of the country with the most players?", "gold_sql": "SELECT country_code FROM players GROUP BY country_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0252", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the different template type codes, and how many documents use each type?", "gold_sql": "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", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0253", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the first, middle, and last name of the earliest school graduate?", "gold_sql": "SELECT first_name , middle_name , last_name FROM Students ORDER BY date_left ASC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0254", "split": "test", "db_id": "poker_player", "question": "How many poker players are there?", "gold_sql": "SELECT count(*) FROM poker_player", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0255", "split": "test", "db_id": "world_1", "question": "What are the African countries that have a population less than any country in Asia?", "gold_sql": "SELECT Name FROM country WHERE Continent = \"Africa\" AND population < (SELECT max(population) FROM country WHERE Continent = \"Asia\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0256", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the department description for the one whose name has the word computer?", "gold_sql": "SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0257", "split": "test", "db_id": "dog_kennels", "question": "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.", "gold_sql": "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", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0258", "split": "test", "db_id": "tvshow", "question": "What are 3 most highly rated episodes in the TV series table and what were those ratings?", "gold_sql": "SELECT Episode , Rating FROM TV_series ORDER BY Rating DESC LIMIT 3;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0259", "split": "test", "db_id": "car_1", "question": "How many cars have a larger accelerate than the car with the largest horsepower?", "gold_sql": "SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate > ( SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1 );", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0260", "split": "test", "db_id": "course_teach", "question": "Show names of teachers that teach at least two courses.", "gold_sql": "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", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0261", "split": "test", "db_id": "poker_player", "question": "What are the nationalities that are shared by at least two people?", "gold_sql": "SELECT Nationality FROM people GROUP BY Nationality HAVING COUNT(*) >= 2", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0262", "split": "test", "db_id": "world_1", "question": "Give the mean life expectancy of countries in which English is not the official language.", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Name NOT 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\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0263", "split": "test", "db_id": "battle_death", "question": "What are the notes of the death events which has substring 'East'?", "gold_sql": "SELECT note FROM death WHERE note LIKE '%East%'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0264", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the template type code of the template that is used by a document named Data base.", "gold_sql": "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\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0265", "split": "test", "db_id": "student_transcripts_tracking", "question": "When is the first transcript released? List the date and details.", "gold_sql": "SELECT transcript_date , other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0266", "split": "test", "db_id": "orchestra", "question": "Return the average attendance across all shows.", "gold_sql": "SELECT avg(Attendance) FROM SHOW", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0267", "split": "test", "db_id": "dog_kennels", "question": "Which dogs are owned by someone who lives in Virginia? List the owner's first name and the dog's name.", "gold_sql": "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'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0268", "split": "test", "db_id": "student_transcripts_tracking", "question": "Show the date of the transcript which shows the least number of results, also list the id.", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0269", "split": "test", "db_id": "wta_1", "question": "find the number of players for each country.", "gold_sql": "SELECT count(*) , country_code FROM players GROUP BY country_code", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0270", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all template ids and number of documents using each template.", "gold_sql": "SELECT template_id , count(*) FROM Documents GROUP BY template_id", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0271", "split": "test", "db_id": "tvshow", "question": "What are the ids of the TV channels that do not have any cartoons directed by Ben Jones?", "gold_sql": "SELECT id FROM TV_Channel EXCEPT SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0272", "split": "test", "db_id": "car_1", "question": "What are the names and ids of all makers with more than 3 models?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0273", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the codes of template types that are not used for any document?", "gold_sql": "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", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0274", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the type code of the template type with the description \"Book\".", "gold_sql": "SELECT template_type_code FROM Ref_template_types WHERE template_type_description = \"Book\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0275", "split": "test", "db_id": "dog_kennels", "question": "Which breed do the most dogs have? Give me the breed name.", "gold_sql": "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", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0276", "split": "test", "db_id": "world_1", "question": "What is the language that is used by the largest number of Asian nations?", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0277", "split": "test", "db_id": "concert_singer", "question": "Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.", "gold_sql": "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", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0278", "split": "test", "db_id": "poker_player", "question": "What are the names of people who are not from Russia?", "gold_sql": "SELECT Name FROM people WHERE Nationality != \"Russia\"", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0279", "split": "test", "db_id": "network_1", "question": "What are the names of students who have no friends?", "gold_sql": "SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0280", "split": "test", "db_id": "wta_1", "question": "Find the first name and country code of the player who did the most number of tours.", "gold_sql": "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", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0281", "split": "test", "db_id": "pets_1", "question": "What is the id and weight of every pet who is older than 1?", "gold_sql": "SELECT petid , weight FROM pets WHERE pet_age > 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0282", "split": "test", "db_id": "dog_kennels", "question": "Which states have both owners and professionals living there?", "gold_sql": "SELECT state FROM Owners INTERSECT SELECT state FROM Professionals", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0283", "split": "test", "db_id": "orchestra", "question": "What are the names of conductors as well as the corresonding orchestras that they have conducted?", "gold_sql": "SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0284", "split": "test", "db_id": "dog_kennels", "question": "Tell me the number of dogs that have not received any treatment .", "gold_sql": "select count(*) from dogs where dog_id not in ( select dog_id from treatments )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0285", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Which template type code is used by most number of documents?", "gold_sql": "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", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0286", "split": "test", "db_id": "orchestra", "question": "List the names of orchestras that have no performance.", "gold_sql": "SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0287", "split": "test", "db_id": "poker_player", "question": "Give the names of poker players who have earnings above 300000.", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0288", "split": "test", "db_id": "student_transcripts_tracking", "question": "What's the name of the course with most number of enrollments?", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0289", "split": "test", "db_id": "course_teach", "question": "For each hometown, how many teachers are there?", "gold_sql": "SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0290", "split": "test", "db_id": "poker_player", "question": "List the names of poker players ordered by the final tables made in ascending order.", "gold_sql": "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", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0291", "split": "test", "db_id": "pets_1", "question": "What type of pet is the youngest animal, and how much does it weigh?", "gold_sql": "SELECT pettype , weight FROM pets ORDER BY pet_age LIMIT 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0292", "split": "test", "db_id": "world_1", "question": "Which Asian countries have a population that is larger than any country in Africa?", "gold_sql": "SELECT Name FROM country WHERE Continent = \"Asia\" AND population > (SELECT max(population) FROM country WHERE Continent = \"Africa\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0293", "split": "test", "db_id": "dog_kennels", "question": "Which professionals have operated a treatment that costs less than the average? Give me theor first names and last names.", "gold_sql": "SELECT DISTINCT T1.first_name , T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 WHERE cost_of_treatment < ( SELECT avg(cost_of_treatment) FROM Treatments )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0294", "split": "test", "db_id": "dog_kennels", "question": "What are the cost and treatment type description of each treatment?", "gold_sql": "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", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0295", "split": "test", "db_id": "concert_singer", "question": "what is the name and nation of the singer who have a song having 'Hey' in its name?", "gold_sql": "SELECT name , country FROM singer WHERE song_name LIKE '%Hey%'", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0296", "split": "test", "db_id": "network_1", "question": "Return the number of likes that the high schooler named Kyle has.", "gold_sql": "SELECT count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = \"Kyle\"", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0297", "split": "test", "db_id": "concert_singer", "question": "Show the stadium names without any concert.", "gold_sql": "SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0298", "split": "test", "db_id": "orchestra", "question": "What are the record companies of orchestras in descending order of years in which they were founded?", "gold_sql": "SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0299", "split": "test", "db_id": "world_1", "question": "What are the name, population, and life expectancy of the largest Asian country by land?", "gold_sql": "SELECT Name , Population , LifeExpectancy FROM country WHERE Continent = \"Asia\" ORDER BY SurfaceArea DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0300", "split": "test", "db_id": "tvshow", "question": "List the Episode of all TV series sorted by rating.", "gold_sql": "SELECT Episode FROM TV_series ORDER BY rating", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0301", "split": "test", "db_id": "dog_kennels", "question": "Compute the average age of all the dogs.", "gold_sql": "SELECT avg(age) FROM Dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0302", "split": "test", "db_id": "dog_kennels", "question": "Which dogs are of the rarest breed? Show their names and treatment dates.", "gold_sql": "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 )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0303", "split": "test", "db_id": "singer", "question": "What are the birth years and citizenships of the singers?", "gold_sql": "SELECT Birth_Year , Citizenship FROM singer", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0304", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the description for the section named h?", "gold_sql": "SELECT section_description FROM Sections WHERE section_name = 'h'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0305", "split": "test", "db_id": "student_transcripts_tracking", "question": "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.", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0306", "split": "test", "db_id": "car_1", "question": "What is the number of car models created by the car maker American Motor Company?", "gold_sql": "SELECT count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id = T2.Maker WHERE T1.FullName = 'American Motor Company';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0307", "split": "test", "db_id": "tvshow", "question": "What is the name and directors of all the cartoons that are ordered by air date?", "gold_sql": "SELECT title , Directed_by FROM Cartoon ORDER BY Original_air_date", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0308", "split": "test", "db_id": "world_1", "question": "How many countries have a republic as their form of government?", "gold_sql": "SELECT count(*) FROM country WHERE GovernmentForm = \"Republic\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0309", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many courses in total are listed?", "gold_sql": "SELECT count(*) FROM Courses", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0310", "split": "test", "db_id": "poker_player", "question": "How many people are there of each nationality?", "gold_sql": "SELECT Nationality , COUNT(*) FROM people GROUP BY Nationality", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0311", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the semester which most student registered in? Show both the name and the id.", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0312", "split": "test", "db_id": "voter_1", "question": "Of all the contestants who got voted, what is the contestant number and name of the contestant who got least votes?", "gold_sql": "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", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0313", "split": "test", "db_id": "voter_1", "question": "List the area codes in which voters voted both for the contestant 'Tabatha Gehling' and the contestant 'Kelly Clauss'.", "gold_sql": "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'", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0314", "split": "test", "db_id": "car_1", "question": "What are the countries having at least one car maker? List name and id.", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0315", "split": "test", "db_id": "flight_2", "question": "How many airlines do we have?", "gold_sql": "SELECT count(*) FROM AIRLINES", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0316", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all template type codes that are not used by any document.", "gold_sql": "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", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0317", "split": "test", "db_id": "employee_hire_evaluation", "question": "What are the minimum and maximum number of products across all the shops?", "gold_sql": "SELECT min(Number_products) , max(Number_products) FROM shop", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0318", "split": "test", "db_id": "poker_player", "question": "What are the names of poker players whose earnings is higher than 300000?", "gold_sql": "SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0319", "split": "test", "db_id": "concert_singer", "question": "What are all distinct countries where singers above age 20 are from?", "gold_sql": "SELECT DISTINCT country FROM singer WHERE age > 20", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0320", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Give the ids of documents that have between one and two paragraphs.", "gold_sql": "SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0321", "split": "test", "db_id": "world_1", "question": "What is the number of nations that use English and Dutch?", "gold_sql": "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\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0322", "split": "test", "db_id": "flight_2", "question": "Count the number of United Airlines flights that arrive in Aberdeen.", "gold_sql": "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\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0323", "split": "test", "db_id": "poker_player", "question": "Return the maximum final tables made across all poker players who have earnings below 200000.", "gold_sql": "SELECT max(Final_Table_Made) FROM poker_player WHERE Earnings < 200000", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0324", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What is the document name and template id for document with description with the letter 'w' in it?", "gold_sql": "SELECT document_name , template_id FROM Documents WHERE Document_Description LIKE \"%w%\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0325", "split": "test", "db_id": "car_1", "question": "What is the number of countries with more than 2 car makers ?", "gold_sql": "select count(*) from countries as t1 join car_makers as t2 on t1.countryid = t2.country group by t1.countryid having count(*) > 2", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0326", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What is the version number and template type code for the template with version number later than 5?", "gold_sql": "SELECT version_number , template_type_code FROM Templates WHERE version_number > 5", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0327", "split": "test", "db_id": "dog_kennels", "question": "How many dogs went through any treatments?", "gold_sql": "SELECT count(DISTINCT dog_id) FROM Treatments", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0328", "split": "test", "db_id": "course_teach", "question": "What is the hometown of the youngest teacher?", "gold_sql": "SELECT Hometown FROM teacher ORDER BY Age ASC LIMIT 1", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0329", "split": "test", "db_id": "world_1", "question": "Give the total population and average surface area corresponding to countries in North America that have a surface area greater than 3000 .", "gold_sql": "select sum(population) , avg(surfacearea) from country where continent = \"north america\" and surfacearea > 3000", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0330", "split": "test", "db_id": "flight_2", "question": "How many flights depart from City Aberdeen?", "gold_sql": "SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = \"Aberdeen\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0331", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "How many templates have template type code CV?", "gold_sql": "SELECT count(*) FROM Templates WHERE template_type_code = \"CV\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0332", "split": "test", "db_id": "poker_player", "question": "What is the money rank of the poker player with the highest earnings?", "gold_sql": "SELECT Money_Rank FROM poker_player ORDER BY Earnings DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0333", "split": "test", "db_id": "car_1", "question": "For the cars with 4 cylinders, which model has the largest horsepower?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0334", "split": "test", "db_id": "poker_player", "question": "What are the earnings of poker players, ordered descending by value?", "gold_sql": "SELECT Earnings FROM poker_player ORDER BY Earnings DESC", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0335", "split": "test", "db_id": "employee_hire_evaluation", "question": "What is total bonus given in all evaluations?", "gold_sql": "SELECT sum(bonus) FROM evaluation", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0336", "split": "test", "db_id": "car_1", "question": "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 ?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0337", "split": "test", "db_id": "student_transcripts_tracking", "question": "For each semester, what is the name and id of the one with the most students registered?", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0338", "split": "test", "db_id": "battle_death", "question": "Show names, results and bulgarian commanders of the battles with no ships lost in the 'English Channel'.", "gold_sql": "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'", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0339", "split": "test", "db_id": "world_1", "question": "Which region is the city Kabul located in?", "gold_sql": "SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = \"Kabul\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0340", "split": "test", "db_id": "dog_kennels", "question": "Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email.", "gold_sql": "SELECT first_name , last_name , email_address FROM Owners WHERE state LIKE '%North%'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0341", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many different degree names are offered?", "gold_sql": "SELECT count(DISTINCT degree_summary_name) FROM Degree_Programs", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0342", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "How many documents are using the template with type code 'PPT'?", "gold_sql": "SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT'", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0343", "split": "test", "db_id": "dog_kennels", "question": "List the emails of the professionals who live in the state of Hawaii or the state of Wisconsin.", "gold_sql": "SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0344", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Count the number of paragraphs in the document named 'Summer Show'.", "gold_sql": "SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show'", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0345", "split": "test", "db_id": "car_1", "question": "What are all the makers and models?", "gold_sql": "SELECT Maker , Model FROM MODEL_LIST;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0346", "split": "test", "db_id": "concert_singer", "question": "What are all the song names by singers who are older than average?", "gold_sql": "SELECT song_name FROM singer WHERE age > (SELECT avg(age) FROM singer)", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0347", "split": "test", "db_id": "pets_1", "question": "What is the first name of every student who has a dog but does not have a cat?", "gold_sql": "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 T1.stuid NOT 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')", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0348", "split": "test", "db_id": "network_1", "question": "What is the name of the high schooler who has the greatest number of likes?", "gold_sql": "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", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0349", "split": "test", "db_id": "orchestra", "question": "List names of conductors in descending order of years of work.", "gold_sql": "SELECT Name FROM conductor ORDER BY Year_of_Work DESC", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0350", "split": "test", "db_id": "network_1", "question": "What are the names of all high schoolers in grade 10?", "gold_sql": "SELECT name FROM Highschooler WHERE grade = 10", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0351", "split": "test", "db_id": "concert_singer", "question": "Show countries where a singer above age 40 and a singer below 30 are from.", "gold_sql": "SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0352", "split": "test", "db_id": "car_1", "question": "How many countries exist?", "gold_sql": "SELECT count(*) FROM COUNTRIES;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0353", "split": "test", "db_id": "museum_visit", "question": "How many museums were opened after 2013 or before 2008?", "gold_sql": "SELECT count(*) FROM museum WHERE open_year > 2013 OR open_year < 2008", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0354", "split": "test", "db_id": "world_1", "question": "What are the names of the nations with the 3 lowest populations?", "gold_sql": "SELECT Name FROM country ORDER BY Population ASC LIMIT 3", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0355", "split": "test", "db_id": "car_1", "question": "How many car models are produced in the usa?", "gold_sql": "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';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0356", "split": "test", "db_id": "world_1", "question": "What are the population and life expectancies in Brazil?", "gold_sql": "SELECT Population , LifeExpectancy FROM country WHERE Name = \"Brazil\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0357", "split": "test", "db_id": "pets_1", "question": "Find the id of the pet owned by student whose last name is ‘Smith’.", "gold_sql": "SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.Lname = 'Smith'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0358", "split": "test", "db_id": "wta_1", "question": "Find the highest rank of losers in all matches.", "gold_sql": "SELECT min(loser_rank) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0359", "split": "test", "db_id": "concert_singer", "question": "What are the number of concerts that occurred in the stadium with the largest capacity ?", "gold_sql": "select count(*) from concert where stadium_id = (select stadium_id from stadium order by capacity desc limit 1)", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0360", "split": "test", "db_id": "tvshow", "question": "Which country has the most of TV Channels? List the country and number of TV Channels it has.", "gold_sql": "SELECT Country , count(*) FROM TV_Channel GROUP BY Country ORDER BY count(*) DESC LIMIT 1;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0361", "split": "test", "db_id": "wta_1", "question": "Find the total ranking points for each player and their first name.", "gold_sql": "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", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0362", "split": "test", "db_id": "tvshow", "question": "When did the episode \"A Love of a Lifetime\" air?", "gold_sql": "SELECT Air_Date FROM TV_series WHERE Episode = \"A Love of a Lifetime\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0363", "split": "test", "db_id": "network_1", "question": "What are the ids of students who both have friends and are liked?", "gold_sql": "SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0364", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the degree summary name that has the most number of students enrolled?", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0365", "split": "test", "db_id": "battle_death", "question": "What is the ship id and name that caused most total injuries?", "gold_sql": "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", "db_path": "databases/battle_death/battle_death.sqlite", "schema": "CREATE TABLE \"battle\" (\n\"id\" int,\n\"name\" text,\n\"date\" text,\n\"bulgarian_commander\" text,\n\"latin_commander\" text,\n\"result\" text,\nprimary key(\"id\")\n);\nCREATE TABLE \"death\" (\n\"caused_by_ship_id\" int,\n\"id\" int,\n\"note\" text,\n\"killed\" int,\n\"injured\" int,\nprimary key(\"id\"),\nforeign key (\"caused_by_ship_id\") references `ship`(\"id\") \n);\nCREATE TABLE \"ship\" (\n\"lost_in_battle\" int,\n\"id\" int,\n\"name\" text,\n\"tonnage\" text,\n\"ship_type\" text,\n\"location\" text,\n\"disposition_of_ship\" text,\nprimary key(\"id\"),\nforeign key (`lost_in_battle`) references `battle`(\"id\") \n);"} {"qid": "test_0366", "split": "test", "db_id": "employee_hire_evaluation", "question": "Count the number of employees for each city.", "gold_sql": "SELECT count(*) , city FROM employee GROUP BY city", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0367", "split": "test", "db_id": "world_1", "question": "How many type of governments are in Africa?", "gold_sql": "SELECT count(DISTINCT GovernmentForm) FROM country WHERE Continent = \"Africa\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0368", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the id of the semester that had both Masters and Bachelors students enrolled?", "gold_sql": "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'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0369", "split": "test", "db_id": "car_1", "question": "What are the different years in which there were cars produced that weighed less than 4000 and also cars that weighted more than 3000 ?", "gold_sql": "select distinct year from cars_data where weight between 3000 and 4000;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0370", "split": "test", "db_id": "world_1", "question": "Which regions speak Dutch or English?", "gold_sql": "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\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0371", "split": "test", "db_id": "network_1", "question": "Show the number of high schoolers for each grade.", "gold_sql": "SELECT grade , count(*) FROM Highschooler GROUP BY grade", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0372", "split": "test", "db_id": "network_1", "question": "Which grades have 4 or more high schoolers?", "gold_sql": "SELECT grade FROM Highschooler GROUP BY grade HAVING count(*) >= 4", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0373", "split": "test", "db_id": "world_1", "question": "What are the country codes for countries that do not speak English?", "gold_sql": "SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0374", "split": "test", "db_id": "car_1", "question": "What are the different models for the cards produced after 1980?", "gold_sql": "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;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0375", "split": "test", "db_id": "voter_1", "question": "How many contestants did not get voted?", "gold_sql": "SELECT count(*) FROM contestants WHERE contestant_number NOT IN ( SELECT contestant_number FROM votes )", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0376", "split": "test", "db_id": "network_1", "question": "Which grade has the most high schoolers?", "gold_sql": "SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0377", "split": "test", "db_id": "dog_kennels", "question": "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.", "gold_sql": "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", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0378", "split": "test", "db_id": "flight_2", "question": "Return the number of airports.", "gold_sql": "SELECT count(*) FROM AIRPORTS", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0379", "split": "test", "db_id": "employee_hire_evaluation", "question": "Which employee received the most awards in evaluations? Give me the employee name.", "gold_sql": "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", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0380", "split": "test", "db_id": "car_1", "question": "Find the name of the makers that produced some cars in the year of 1970?", "gold_sql": "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';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0381", "split": "test", "db_id": "orchestra", "question": "Show the record companies shared by orchestras founded before 2003 and after 2003.", "gold_sql": "SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0382", "split": "test", "db_id": "world_1", "question": "What are the name, independence year, and surface area of the country with the smallest population?", "gold_sql": "SELECT Name , SurfaceArea , IndepYear FROM country ORDER BY Population LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0383", "split": "test", "db_id": "concert_singer", "question": "For each stadium, how many concerts play there?", "gold_sql": "SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0384", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the names and descriptions for all the sections?", "gold_sql": "SELECT section_name , section_description FROM Sections", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0385", "split": "test", "db_id": "car_1", "question": "What is the minimum weight of the car with 8 cylinders produced in 1974 ?", "gold_sql": "select min(weight) from cars_data where cylinders = 8 and year = 1974", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0386", "split": "test", "db_id": "poker_player", "question": "What are the names of poker players, ordered ascending by the number of final tables they have made?", "gold_sql": "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", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0387", "split": "test", "db_id": "car_1", "question": "How many car makers are there in france?", "gold_sql": "SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country = T2.CountryId WHERE T2.CountryName = 'france';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0388", "split": "test", "db_id": "museum_visit", "question": "What is the total ticket expense of the visitors whose membership level is 1?", "gold_sql": "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", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0389", "split": "test", "db_id": "network_1", "question": "Count the number of high schoolers.", "gold_sql": "SELECT count(*) FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0390", "split": "test", "db_id": "tvshow", "question": "What is the country with the most number of TV Channels and how many does it have?", "gold_sql": "SELECT Country , count(*) FROM TV_Channel GROUP BY Country ORDER BY count(*) DESC LIMIT 1;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0391", "split": "test", "db_id": "car_1", "question": "What are the ids and names of all countries that either have more than 3 car makers or produce fiat model ?", "gold_sql": "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';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0392", "split": "test", "db_id": "world_1", "question": "How many languages are spoken in Aruba?", "gold_sql": "SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = \"Aruba\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0393", "split": "test", "db_id": "student_transcripts_tracking", "question": "What are the first, middle, and last names, along with the ids, of all students who enrolled in 2 degree programs in one semester?", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0394", "split": "test", "db_id": "pets_1", "question": "Find the first name and age of students who have a dog but do not have a cat as a pet.", "gold_sql": "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 T1.stuid NOT 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')", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0395", "split": "test", "db_id": "car_1", "question": "Which model has the most version(make) of cars?", "gold_sql": "SELECT Model FROM CAR_NAMES GROUP BY Model ORDER BY count(*) DESC LIMIT 1;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0396", "split": "test", "db_id": "tvshow", "question": "List the number of different series names and contents in the TV Channel table.", "gold_sql": "SELECT count(DISTINCT series_name) , count(DISTINCT content) FROM TV_Channel;", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0397", "split": "test", "db_id": "dog_kennels", "question": "Find the first names that are used for professionals or owners but are not used as dog names.", "gold_sql": "SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0398", "split": "test", "db_id": "world_1", "question": "What is the most populace city that speaks English?", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0399", "split": "test", "db_id": "orchestra", "question": "What are the orchestras that do not have any performances?", "gold_sql": "SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0400", "split": "test", "db_id": "pets_1", "question": "Find the first name of students who have cat or dog pet.", "gold_sql": "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'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0401", "split": "test", "db_id": "wta_1", "question": "How many matches were played in each year?", "gold_sql": "SELECT count(*) , YEAR FROM matches GROUP BY YEAR", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0402", "split": "test", "db_id": "poker_player", "question": "Give the nationality that is most common across all people.", "gold_sql": "SELECT Nationality FROM people GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0403", "split": "test", "db_id": "world_1", "question": "What are the population, name and leader of the country with the largest area?", "gold_sql": "SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0404", "split": "test", "db_id": "car_1", "question": "Which models are lighter than 3500 but not built by the 'Ford Motor Company'?", "gold_sql": "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';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0405", "split": "test", "db_id": "dog_kennels", "question": "Count the number of dogs of an age below the average.", "gold_sql": "SELECT count(*) FROM Dogs WHERE age < ( SELECT avg(age) FROM Dogs )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0406", "split": "test", "db_id": "world_1", "question": "How long is the people’s average life expectancy in Central Africa?", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Region = \"Central Africa\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0407", "split": "test", "db_id": "course_teach", "question": "Show different hometown of teachers and the number of teachers from each hometown.", "gold_sql": "SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0408", "split": "test", "db_id": "world_1", "question": "Return the names of the 3 countries with the fewest people.", "gold_sql": "SELECT Name FROM country ORDER BY Population ASC LIMIT 3", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0409", "split": "test", "db_id": "flight_2", "question": "How many flights land in Aberdeen or Abilene?", "gold_sql": "SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = \"Aberdeen\" OR T2.city = \"Abilene\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0410", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the codes of template types that have fewer than 3 templates?", "gold_sql": "SELECT template_type_code FROM Templates GROUP BY template_type_code HAVING count(*) < 3", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0411", "split": "test", "db_id": "wta_1", "question": "What is the first name and country code of the oldest player?", "gold_sql": "SELECT first_name , country_code FROM players ORDER BY birth_date LIMIT 1", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0412", "split": "test", "db_id": "wta_1", "question": "What are the first names and country codes for players who won both the WTA Championships and the Australian Open?", "gold_sql": "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'", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0413", "split": "test", "db_id": "orchestra", "question": "How many orchestras does each record company manage?", "gold_sql": "SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company", "db_path": "databases/orchestra/orchestra.sqlite", "schema": "CREATE TABLE \"conductor\" (\n\"Conductor_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"Nationality\" text,\n\"Year_of_Work\" int,\nPRIMARY KEY (\"Conductor_ID\")\n);\nCREATE TABLE \"orchestra\" (\n\"Orchestra_ID\" int,\n\"Orchestra\" text,\n\"Conductor_ID\" int,\n\"Record_Company\" text,\n\"Year_of_Founded\" real,\n\"Major_Record_Format\" text,\nPRIMARY KEY (\"Orchestra_ID\"),\nFOREIGN KEY (`Conductor_ID`) REFERENCES `conductor`(`Conductor_ID`)\n);\nCREATE TABLE \"performance\" (\n\"Performance_ID\" int,\n\"Orchestra_ID\" int,\n\"Type\" text,\n\"Date\" text,\n\"Official_ratings_(millions)\" real,\n\"Weekly_rank\" text,\n\"Share\" text,\nPRIMARY KEY (\"Performance_ID\"),\nFOREIGN KEY (`Orchestra_ID`) REFERENCES `orchestra`(`Orchestra_ID`)\n);\nCREATE TABLE \"show\" (\n\"Show_ID\" int,\n\"Performance_ID\" int,\n\"If_first_show\" bool,\n\"Result\" text,\n\"Attendance\" real,\nFOREIGN KEY (`Performance_ID`) REFERENCES `performance`(`Performance_ID`)\n);"} {"qid": "test_0414", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers and the courses they teach in ascending alphabetical order by the name of the teacher?", "gold_sql": "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", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0415", "split": "test", "db_id": "pets_1", "question": "Find the id and weight of all pets whose age is older than 1.", "gold_sql": "SELECT petid , weight FROM pets WHERE pet_age > 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0416", "split": "test", "db_id": "student_transcripts_tracking", "question": "Find the last name of the students who currently live in the state of North Carolina but have not registered in any degree program.", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0417", "split": "test", "db_id": "poker_player", "question": "List the final tables made and the best finishes of poker players.", "gold_sql": "SELECT Final_Table_Made , Best_Finish FROM poker_player", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0418", "split": "test", "db_id": "student_transcripts_tracking", "question": "Whose permanent address is different from his or her current address? List his or her first name.", "gold_sql": "SELECT first_name FROM Students WHERE current_address_id != permanent_address_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0419", "split": "test", "db_id": "wta_1", "question": "Find the name of tourney that has more than 10 matches.", "gold_sql": "SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*) > 10", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0420", "split": "test", "db_id": "car_1", "question": "What is the number of cars with more than 4 cylinders?", "gold_sql": "SELECT count(*) FROM CARS_DATA WHERE Cylinders > 4;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0421", "split": "test", "db_id": "tvshow", "question": "Find the package choice and series name of the TV channel that has high definition TV.", "gold_sql": "SELECT package_option , series_name FROM TV_Channel WHERE hight_definition_TV = \"yes\"", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0422", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the id of the document with the fewest paragraphs.", "gold_sql": "SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0423", "split": "test", "db_id": "dog_kennels", "question": "Who owns the youngest dog? Give me his or her last name.", "gold_sql": "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 )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0424", "split": "test", "db_id": "world_1", "question": "How many unique languages are spoken in the world?", "gold_sql": "SELECT count(DISTINCT LANGUAGE) FROM countrylanguage", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0425", "split": "test", "db_id": "museum_visit", "question": "Find the average number of staff working for the museums that were open before 2009.", "gold_sql": "SELECT avg(num_of_staff) FROM museum WHERE open_year < 2009", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0426", "split": "test", "db_id": "network_1", "question": "What are the names of the high schoolers and how many friends does each have?", "gold_sql": "SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0427", "split": "test", "db_id": "singer", "question": "What is the sname of every sing that does not have any song?", "gold_sql": "SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song)", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0428", "split": "test", "db_id": "employee_hire_evaluation", "question": "Return the name, location and district of all shops in descending order of number of products.", "gold_sql": "SELECT name , LOCATION , district FROM shop ORDER BY number_products DESC", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0429", "split": "test", "db_id": "dog_kennels", "question": "Which dogs have not cost their owner more than 1000 for treatment ? List the dog names .", "gold_sql": "select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment) > 1000 )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0430", "split": "test", "db_id": "wta_1", "question": "List the number of all matches who played in years of 2013 or 2016.", "gold_sql": "SELECT count(*) FROM matches WHERE YEAR = 2013 OR YEAR = 2016", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0431", "split": "test", "db_id": "car_1", "question": "What is the number of cars with a greater accelerate than the one with the most horsepower?", "gold_sql": "SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate > ( SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1 );", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0432", "split": "test", "db_id": "flight_2", "question": "Return the number of airlines in the USA.", "gold_sql": "SELECT count(*) FROM AIRLINES WHERE Country = \"USA\"", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0433", "split": "test", "db_id": "museum_visit", "question": "What are the id and name of the museum visited most times?", "gold_sql": "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", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0434", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the name and id of the department with the most number of degrees ?", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0435", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Count the number of documents that use the PPT template type.", "gold_sql": "SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT'", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0436", "split": "test", "db_id": "wta_1", "question": "How many different loser names are there?", "gold_sql": "SELECT count(DISTINCT loser_name) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0437", "split": "test", "db_id": "pets_1", "question": "What is the last name of the student who has a cat that is 3 years old?", "gold_sql": "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'", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0438", "split": "test", "db_id": "network_1", "question": "What are the names and grades for each high schooler?", "gold_sql": "SELECT name , grade FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0439", "split": "test", "db_id": "course_teach", "question": "Show names of teachers and the courses they are arranged to teach in ascending alphabetical order of the teacher's name.", "gold_sql": "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", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0440", "split": "test", "db_id": "wta_1", "question": "Find the total number of matches.", "gold_sql": "SELECT count(*) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0441", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the template ids with template type description \"Presentation\".", "gold_sql": "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\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0442", "split": "test", "db_id": "world_1", "question": "Count the number of countries for which Spanish is the predominantly spoken language.", "gold_sql": "SELECT count(*) , max(Percentage) FROM countrylanguage WHERE LANGUAGE = \"Spanish\" GROUP BY CountryCode", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0443", "split": "test", "db_id": "course_teach", "question": "What are the names of the teachers ordered by ascending age?", "gold_sql": "SELECT Name FROM teacher ORDER BY Age ASC", "db_path": "databases/course_teach/course_teach.sqlite", "schema": "CREATE TABLE \"course\" (\n\"Course_ID\" int,\n\"Staring_Date\" text,\n\"Course\" text,\nPRIMARY KEY (\"Course_ID\")\n);\nCREATE TABLE \"course_arrange\" (\n\"Course_ID\" int,\n\"Teacher_ID\" int,\n\"Grade\" int,\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES `course`(\"Course_ID\"),\nFOREIGN KEY (\"Teacher_ID\") REFERENCES `teacher`(\"Teacher_ID\")\n);\nCREATE TABLE \"teacher\" (\n\"Teacher_ID\" int,\n\"Name\" text,\n\"Age\" text,\n\"Hometown\" text,\nPRIMARY KEY (\"Teacher_ID\")\n);"} {"qid": "test_0444", "split": "test", "db_id": "car_1", "question": "What is the maximum miles per gallon of the car with 8 cylinders or produced before 1980 ?", "gold_sql": "select max(mpg) from cars_data where cylinders = 8 or year < 1980", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0445", "split": "test", "db_id": "world_1", "question": "Return the names of the 3 most populated countries.", "gold_sql": "SELECT Name FROM country ORDER BY Population DESC LIMIT 3", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0446", "split": "test", "db_id": "tvshow", "question": "What are the countries that have cartoons on TV that were written by Todd Casey?", "gold_sql": "SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey'", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0447", "split": "test", "db_id": "world_1", "question": "What region is Kabul in?", "gold_sql": "SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = \"Kabul\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0448", "split": "test", "db_id": "pets_1", "question": "How many pets are owned by students that have an age greater than 20?", "gold_sql": "SELECT count(*) FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid WHERE T1.age > 20", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0449", "split": "test", "db_id": "student_transcripts_tracking", "question": "Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 .", "gold_sql": "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'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0450", "split": "test", "db_id": "wta_1", "question": "List the first name and birth date of all players from the country with code USA.", "gold_sql": "SELECT first_name , birth_date FROM players WHERE country_code = 'USA'", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0451", "split": "test", "db_id": "dog_kennels", "question": "Find the first names of owners living in Virginia and the names of dogs they own.", "gold_sql": "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'", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0452", "split": "test", "db_id": "network_1", "question": "Return the name of the high school student with the most friends.", "gold_sql": "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", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0453", "split": "test", "db_id": "concert_singer", "question": "How many singers are from each country?", "gold_sql": "SELECT country , count(*) FROM singer GROUP BY country", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0454", "split": "test", "db_id": "dog_kennels", "question": "Find the number of professionals who have not treated any dogs.", "gold_sql": "SELECT count(*) FROM Professionals WHERE professional_id NOT IN ( SELECT professional_id FROM Treatments )", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0455", "split": "test", "db_id": "car_1", "question": "What is the maximum accelerate for different number of cylinders?", "gold_sql": "SELECT max(Accelerate) , Cylinders FROM CARS_DATA GROUP BY Cylinders;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0456", "split": "test", "db_id": "concert_singer", "question": "What is the maximum capacity and the average of all stadiums ?", "gold_sql": "select max(capacity), average from stadium", "db_path": "databases/concert_singer/concert_singer.sqlite", "schema": "CREATE TABLE \"concert\" (\n\"concert_ID\" int,\n\"concert_Name\" text,\n\"Theme\" text,\n\"Stadium_ID\" text,\n\"Year\" text,\nPRIMARY KEY (\"concert_ID\"),\nFOREIGN KEY (\"Stadium_ID\") REFERENCES \"stadium\"(\"Stadium_ID\")\n);\nCREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Country\" text,\n\"Song_Name\" text,\n\"Song_release_year\" text,\n\"Age\" int,\n\"Is_male\" bool,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"singer_in_concert\" (\n\"concert_ID\" int,\n\"Singer_ID\" text,\nPRIMARY KEY (\"concert_ID\",\"Singer_ID\"),\nFOREIGN KEY (\"concert_ID\") REFERENCES \"concert\"(\"concert_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES \"singer\"(\"Singer_ID\")\n);\nCREATE TABLE \"stadium\" (\n\"Stadium_ID\" int,\n\"Location\" text,\n\"Name\" text,\n\"Capacity\" int,\n\"Highest\" int,\n\"Lowest\" int,\n\"Average\" int,\nPRIMARY KEY (\"Stadium_ID\")\n);"} {"qid": "test_0457", "split": "test", "db_id": "museum_visit", "question": "find the names of museums which have more staff than the minimum staff number of all museums opened after 2010.", "gold_sql": "SELECT name FROM museum WHERE num_of_staff > (SELECT min(num_of_staff) FROM museum WHERE open_year > 2010)", "db_path": "databases/museum_visit/museum_visit.sqlite", "schema": "CREATE TABLE \"museum\" (\n\"Museum_ID\" int,\n\"Name\" text,\n\"Num_of_Staff\" int,\n\"Open_Year\" text,\nPRIMARY KEY (\"Museum_ID\")\n);\nCREATE TABLE \"visit\" (\n\"Museum_ID\" int,\n\"visitor_ID\" text,\n\"Num_of_Ticket\" int,\n\"Total_spent\" real,\nPRIMARY KEY (\"Museum_ID\",\"visitor_ID\"),\nFOREIGN KEY (\"Museum_ID\") REFERENCES `museum`(\"Museum_ID\"),\nFOREIGN KEY (\"visitor_ID\") REFERENCES `visitor`(\"ID\")\n);\nCREATE TABLE \"visitor\" (\n\"ID\" int,\n\"Name\" text,\n\"Level_of_membership\" int,\n\"Age\" int,\nPRIMARY KEY (\"ID\")\n);"} {"qid": "test_0458", "split": "test", "db_id": "tvshow", "question": "List each language and the number of TV Channels using it.", "gold_sql": "SELECT LANGUAGE , count(*) FROM TV_Channel GROUP BY LANGUAGE", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0459", "split": "test", "db_id": "dog_kennels", "question": "Find the states where both owners and professionals live.", "gold_sql": "SELECT state FROM Owners INTERSECT SELECT state FROM Professionals", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0460", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the program id and the summary of the degree that has the most students enrolled?", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0461", "split": "test", "db_id": "dog_kennels", "question": "How much does the most recent treatment cost?", "gold_sql": "SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1", "db_path": "databases/dog_kennels/dog_kennels.sqlite", "schema": "CREATE TABLE `Breeds` (\n`breed_code` VARCHAR(10) PRIMARY KEY ,\n`breed_name` VARCHAR(80)\n);\nCREATE TABLE `Charges` (\n`charge_id` INTEGER PRIMARY KEY ,\n`charge_type` VARCHAR(10),\n`charge_amount` DECIMAL(19,4)\n);\nCREATE TABLE `Dogs` (\n`dog_id` INTEGER PRIMARY KEY ,\n`owner_id` INTEGER NOT NULL,\n`abandoned_yn` VARCHAR(1),\n`breed_code` VARCHAR(10) NOT NULL,\n`size_code` VARCHAR(10) NOT NULL,\n`name` VARCHAR(50),\n`age` VARCHAR(20),\n`date_of_birth` DATETIME,\n`gender` VARCHAR(1),\n`weight` VARCHAR(20),\n`date_arrived` DATETIME,\n`date_adopted` DATETIME,\n`date_departed` DATETIME,\nFOREIGN KEY (`breed_code` ) REFERENCES `Breeds`(`breed_code` ),\nFOREIGN KEY (`size_code` ) REFERENCES `Sizes`(`size_code` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` ),\nFOREIGN KEY (`owner_id` ) REFERENCES `Owners`(`owner_id` )\n);\nCREATE TABLE `Owners` (\n`owner_id` INTEGER PRIMARY KEY ,\n`first_name` VARCHAR(50),\n`last_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Professionals` (\n`professional_id` INTEGER PRIMARY KEY ,\n`role_code` VARCHAR(10) NOT NULL,\n`first_name` VARCHAR(50),\n`street` VARCHAR(50),\n`city` VARCHAR(50),\n`state` VARCHAR(20),\n`zip_code` VARCHAR(20),\n`last_name` VARCHAR(50),\n`email_address` VARCHAR(50),\n`home_phone` VARCHAR(20),\n`cell_number` VARCHAR(20)\n);\nCREATE TABLE `Sizes` (\n`size_code` VARCHAR(10) PRIMARY KEY ,\n`size_description` VARCHAR(80)\n);\nCREATE TABLE `Treatment_Types` (\n`treatment_type_code` VARCHAR(10) PRIMARY KEY ,\n`treatment_type_description` VARCHAR(80)\n);\nCREATE TABLE `Treatments` (\n`treatment_id` INTEGER PRIMARY KEY ,\n`dog_id` INTEGER NOT NULL,\n`professional_id` INTEGER NOT NULL,\n`treatment_type_code` VARCHAR(10) NOT NULL,\n`date_of_treatment` DATETIME,\n`cost_of_treatment` DECIMAL(19,4),\nFOREIGN KEY (`treatment_type_code` ) REFERENCES `Treatment_Types`(`treatment_type_code` ),\nFOREIGN KEY (`professional_id` ) REFERENCES `Professionals`(`professional_id` ),\nFOREIGN KEY (`dog_id` ) REFERENCES `Dogs`(`dog_id` )\n);"} {"qid": "test_0462", "split": "test", "db_id": "wta_1", "question": "Find the name and rank of the 3 youngest winners across all matches.", "gold_sql": "SELECT DISTINCT winner_name , winner_rank FROM matches ORDER BY winner_age LIMIT 3", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0463", "split": "test", "db_id": "world_1", "question": "Which language is the most popular on the Asian continent?", "gold_sql": "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", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0464", "split": "test", "db_id": "car_1", "question": "How many countries does each continent have? List the continent id, continent name and the number of countries.", "gold_sql": "SELECT T1.ContId , T1.Continent , count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId = T2.Continent GROUP BY T1.ContId;", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"} {"qid": "test_0465", "split": "test", "db_id": "world_1", "question": "What are the names of nations speak both English and French?", "gold_sql": "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\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0466", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "How many different templates do all document use?", "gold_sql": "SELECT count(DISTINCT template_id) FROM Documents", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0467", "split": "test", "db_id": "poker_player", "question": "What is the money rank of the tallest poker player?", "gold_sql": "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", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0468", "split": "test", "db_id": "student_transcripts_tracking", "question": "How many degrees does the engineering department offer?", "gold_sql": "SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0469", "split": "test", "db_id": "world_1", "question": "Count the number of countries in Asia.", "gold_sql": "SELECT count(*) FROM country WHERE continent = \"Asia\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0470", "split": "test", "db_id": "wta_1", "question": "How many distinct countries do players come from?", "gold_sql": "SELECT count(DISTINCT country_code) FROM players", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0471", "split": "test", "db_id": "tvshow", "question": "List the title of all Cartoons showed on TV Channel with series name \"Sky Radio\".", "gold_sql": "SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = \"Sky Radio\";", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0472", "split": "test", "db_id": "voter_1", "question": "How many states are there?", "gold_sql": "SELECT count(*) FROM area_code_state", "db_path": "databases/voter_1/voter_1.sqlite", "schema": "CREATE TABLE `AREA_CODE_STATE` (\n `area_code` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, PRIMARY KEY (`area_code`)\n);\nCREATE TABLE `CONTESTANTS` (\n `contestant_number` integer\n, `contestant_name` varchar(50) NOT NULL\n, PRIMARY KEY (`contestant_number`)\n);\nCREATE TABLE `VOTES` (\n `vote_id` integer NOT NULL PRIMARY KEY\n, `phone_number` integer NOT NULL\n, `state` varchar(2) NOT NULL\n, `contestant_number` integer NOT NULL\n, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n, \tFOREIGN KEY (`state`) REFERENCES `AREA_CODE_STATE`(`state`)\n, \tFOREIGN KEY (`contestant_number`) REFERENCES `CONTESTANTS`(`contestant_number`)\n);"} {"qid": "test_0473", "split": "test", "db_id": "world_1", "question": "Give the names of nations that speak both English and French.", "gold_sql": "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\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0474", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the id, line 1, and line 2 of the address with the most students?", "gold_sql": "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", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0475", "split": "test", "db_id": "network_1", "question": "What is the name of the high schooler who has the greatest number of friends?", "gold_sql": "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", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0476", "split": "test", "db_id": "employee_hire_evaluation", "question": "Give me all the information about hiring.", "gold_sql": "SELECT * FROM hiring", "db_path": "databases/employee_hire_evaluation/employee_hire_evaluation.sqlite", "schema": "CREATE TABLE \"employee\" (\n\"Employee_ID\" int,\n\"Name\" text,\n\"Age\" int,\n\"City\" text,\nPRIMARY KEY (\"Employee_ID\")\n);\nCREATE TABLE \"evaluation\" (\n\"Employee_ID\" text,\n\"Year_awarded\" text,\n\"Bonus\" real,\nPRIMARY KEY (\"Employee_ID\",\"Year_awarded\"),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"hiring\" (\n\"Shop_ID\" int,\n\"Employee_ID\" int,\n\"Start_from\" text,\n\"Is_full_time\" bool,\nPRIMARY KEY (\"Employee_ID\"),\nFOREIGN KEY (`Shop_ID`) REFERENCES `shop`(`Shop_ID`),\nFOREIGN KEY (`Employee_ID`) REFERENCES `employee`(`Employee_ID`)\n);\nCREATE TABLE \"shop\" (\n\"Shop_ID\" int,\n\"Name\" text,\n\"Location\" text,\n\"District\" text,\n\"Number_products\" int,\n\"Manager_name\" text,\nPRIMARY KEY (\"Shop_ID\")\n);"} {"qid": "test_0477", "split": "test", "db_id": "singer", "question": "For each citizenship, what is the maximum net worth?", "gold_sql": "SELECT Citizenship , max(Net_Worth_Millions) FROM singer GROUP BY Citizenship", "db_path": "databases/singer/singer.sqlite", "schema": "CREATE TABLE \"singer\" (\n\"Singer_ID\" int,\n\"Name\" text,\n\"Birth_Year\" real,\n\"Net_Worth_Millions\" real,\n\"Citizenship\" text,\nPRIMARY KEY (\"Singer_ID\")\n);\nCREATE TABLE \"song\" (\n\"Song_ID\" int,\n\"Title\" text,\n\"Singer_ID\" int,\n\"Sales\" real,\n\"Highest_Position\" real,\nPRIMARY KEY (\"Song_ID\"),\nFOREIGN KEY (\"Singer_ID\") REFERENCES `singer`(\"Singer_ID\")\n);"} {"qid": "test_0478", "split": "test", "db_id": "world_1", "question": "What is the average expected life expectancy for countries in the region of Central Africa?", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Region = \"Central Africa\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0479", "split": "test", "db_id": "poker_player", "question": "What is the average earnings of poker players with height higher than 200?", "gold_sql": "SELECT avg(T2.Earnings) FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 200", "db_path": "databases/poker_player/poker_player.sqlite", "schema": "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"Nationality\" text,\n\"Name\" text,\n\"Birth_Date\" text,\n\"Height\" real,\nPRIMARY KEY (\"People_ID\")\n);\nCREATE TABLE \"poker_player\" (\n\"Poker_Player_ID\" int,\n\"People_ID\" int,\n\"Final_Table_Made\" real,\n\"Best_Finish\" real,\n\"Money_Rank\" real,\n\"Earnings\" real,\nPRIMARY KEY (\"Poker_Player_ID\"),\nFOREIGN KEY (\"People_ID\") REFERENCES `people`(\"People_ID\")\n);"} {"qid": "test_0480", "split": "test", "db_id": "world_1", "question": "How many continents speak Chinese?", "gold_sql": "SELECT COUNT( DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = \"Chinese\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0481", "split": "test", "db_id": "network_1", "question": "Show the names of high school students and their corresponding number of friends.", "gold_sql": "SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0482", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "What are the ids of documents that have 2 or more paragraphs?", "gold_sql": "SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) >= 2", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0483", "split": "test", "db_id": "world_1", "question": "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?", "gold_sql": "SELECT sum(Population) , GovernmentForm FROM country GROUP BY GovernmentForm HAVING avg(LifeExpectancy) > 72", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0484", "split": "test", "db_id": "world_1", "question": "What is the average life expectancy in African countries that are republics?", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Continent = \"Africa\" AND GovernmentForm = \"Republic\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0485", "split": "test", "db_id": "flight_2", "question": "Return the number of flights.", "gold_sql": "SELECT count(*) FROM FLIGHTS", "db_path": "databases/flight_2/flight_2.sqlite", "schema": "CREATE TABLE 'airlines' (\n\tuid INTEGER PRIMARY KEY, \n\tAirline TEXT, \n\tAbbreviation TEXT, \n\tCountry TEXT\n);\nCREATE TABLE 'airports' (\n\tCity TEXT, \n\tAirportCode TEXT PRIMARY KEY, \n\tAirportName TEXT, \n\tCountry TEXT, \n\tCountryAbbrev TEXT\n);\nCREATE TABLE 'flights' (\n\tAirline INTEGER, \n\tFlightNo INTEGER, \n\tSourceAirport TEXT, \n\tDestAirport TEXT, \n\tPRIMARY KEY(Airline, FlightNo),\n\tFOREIGN KEY (SourceAirport) REFERENCES airports(AirportCode),\n\tFOREIGN KEY (DestAirport) REFERENCES airports(AirportCode)\n);"} {"qid": "test_0486", "split": "test", "db_id": "world_1", "question": "What is average life expectancy in the countries where English is not the official language?", "gold_sql": "SELECT avg(LifeExpectancy) FROM country WHERE Name NOT 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\")", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0487", "split": "test", "db_id": "pets_1", "question": "Find the type and weight of the youngest pet.", "gold_sql": "SELECT pettype , weight FROM pets ORDER BY pet_age LIMIT 1", "db_path": "databases/pets_1/pets_1.sqlite", "schema": "CREATE TABLE Has_Pet (\n StuID\t\tINTEGER,\n PetID\t\tINTEGER,\n FOREIGN KEY(PetID) REFERENCES Pets(PetID),\n FOREIGN KEY(StuID) REFERENCES Student(StuID)\n);\nCREATE TABLE Pets (\n PetID\t\tINTEGER PRIMARY KEY,\n PetType\t\tVARCHAR(20),\n pet_age INTEGER,\n weight REAL\n);\nCREATE TABLE Student (\n StuID \tINTEGER PRIMARY KEY,\n LName\t\tVARCHAR(12),\n Fname\t\tVARCHAR(12),\n Age\t\tINTEGER,\n Sex\t\tVARCHAR(1),\n Major\t\tINTEGER,\n Advisor\t\tINTEGER,\n city_code\tVARCHAR(3)\n);"} {"qid": "test_0488", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Show all template type codes and descriptions.", "gold_sql": "SELECT template_type_code , template_type_description FROM Ref_template_types", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0489", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the first name of the student whose permanent address is different from his or her current one?", "gold_sql": "SELECT first_name FROM Students WHERE current_address_id != permanent_address_id", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0490", "split": "test", "db_id": "student_transcripts_tracking", "question": "What is the description of the department whose name has the substring the computer?", "gold_sql": "SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'", "db_path": "databases/student_transcripts_tracking/student_transcripts_tracking.sqlite", "schema": "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(255),\n`line_2` VARCHAR(255),\n`line_3` VARCHAR(255),\n`city` VARCHAR(255),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(255),\n`country` VARCHAR(255),\n`other_address_details` VARCHAR(255)\n);\nCREATE TABLE `Courses` (\n`course_id` INTEGER PRIMARY KEY,\n`course_name` VARCHAR(255),\n`course_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Degree_Programs` (\n`degree_program_id` INTEGER PRIMARY KEY,\n`department_id` INTEGER NOT NULL,\n`degree_summary_name` VARCHAR(255),\n`degree_summary_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`department_id` ) REFERENCES `Departments`(`department_id` )\n);\nCREATE TABLE `Departments` (\n`department_id` INTEGER PRIMARY KEY,\n`department_name` VARCHAR(255),\n`department_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Sections` (\n`section_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`section_name` VARCHAR(255),\n`section_description` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` )\n);\nCREATE TABLE `Semesters` (\n`semester_id` INTEGER PRIMARY KEY,\n`semester_name` VARCHAR(255),\n`semester_description` VARCHAR(255),\n`other_details` VARCHAR(255)\n);\nCREATE TABLE `Student_Enrolment` (\n`student_enrolment_id` INTEGER PRIMARY KEY,\n`degree_program_id` INTEGER NOT NULL,\n`semester_id` INTEGER NOT NULL,\n`student_id` INTEGER NOT NULL,\n`other_details` VARCHAR(255),\nFOREIGN KEY (`degree_program_id` ) REFERENCES `Degree_Programs`(`degree_program_id` ),\nFOREIGN KEY (`semester_id` ) REFERENCES `Semesters`(`semester_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);\nCREATE TABLE `Student_Enrolment_Courses` (\n`student_course_id` INTEGER PRIMARY KEY,\n`course_id` INTEGER NOT NULL,\n`student_enrolment_id` INTEGER NOT NULL,\nFOREIGN KEY (`course_id` ) REFERENCES `Courses`(`course_id` ),\nFOREIGN KEY (`student_enrolment_id` ) REFERENCES `Student_Enrolment`(`student_enrolment_id` )\n);\nCREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`current_address_id` INTEGER NOT NULL,\n`permanent_address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`ssn` VARCHAR(40),\n`date_first_registered` DATETIME,\n`date_left` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`current_address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`permanent_address_id` ) REFERENCES `Addresses`(`address_id` )\n);\nCREATE TABLE `Transcript_Contents` (\n`student_course_id` INTEGER NOT NULL,\n`transcript_id` INTEGER NOT NULL,\nFOREIGN KEY (`student_course_id` ) REFERENCES `Student_Enrolment_Courses`(`student_course_id` ),\nFOREIGN KEY (`transcript_id` ) REFERENCES `Transcripts`(`transcript_id` )\n);\nCREATE TABLE `Transcripts` (\n`transcript_id` INTEGER PRIMARY KEY,\n`transcript_date` DATETIME,\n`other_details` VARCHAR(255)\n);"} {"qid": "test_0491", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the type code of the template type that the most templates belong to.", "gold_sql": "SELECT template_type_code FROM Templates GROUP BY template_type_code ORDER BY count(*) DESC LIMIT 1", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0492", "split": "test", "db_id": "cre_Doc_Template_Mgt", "question": "Return the ids corresponding to templates with the description 'Presentation'.", "gold_sql": "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\"", "db_path": "databases/cre_Doc_Template_Mgt/cre_Doc_Template_Mgt.sqlite", "schema": "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nTemplate_ID INTEGER,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Template_ID) REFERENCES Templates (Template_ID)\n);\nCREATE TABLE Paragraphs (\nParagraph_ID INTEGER NOT NULL,\nDocument_ID INTEGER NOT NULL,\nParagraph_Text VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Paragraph_ID),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);\nCREATE TABLE Ref_Template_Types (\nTemplate_Type_Code CHAR(15) NOT NULL,\nTemplate_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_Type_Code)\n);\nCREATE TABLE Templates (\nTemplate_ID INTEGER NOT NULL,\nVersion_Number INTEGER NOT NULL,\nTemplate_Type_Code CHAR(15) NOT NULL,\nDate_Effective_From DATETIME,\nDate_Effective_To DATETIME,\nTemplate_Details VARCHAR(255) NOT NULL,\nPRIMARY KEY (Template_ID),\nFOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types (Template_Type_Code)\n);"} {"qid": "test_0493", "split": "test", "db_id": "network_1", "question": "What are the names of high schoolers who have likes, and how many likes does each have?", "gold_sql": "SELECT T2.name , count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0494", "split": "test", "db_id": "wta_1", "question": "What is the best rank of losers across all matches?", "gold_sql": "SELECT min(loser_rank) FROM matches", "db_path": "databases/wta_1/wta_1.sqlite", "schema": "CREATE TABLE matches(\n \"best_of\" INT,\n \"draw_size\" INT,\n \"loser_age\" FLOAT,\n \"loser_entry\" TEXT,\n \"loser_hand\" TEXT,\n \"loser_ht\" INT,\n \"loser_id\" INT,\n \"loser_ioc\" TEXT,\n \"loser_name\" TEXT,\n \"loser_rank\" INT,\n \"loser_rank_points\" INT,\n \"loser_seed\" INT,\n \"match_num\" INT,\n \"minutes\" INT,\n \"round\" TEXT,\n \"score\" TEXT,\n \"surface\" TEXT,\n \"tourney_date\" DATE,\n \"tourney_id\" TEXT,\n \"tourney_level\" TEXT,\n \"tourney_name\" TEXT,\n \"winner_age\" FLOAT,\n \"winner_entry\" TEXT,\n \"winner_hand\" TEXT,\n \"winner_ht\" INT,\n \"winner_id\" INT,\n \"winner_ioc\" TEXT,\n \"winner_name\" TEXT,\n \"winner_rank\" INT,\n \"winner_rank_points\" INT,\n \"winner_seed\" INT,\n \"year\" INT,\n FOREIGN KEY(loser_id) REFERENCES players(player_id),\n FOREIGN KEY(winner_id) REFERENCES players(player_id)\n);\nCREATE TABLE players(\n \"player_id\" INT PRIMARY KEY,\n \"first_name\" TEXT,\n \"last_name\" TEXT,\n \"hand\" TEXT,\n \"birth_date\" DATE,\n \"country_code\" TEXT\n);\nCREATE TABLE rankings(\"ranking_date\" DATE,\"ranking\" INT,\"player_id\" INT,\"ranking_points\" INT,\"tours\" INT,FOREIGN KEY(player_id) REFERENCES players(player_id));"} {"qid": "test_0495", "split": "test", "db_id": "network_1", "question": "Show the names and grades of each high schooler.", "gold_sql": "SELECT name , grade FROM Highschooler", "db_path": "databases/network_1/network_1.sqlite", "schema": "CREATE TABLE Friend(\n\tstudent_id int, \n\tfriend_id int,\n\tprimary key (student_id,friend_id),\n\tforeign key(student_id) references Highschooler(ID),\n\tforeign key (friend_id) references Highschooler(ID)\n);\nCREATE TABLE Highschooler(\n\tID int primary key, \n\tname text, \n\tgrade int);\nCREATE TABLE Likes(\n\tstudent_id int, \n\tliked_id int,\n\tprimary key (student_id, liked_id),\n foreign key (liked_id) references Highschooler(ID),\n foreign key (student_id) references Highschooler(ID)\n);"} {"qid": "test_0496", "split": "test", "db_id": "world_1", "question": "Give the country codes for countries in which people speak langauges that are not English.", "gold_sql": "SELECT DISTINCT CountryCode FROM countrylanguage WHERE LANGUAGE != \"English\"", "db_path": "databases/world_1/world_1.sqlite", "schema": "CREATE TABLE `city` (\n `ID` integer NOT NULL PRIMARY KEY AUTOINCREMENT\n, `Name` char(35) NOT NULL DEFAULT ''\n, `CountryCode` char(3) NOT NULL DEFAULT ''\n, `District` char(20) NOT NULL DEFAULT ''\n, `Population` integer NOT NULL DEFAULT '0'\n, CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE `country` (\n `Code` char(3) NOT NULL DEFAULT ''\n, `Name` char(52) NOT NULL DEFAULT ''\n, `Continent` text NOT NULL DEFAULT 'Asia'\n, `Region` char(26) NOT NULL DEFAULT ''\n, `SurfaceArea` float(10,2) NOT NULL DEFAULT '0.00'\n, `IndepYear` integer DEFAULT NULL\n, `Population` integer NOT NULL DEFAULT '0'\n, `LifeExpectancy` float(3,1) DEFAULT NULL\n, `GNP` float(10,2) DEFAULT NULL\n, `GNPOld` float(10,2) DEFAULT NULL\n, `LocalName` char(45) NOT NULL DEFAULT ''\n, `GovernmentForm` char(45) NOT NULL DEFAULT ''\n, `HeadOfState` char(60) DEFAULT NULL\n, `Capital` integer DEFAULT NULL\n, `Code2` char(2) NOT NULL DEFAULT ''\n, PRIMARY KEY (`Code`)\n);\nCREATE TABLE `countrylanguage` (\n `CountryCode` char(3) NOT NULL DEFAULT ''\n, `Language` char(30) NOT NULL DEFAULT ''\n, `IsOfficial` text NOT NULL DEFAULT 'F'\n, `Percentage` float(4,1) NOT NULL DEFAULT '0.0'\n, PRIMARY KEY (`CountryCode`,`Language`)\n, CONSTRAINT `countryLanguage_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`Code`)\n);\nCREATE TABLE sqlite_sequence(name,seq);"} {"qid": "test_0497", "split": "test", "db_id": "tvshow", "question": "What are the ids of all tv channels that have more than 2 TV channels?", "gold_sql": "SELECT id FROM tv_channel GROUP BY country HAVING count(*) > 2", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0498", "split": "test", "db_id": "tvshow", "question": "list all cartoon titles and their directors ordered by their air date", "gold_sql": "SELECT title , Directed_by FROM Cartoon ORDER BY Original_air_date", "db_path": "databases/tvshow/tvshow.sqlite", "schema": "CREATE TABLE \"Cartoon\" (\n\"id\" real,\n\"Title\" text,\n\"Directed_by\" text,\n\"Written_by\" text,\n\"Original_air_date\" text,\n\"Production_code\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);\nCREATE TABLE \"TV_Channel\" (\n\"id\" text,\n\"series_name\" text,\n\"Country\" text,\n\"Language\" text,\n\"Content\" text,\n\"Pixel_aspect_ratio_PAR\" text,\n\"Hight_definition_TV\" text,\n\"Pay_per_view_PPV\" text,\n\"Package_Option\" text,\nPRIMARY KEY (\"id\")\n);\nCREATE TABLE \"TV_series\" (\n\"id\" real,\n\"Episode\" text,\n\"Air_Date\" text,\n\"Rating\" text,\n\"Share\" real,\n\"18_49_Rating_Share\" text,\n\"Viewers_m\" text,\n\"Weekly_Rank\" real,\n\"Channel\" text,\nPRIMARY KEY (\"id\"),\nFOREIGN KEY (`Channel`) REFERENCES `TV_Channel`(`id`)\n);"} {"qid": "test_0499", "split": "test", "db_id": "car_1", "question": "What is the average edispl for all volvos?", "gold_sql": "SELECT avg(T2.edispl) FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T1.Model = 'volvo';", "db_path": "databases/car_1/car_1.sqlite", "schema": "CREATE TABLE \"car_makers\" ( \n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"Maker\" TEXT, \n\t\"FullName\" TEXT, \n\t\"Country\" TEXT,\n\tFOREIGN KEY (Country) REFERENCES countries(CountryId)\n);\nCREATE TABLE \"car_names\" ( \n\t\"MakeId\" INTEGER PRIMARY KEY, \n\t\"Model\" TEXT, \n\t\"Make\" TEXT,\n\tFOREIGN KEY (Model) REFERENCES model_list (Model)\n);\nCREATE TABLE \"cars_data\" (\n\t\"Id\" INTEGER PRIMARY KEY, \n\t\"MPG\" TEXT, \n\t\"Cylinders\" INTEGER, \n\t\"Edispl\" REAL, \n\t\"Horsepower\" TEXT, \n\t\"Weight\" INTEGER, \n\t\"Accelerate\" REAL, \n\t\"Year\" INTEGER,\n\tFOREIGN KEY (Id) REFERENCES car_names (MakeId)\n);\nCREATE TABLE \"continents\" ( \n\t\"ContId\" INTEGER PRIMARY KEY, \n\t\"Continent\" TEXT \n);\nCREATE TABLE \"countries\" (\n\t\"CountryId\" INTEGER PRIMARY KEY, \n\t\"CountryName\" TEXT, \n\t\"Continent\" INTEGER,\n\tFOREIGN KEY (Continent) REFERENCES continents(ContId)\n);\nCREATE TABLE \"model_list\" ( \n\t\"ModelId\" INTEGER PRIMARY KEY, \n\t\"Maker\" INTEGER, \n\t\"Model\" TEXT UNIQUE,\n\tFOREIGN KEY (Maker) REFERENCES car_makers (Id)\n\n);"}