data_source
stringclasses
1 value
prompt
listlengths
2
2
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n Capital integer, -- example: [129, 1]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhigh life expectancy at birth refers to MAX(LifeExpectancy);\nList all the cities in the country where there is high life expectancy at birth.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.LifeExpectancy DESC LIMIT 1", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.LifeExpectancy DESC LIMIT 1", "index": 3700, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n Capital integer, -- example: [129, 1]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhigh life expectancy at birth refers to MAX(LifeExpectancy);\nList all the cities in the country where there is high life expectancy at birth.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['F', 'T']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Independence', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Capital integer, -- example: [129, 1]\n Code2 text, -- example: ['US', 'AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nofficial language refers to IsOfficial = 'T'; unofficial language refers to IsOfficial = 'F'; declared independence in 1830 refers to IndepYear = 1830;\nList all the official and unofficial languages used by the country that declared its independence in 1830.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.Language, T2.IsOfficial FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.IndepYear = 1830 GROUP BY T2.Language, T2.IsOfficial", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.Language, T2.IsOfficial FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.IndepYear = 1830 GROUP BY T2.Language, T2.IsOfficial", "index": 3701, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['F', 'T']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Independence', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Capital integer, -- example: [129, 1]\n Code2 text, -- example: ['US', 'AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nofficial language refers to IsOfficial = 'T'; unofficial language refers to IsOfficial = 'F'; declared independence in 1830 refers to IndepYear = 1830;\nList all the official and unofficial languages used by the country that declared its independence in 1830.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n Capital integer, -- example: [129, 1]\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Min', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nsmallest population refers to MIN(Population);\nWhat is the language of the smallest population country?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population ASC LIMIT 1", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population ASC LIMIT 1", "index": 3702, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n Capital integer, -- example: [129, 1]\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Min', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nsmallest population refers to MIN(Population);\nWhat is the language of the smallest population country?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['English', 'Dutch']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Australia', 'Aruba', 'Afghanistan']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n Population integer, -- example: [103000, 22720000]\n LocalName text, -- example: ['Australia', 'Aruba', 'Afganistan/Afqanestan']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nEnglish refers to Language = 'English'; Australia is a name of country;\nWhat is the percentage of English used in Australia?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.Percentage FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Australia' AND T2.Language = 'English'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.Percentage FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Australia' AND T2.Language = 'English'", "index": 3703, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['English', 'Dutch']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Australia', 'Aruba', 'Afghanistan']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n Population integer, -- example: [103000, 22720000]\n LocalName text, -- example: ['Australia', 'Aruba', 'Afganistan/Afqanestan']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nEnglish refers to Language = 'English'; Australia is a name of country;\nWhat is the percentage of English used in Australia?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Ha', 'Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmost crowded city refers to MAX(Population);\nWhich country has the most crowded city in the world?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T1.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1", "index": 3704, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Ha', 'Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmost crowded city refers to MAX(Population);\nWhich country has the most crowded city in the world?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmost crowded city refers to MAX(Population);\nWhat is the life expectancy of residents in the most crowded city?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population DESC LIMIT 1", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population DESC LIMIT 1", "index": 3705, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmost crowded city refers to MAX(Population);\nWhat is the life expectancy of residents in the most crowded city?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Arabic', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n LifeExpectancy real, -- example: [78.4, 45.9]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\naverage life expectancy = AVG(LifeExpectancy); speak Arabic refers to `Language` = 'Arabic';\nWhat is the average life expentancy of countries that speak Arabic?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT AVG(T1.LifeExpectancy) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT AVG(T1.LifeExpectancy) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic'", "index": 3706, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Arabic', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n LifeExpectancy real, -- example: [78.4, 45.9]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\naverage life expectancy = AVG(LifeExpectancy); speak Arabic refers to `Language` = 'Arabic';\nWhat is the average life expentancy of countries that speak Arabic?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Zaanstad', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Capital integer, -- example: [129, 1]\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nZaanstad is a name of city;\nWhat is the district of Zaanstad?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT District FROM City WHERE name = 'Zaanstad'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT District FROM City WHERE name = 'Zaanstad'", "index": 3707, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Zaanstad', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Capital integer, -- example: [129, 1]\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nZaanstad is a name of city;\nWhat is the district of Zaanstad?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nProvide the district of the city with a population of 201843.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT District FROM City WHERE population = 201843", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT District FROM City WHERE population = 201843", "index": 3708, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nProvide the district of the city with a population of 201843.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nHow many countries have a life expectancy of 75.1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM Country WHERE LifeExpectancy = 75.1", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT COUNT(*) FROM Country WHERE LifeExpectancy = 75.1", "index": 3709, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nHow many countries have a life expectancy of 75.1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Independence', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Brunei', 'Aruba', 'Afghanistan']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nyear of independence refers to IndepYear; Brunei is a name of country;\nWhat is the year of independence of Brunei?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT IndepYear FROM Country WHERE Name = 'Brunei'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT IndepYear FROM Country WHERE Name = 'Brunei'", "index": 3710, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Independence', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Brunei', 'Aruba', 'Afghanistan']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nyear of independence refers to IndepYear; Brunei is a name of country;\nWhat is the year of independence of Brunei?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n HeadOfState text, -- example: ['Kostis Stefanopoulos', 'Beatrix', 'Mohammad Omar']\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nruled by Kostis Stefanopoulos refers to HeadOfState = 'Kostis Stefanopoulos';\nHow many cities are there in the country ruled by Kostis Stefanopoulos?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(DISTINCT T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Kostis Stefanopoulos'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT COUNT(DISTINCT T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Kostis Stefanopoulos'", "index": 3711, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n HeadOfState text, -- example: ['Kostis Stefanopoulos', 'Beatrix', 'Mohammad Omar']\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nruled by Kostis Stefanopoulos refers to HeadOfState = 'Kostis Stefanopoulos';\nHow many cities are there in the country ruled by Kostis Stefanopoulos?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Queimados', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nGive the population of the country where Queimados city belongs.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.Population FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Queimados'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.Population FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Queimados'", "index": 3712, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Queimados', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nGive the population of the country where Queimados city belongs.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['CAN', 'AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['CAN', 'ABW', 'AFG']\n Population integer, -- example: [103000, 22720000]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['CAN', 'ABW', 'AFG']\n `Language` text, -- example: ['Min', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nofficial language refers to IsOfficial = 'T'; least population refers to MIN(Population);\nWhat are the official languages of the country where you can find the city with the least population?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.Population ASC LIMIT 1", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.Population ASC LIMIT 1", "index": 3713, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['CAN', 'AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['CAN', 'ABW', 'AFG']\n Population integer, -- example: [103000, 22720000]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['CAN', 'ABW', 'AFG']\n `Language` text, -- example: ['Min', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nofficial language refers to IsOfficial = 'T'; least population refers to MIN(Population);\nWhat are the official languages of the country where you can find the city with the least population?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Continent text, -- example: ['North America', 'Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n Capital integer, -- example: [129, 1]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Namibe', 'Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the surface area and GNP of the country where Namibe district belongs?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.SurfaceArea, T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Namibe'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.SurfaceArea, T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Namibe'", "index": 3714, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Continent text, -- example: ['North America', 'Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n Capital integer, -- example: [129, 1]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Namibe', 'Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the surface area and GNP of the country where Namibe district belongs?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n Capital integer, -- example: [129, 1]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['English', 'Dutch']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nofficially uses English as their language refers to `Language` = 'English' AND IsOfficial = 'T';\nList the names of the country that officially uses English as their language.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T1.Language = 'English'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T1.Language = 'English'", "index": 3715, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n Capital integer, -- example: [129, 1]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['English', 'Dutch']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nofficially uses English as their language refers to `Language` = 'English' AND IsOfficial = 'T';\nList the names of the country that officially uses English as their language.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Entre Rios', 'Kabol', 'Qandahar']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the GNP of the country where district \"Entre Rios\" belongs?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Entre Rios' LIMIT 1", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Entre Rios' LIMIT 1", "index": 3716, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Entre Rios', 'Kabol', 'Qandahar']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the GNP of the country where district \"Entre Rios\" belongs?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['The Valley', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Capital integer, -- example: [129, 1]\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the local name of the country where \"The Valley\" city belongs?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.LocalName FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'The Valley'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.LocalName FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'The Valley'", "index": 3717, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['The Valley', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n District text, -- example: ['Kabol', 'Qandahar']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n SurfaceArea real, -- example: [193.0, 652090.0]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Capital integer, -- example: [129, 1]\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the local name of the country where \"The Valley\" city belongs?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n SurfaceArea real, -- example: [193.0, 652090.0]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Ha', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nsurface area greater than 7000000 refers to SurfaceArea > 7000000;\nList down the cities belongs to the country that has surface area greater than 7000000.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.Name, T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea > 7000000", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.Name, T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea > 7000000", "index": 3718, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n SurfaceArea real, -- example: [193.0, 652090.0]\n Population integer, -- example: [103000, 22720000]\n LifeExpectancy real, -- example: [78.4, 45.9]\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Ha', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nsurface area greater than 7000000 refers to SurfaceArea > 7000000;\nList down the cities belongs to the country that has surface area greater than 7000000.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Calama', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n SurfaceArea real, -- example: [193.0, 652090.0]\n LifeExpectancy real, -- example: [78.4, 45.9]\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the life expectancy of the people living in Calama city?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Calama'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Calama'", "index": 3719, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Dutch', 'English']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Calama', 'Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n SurfaceArea real, -- example: [193.0, 652090.0]\n LifeExpectancy real, -- example: [78.4, 45.9]\n Code2 text, -- example: ['AW', 'AF']\n PRIMARY KEY (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the life expectancy of the people living in Calama city?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Republic', 'Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Capital integer, -- example: [129, 1]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Italian', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nuse Italian as their language refers to `Language` = 'Italian'; percentage = MULTIPLY(DIVIDE(SUM(`Language` = 'Italian' WHERE GovernmentForm = 'Republic'), COUNT(`Language` = 'Italian')), 100); use Italian as their language refers to `Language` = 'Italian'; republic countries refers to GovernmentForm = 'Republic';\nAmong the countries that use Italian as their language, what is the percentage of republic countries?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT CAST(SUM(CASE WHEN T2.GovernmentForm = 'Republic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Italian'", "style": "rule" }
{ "db_id": "world.sqlite", "gt_sql": "SELECT CAST(SUM(CASE WHEN T2.GovernmentForm = 'Republic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Italian'", "index": 3720, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE City (\n ID integer, -- example: [1, 2]\n Name text, -- example: ['Kabul', 'Qandahar']\n CountryCode text, -- example: ['AFG', 'NLD']\n Population integer, -- example: [1780000, 237500]\n PRIMARY KEY (ID),\n CONSTRAINT fk_city_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\n\nCREATE TABLE Country (\n Code text, -- example: ['ABW', 'AFG']\n Name text, -- example: ['Aruba', 'Afghanistan']\n Continent text, -- example: ['North America', 'Asia']\n Region text, -- example: ['Caribbean', 'Southern and Central Asia']\n IndepYear integer, -- Independence Year, example: [1919, 1975]\n LifeExpectancy real, -- example: [78.4, 45.9]\n GNP real, -- Gross National Product, example: [828.0, 5976.0]\n GNPOld real, -- Gross National Product Old, example: [793.0, 7984.0]\n LocalName text, -- example: ['Aruba', 'Afganistan/Afqanestan']\n GovernmentForm text, -- example: ['Republic', 'Nonmetropolitan Territory of The Netherl', 'Islamic Emirate']\n HeadOfState text, -- example: ['Beatrix', 'Mohammad Omar']\n Capital integer, -- example: [129, 1]\n PRIMARY KEY (Code)\n);\n\nCREATE TABLE CountryLanguage (\n CountryCode text, -- example: ['ABW', 'AFG']\n `Language` text, -- example: ['Italian', 'Dutch', 'English']\n IsOfficial text, -- example: ['T', 'F']\n Percentage real, -- example: [5.3, 9.5]\n PRIMARY KEY (CountryCode, `Language`),\n CONSTRAINT fk_countrylanguage_countrycode FOREIGN KEY (CountryCode) REFERENCES Country (Code)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nuse Italian as their language refers to `Language` = 'Italian'; percentage = MULTIPLY(DIVIDE(SUM(`Language` = 'Italian' WHERE GovernmentForm = 'Republic'), COUNT(`Language` = 'Italian')), 100); use Italian as their language refers to `Language` = 'Italian'; republic countries refers to GovernmentForm = 'Republic';\nAmong the countries that use Italian as their language, what is the percentage of republic countries?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Run The Category', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncategory which has the most podcast refers to the category with Max(count(podcast_id))\nHow many podcasts are there in the category which has the most podcasts?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(podcast_id) FROM categories WHERE category = ( SELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 )", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT COUNT(podcast_id) FROM categories WHERE category = ( SELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 )", "index": 3721, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Run The Category', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncategory which has the most podcast refers to the category with Max(count(podcast_id))\nHow many podcasts are there in the category which has the most podcasts?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Brown Suga Diaries', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n title text, -- example: ['Podcast Title', 'Podcast title', 'Itunes', 'iTunes', 'itunes', 'URL']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nurl refers to itunes_url; 'Brown Suga Diaries' is the title of podcast\nProvide the itunes id and url for podcast titled 'Brown Suga Diaries'.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT itunes_id, itunes_url FROM podcasts WHERE title = 'Brown Suga Diaries'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT itunes_id, itunes_url FROM podcasts WHERE title = 'Brown Suga Diaries'", "index": 3722, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Brown Suga Diaries', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n title text, -- example: ['Podcast Title', 'Podcast title', 'Itunes', 'iTunes', 'itunes', 'URL']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nurl refers to itunes_url; 'Brown Suga Diaries' is the title of podcast\nProvide the itunes id and url for podcast titled 'Brown Suga Diaries'.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['how many', 'Spoilers', 'SPOILER', 'rating', 'Rating', 'Which']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['spoilers', 'scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['Spoilers!', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrated 5 refers to rating = 5; contain the word 'spoilers' refers to title like '%spoilers%'; 'art' is the category name;\nHow many people rated 5 for the podcast which title contains the word 'spoiler' under the 'art' category '?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(T3.podcast_id) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title LIKE '%spoilers%' AND T1.category = 'arts' AND T3.rating = 5", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT COUNT(T3.podcast_id) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title LIKE '%spoilers%' AND T1.category = 'arts' AND T3.rating = 5", "index": 3723, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['how many', 'Spoilers', 'SPOILER', 'rating', 'Rating', 'Which']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['spoilers', 'scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['Spoilers!', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrated 5 refers to rating = 5; contain the word 'spoilers' refers to title like '%spoilers%'; 'art' is the category name;\nHow many people rated 5 for the podcast which title contains the word 'spoiler' under the 'art' category '?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['Pop Rocket', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE runs (\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Podcast Title', 'Podcast title', 'Pop Rocket', 'Author', 'author', 'rating']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nPop Rocket' is the title of podcast; in 2016 refers to created_at like'2016%'; rating less than 5 refers to rating < 5; author refers to author_id\nList the authors who created review for podcast titled 'Pop Rocket' in 2016 with rating less than 5.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Pop Rocket' AND T2.created_at LIKE '2016-%' AND T2.rating < 5", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Pop Rocket' AND T2.created_at LIKE '2016-%' AND T2.rating < 5", "index": 3724, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['Pop Rocket', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE runs (\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Podcast Title', 'Podcast title', 'Pop Rocket', 'Author', 'author', 'rating']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nPop Rocket' is the title of podcast; in 2016 refers to created_at like'2016%'; rating less than 5 refers to rating < 5; author refers to author_id\nList the authors who created review for podcast titled 'Pop Rocket' in 2016 with rating less than 5.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Podcast Title', 'Podcast title', 'In the Thick', 'Creation', 'rating', 'Rating']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['In The Thick', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"In The Thick\" is the title of podcast; author refers to author_id; creation date refers to created_at\nFind the author, rating and review creation date of review for podcast title 'In The Thick'.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.author_id, T2.rating, T2.created_at FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'In The Thick' GROUP BY T2.author_id, T2.rating, T2.created_at", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T2.author_id, T2.rating, T2.created_at FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'In The Thick' GROUP BY T2.author_id, T2.rating, T2.created_at", "index": 3725, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Podcast Title', 'Podcast title', 'In the Thick', 'Creation', 'rating', 'Rating']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['In The Thick', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"In The Thick\" is the title of podcast; author refers to author_id; creation date refers to created_at\nFind the author, rating and review creation date of review for podcast title 'In The Thick'.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Which podcast', 'The latest', 'Creation', 'rating', 'Rating', 'To max']\n rating integer, -- example: [5, 1]\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nlatest refers to Max(created_at); date of creation refers to created_at\nWhich podcast was reviewed the latest? State the date of creation, podcast tile and rating.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.podcast_id, T2.created_at, T2.title, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id ORDER BY T2.created_at DESC LIMIT 1", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T1.podcast_id, T2.created_at, T2.title, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id ORDER BY T2.created_at DESC LIMIT 1", "index": 3726, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Which podcast', 'The latest', 'Creation', 'rating', 'Rating', 'To max']\n rating integer, -- example: [5, 1]\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nlatest refers to Max(created_at); date of creation refers to created_at\nWhich podcast was reviewed the latest? State the date of creation, podcast tile and rating.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Podcast Title', 'Podcast title', 'Tech talk', 'Which', 'Does', 'really interesting!']\n rating integer, -- example: [5, 1]\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['SciFi Tech Talk', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npodcast titled 'SciFi Tech Talk' refers to title = 'SciFi Tech Talk'\nWhich category does the podcast titled 'SciFi Tech Talk' belong to?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'SciFi Tech Talk'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'SciFi Tech Talk'", "index": 3727, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Podcast Title', 'Podcast title', 'Tech talk', 'Which', 'Does', 'really interesting!']\n rating integer, -- example: [5, 1]\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['SciFi Tech Talk', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npodcast titled 'SciFi Tech Talk' refers to title = 'SciFi Tech Talk'\nWhich category does the podcast titled 'SciFi Tech Talk' belong to?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Long time listener, calling it quits', 'What is the name of the podcast', 'Long time listener,', 'Title of Review', 'Which', 'Quit']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncomment refers to review; 'Long time listener, calling it quits' is the title of review;  name of the podcast refers to title of podcast; URL refers to itunes_url\nWhat is the name of the podcast in which a commentor left a comment with the title 'Long time listener, calling it quits?' Include the URL of the podcast as well.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT podcast_id, itunes_url FROM podcasts WHERE podcast_id = ( SELECT podcast_id FROM reviews WHERE title = 'Long time listener, calling it quits' )", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT podcast_id, itunes_url FROM podcasts WHERE podcast_id = ( SELECT podcast_id FROM reviews WHERE title = 'Long time listener, calling it quits' )", "index": 3728, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Long time listener, calling it quits', 'What is the name of the podcast', 'Long time listener,', 'Title of Review', 'Which', 'Quit']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncomment refers to review; 'Long time listener, calling it quits' is the title of review;  name of the podcast refers to title of podcast; URL refers to itunes_url\nWhat is the name of the podcast in which a commentor left a comment with the title 'Long time listener, calling it quits?' Include the URL of the podcast as well.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['More Stupider: A 90-Day Fiance Podcast', 'Write', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Review title', 'Belonging', 'rating', 'Rating', 'All the Reviews', 'Review ratings']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npodcast 'More Stupider: A 90-Day Fiance Podcast'  refers to title = 'More Stupider: A 90-Day Fiance Podcast'; rating of 1 refers to rating = 1\nWrite all the review titles and the contents belonging to the podcast 'More Stupider: A 90-Day Fiance Podcast' with a review rating of 1.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT title, content FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'More Stupider: A 90-Day Fiance Podcast' ) AND rating = 1", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT title, content FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'More Stupider: A 90-Day Fiance Podcast' ) AND rating = 1", "index": 3729, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['More Stupider: A 90-Day Fiance Podcast', 'Write', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Review title', 'Belonging', 'rating', 'Rating', 'All the Reviews', 'Review ratings']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npodcast 'More Stupider: A 90-Day Fiance Podcast'  refers to title = 'More Stupider: A 90-Day Fiance Podcast'; rating of 1 refers to rating = 1\nWrite all the review titles and the contents belonging to the podcast 'More Stupider: A 90-Day Fiance Podcast' with a review rating of 1.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['messages', 'scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['LifeAfter/The Message', 'Messages', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['LifeAfter/The Message', 'The Message', 'The message', 'Lifeafter', 'LifeAfter', 'how many']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nLifeAfter/The Message' is the title of podcast; rated below 3 refers to rating < 3\nHow many reviews does 'LifeAfter/The Message' have which were rated below 3?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'LifeAfter/The Message' AND T2.rating <= 3", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'LifeAfter/The Message' AND T2.rating <= 3", "index": 3730, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['messages', 'scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['LifeAfter/The Message', 'Messages', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['LifeAfter/The Message', 'The Message', 'The message', 'Lifeafter', 'LifeAfter', 'how many']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nLifeAfter/The Message' is the title of podcast; rated below 3 refers to rating < 3\nHow many reviews does 'LifeAfter/The Message' have which were rated below 3?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Which', 'Average!']\n rating integer, -- example: [5, 1]\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['More Stupider: A 90-Day Fiance Podcast', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nMore Stupider: A 90-Day Fiance Podcast' is the title of podcast; average rating = Divide (Sum(rating), Count(rating))\nThe 'More Stupider: A 90-Day Fiance Podcast' belongs to which category and what is the average rating of the podcast?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT AVG(T3.rating) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title = 'More Stupider: A 90-Day Fiance Podcast'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT AVG(T3.rating) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title = 'More Stupider: A 90-Day Fiance Podcast'", "index": 3731, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Which', 'Average!']\n rating integer, -- example: [5, 1]\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['More Stupider: A 90-Day Fiance Podcast', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nMore Stupider: A 90-Day Fiance Podcast' is the title of podcast; average rating = Divide (Sum(rating), Count(rating))\nThe 'More Stupider: A 90-Day Fiance Podcast' belongs to which category and what is the average rating of the podcast?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrun at in June 2022 refers to run_at BETWEEN '2022-06-01 00:00:00' and '2022-06-30 23:59:59'; reviews refers to review_added\nHow many total reviews runned at in June 2022 were added to the podcasts?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT SUM(reviews_added) FROM runs WHERE run_at LIKE '2022-06-%'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT SUM(reviews_added) FROM runs WHERE run_at LIKE '2022-06-%'", "index": 3732, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrun at in June 2022 refers to run_at BETWEEN '2022-06-01 00:00:00' and '2022-06-30 23:59:59'; reviews refers to review_added\nHow many total reviews runned at in June 2022 were added to the podcasts?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n title text, -- example: ['how many', 'rating', 'Rating', 'CREATE!', 'Create.', 'Create!']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrating of 3 refers to rating = 3; created during the first quarter of 2015 refers to created_at BETWEEN'2015-01-01T00:00:00-07:00' and '2015-03-31T23:59:59-07:00'\nHow many podcast reviews with a rating of 3 were created during the first quarter of 2015?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(podcast_id) FROM reviews WHERE rating = 3 AND created_at BETWEEN '2015-01-01T00:00:00-07:00' AND '2015-03-31T23:59:59-07:00'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT COUNT(podcast_id) FROM reviews WHERE rating = 3 AND created_at BETWEEN '2015-01-01T00:00:00-07:00' AND '2015-03-31T23:59:59-07:00'", "index": 3733, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n title text, -- example: ['how many', 'rating', 'Rating', 'CREATE!', 'Create.', 'Create!']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrating of 3 refers to rating = 3; created during the first quarter of 2015 refers to created_at BETWEEN'2015-01-01T00:00:00-07:00' and '2015-03-31T23:59:59-07:00'\nHow many podcast reviews with a rating of 3 were created during the first quarter of 2015?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Average!', 'Divided']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncreated in 2019 refers to created_at BETWEEN '2019-01-01T00:00:00' and '2019-12-31T23:59:59'; average rating  = Divide (Sum(rating), Count(podcast_id))\nWhat is the average rating of all the podcasts with reviews created in 2019?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT AVG(rating) FROM reviews WHERE created_at BETWEEN '2019-01-01T00:00:00-07:00' AND '2019-12-31T23:59:59-07:00'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT AVG(rating) FROM reviews WHERE created_at BETWEEN '2019-01-01T00:00:00-07:00' AND '2019-12-31T23:59:59-07:00'", "index": 3734, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Average!', 'Divided']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncreated in 2019 refers to created_at BETWEEN '2019-01-01T00:00:00' and '2019-12-31T23:59:59'; average rating  = Divide (Sum(rating), Count(podcast_id))\nWhat is the average rating of all the podcasts with reviews created in 2019?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['fiction', 'arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nIndicates the title of all podcasts in the fiction category.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'fiction'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'fiction'", "index": 3735, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['fiction', 'arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nIndicates the title of all podcasts in the fiction category.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Itunes', 'iTunes', 'itunes', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n reviews_added integer, -- example: [1215223, 13139]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"151665400\" is itunes_id; id of reviewer refers to author_id\nIndicate the id of the reviewer whose itunes id is 1516665400.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.itunes_id = 1516665400", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.itunes_id = 1516665400", "index": 3736, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Itunes', 'iTunes', 'itunes', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n reviews_added integer, -- example: [1215223, 13139]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"151665400\" is itunes_id; id of reviewer refers to author_id\nIndicate the id of the reviewer whose itunes id is 1516665400.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['month', 'scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Six months', 'how many', 'Six', 'Last review', 'CREATE!', 'Create.']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncreated in last six months of 2016 refers to created_at BETWEEN '2016-07-01T00:00:00-07:00' and '2016-12-31T23:59:59-07:00'\nIn how many categories were podcast reviews created in the last six months of 2016? List them.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(DISTINCT T1.category) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at BETWEEN '2016-07-01T00:00:00-07:00' AND '2016-12-31T23:59:59-07:00'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT COUNT(DISTINCT T1.category) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at BETWEEN '2016-07-01T00:00:00-07:00' AND '2016-12-31T23:59:59-07:00'", "index": 3737, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['month', 'scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Six months', 'how many', 'Six', 'Last review', 'CREATE!', 'Create.']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncreated in last six months of 2016 refers to created_at BETWEEN '2016-07-01T00:00:00-07:00' and '2016-12-31T23:59:59-07:00'\nIn how many categories were podcast reviews created in the last six months of 2016? List them.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Average!', 'Divided']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncategory art refers to category = 'arts'; average rating = Divide (Sum (rating), Count (podcast_id))\nWhat is the average rating of all the podcasts in category art?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts'", "index": 3738, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Average!', 'Divided']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncategory art refers to category = 'arts'; average rating = Divide (Sum (rating), Count (podcast_id))\nWhat is the average rating of all the podcasts in category art?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['global', 'scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['URL', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the category and itune url of the title \"Scaling Global\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.category, T2.itunes_url FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Scaling Global'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T1.category, T2.itunes_url FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Scaling Global'", "index": 3739, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['global', 'scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['URL', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWhat is the category and itune url of the title \"Scaling Global\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['To max', 'max', 'Max', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreview refers to content; longest review refers to Max(content)\nWhat is the longest review?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT title FROM reviews ORDER BY LENGTH(content) DESC LIMIT 1", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT title FROM reviews ORDER BY LENGTH(content) DESC LIMIT 1", "index": 3740, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['To max', 'max', 'Max', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreview refers to content; longest review refers to Max(content)\nWhat is the longest review?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['length', 'Length', 'Which', 'max', 'Max', 'really interesting!']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['MUSIC PODCAST', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmusic podcasts refers to category = 'music'; longest title refers to title = Max(length(title))\nWhich \"music\" podcast has the longest title?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'music' ORDER BY LENGTH(T2.title) DESC LIMIT 1", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'music' ORDER BY LENGTH(T2.title) DESC LIMIT 1", "index": 3741, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE runs (\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['length', 'Length', 'Which', 'max', 'Max', 'really interesting!']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['MUSIC PODCAST', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmusic podcasts refers to category = 'music'; longest title refers to title = Max(length(title))\nWhich \"music\" podcast has the longest title?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Absolutely', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Absolutely fantastic!!', 'Absolutely fantastic!!!', 'Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreview refers to content; 'Absolutely fantastic' in it refers to content like '%Absolutely fantastic%'\nWhat are the titles and categories of all the podcasts with a review that has \"Absolutely fantastic\" in it?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.title, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T3.content LIKE '%Absolutely fantastic%'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T2.title, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T3.content LIKE '%Absolutely fantastic%'", "index": 3742, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Absolutely', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Absolutely fantastic!!', 'Absolutely fantastic!!!', 'Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreview refers to content; 'Absolutely fantastic' in it refers to content like '%Absolutely fantastic%'\nWhat are the titles and categories of all the podcasts with a review that has \"Absolutely fantastic\" in it?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['Stuff You Should Know', 'Stuff You Should Do', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Stuff you should know', 'Stuff You Should Know', 'You Should Know', 'You should know', 'You should', 'Stuff you should know.']\n content text, -- example: ['Stuff You Should Know!', 'Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Stuff You Should Know\" is the title of podcast; earliest refers to Min(created_at)\nWhat is the content of the earliest review for the \"Stuff You Should Know\" podcast?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Stuff You Should Know' ORDER BY T2.created_at ASC LIMIT 1", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Stuff You Should Know' ORDER BY T2.created_at ASC LIMIT 1", "index": 3743, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['Stuff You Should Know', 'Stuff You Should Do', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Stuff you should know', 'Stuff You Should Know', 'You Should Know', 'You should know', 'You should', 'Stuff you should know.']\n content text, -- example: ['Stuff You Should Know!', 'Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Stuff You Should Know\" is the title of podcast; earliest refers to Min(created_at)\nWhat is the content of the earliest review for the \"Stuff You Should Know\" podcast?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Planet money', 'Planet Money', 'how many', 'Does', 'Planet Money>>', 'really interesting!']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n title text, -- example: ['Planet Money', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Planet Money\" is the title of podcast\nHow many reviews does \"Planet Money\" have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(T2.podcast_id) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Planet Money'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT COUNT(T2.podcast_id) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Planet Money'", "index": 3744, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Planet money', 'Planet Money', 'how many', 'Does', 'Planet Money>>', 'really interesting!']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n title text, -- example: ['Planet Money', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Planet Money\" is the title of podcast\nHow many reviews does \"Planet Money\" have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Average!', 'Divided']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n reviews_added integer, -- example: [1215223, 13139]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"crime-junkie\" podcast refers to title = 'crime-junkie'; average rating = Divide (Sum(rating), Count(rating))\nWhat is the average rating for the \"crime-junkie\" podcast?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Crime Junkie'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Crime Junkie'", "index": 3745, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Average!', 'Divided']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n rating integer, -- example: [5, 1]\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_id integer, -- example: [1313466221, 158973461]\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n reviews_added integer, -- example: [1215223, 13139]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"crime-junkie\" podcast refers to title = 'crime-junkie'; average rating = Divide (Sum(rating), Count(rating))\nWhat is the average rating for the \"crime-junkie\" podcast?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['technology', 'arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['All of them.', 'All of Them.', 'All Of Them', 'ALL OF THEM', 'Percentage', 'Technology']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"technology\" podcast refers to category = 'technology'; percentage = Divide (Count (podcast_id (category = 'technology')), Count (podcast_id)) * 100\nWhat percentage of podcasts are \"technology\" podcasts? List all of them.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT CAST(SUM(CASE WHEN T1.category = 'technology' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.title) OR '%' \"percentage\" FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT CAST(SUM(CASE WHEN T1.category = 'technology' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.title) OR '%' \"percentage\" FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id", "index": 3746, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['technology', 'arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n itunes_url text, -- example: ['https://podcasts.apple.com/us/podcast/sc', 'https://podcasts.apple.com/us/podcast/co']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['All of them.', 'All of Them.', 'All Of Them', 'ALL OF THEM', 'Percentage', 'Technology']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n created_at text, -- example: ['2018-04-24T12:05:16-07:00', '2018-05-09T18:14:32-07:00']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"technology\" podcast refers to category = 'technology'; percentage = Divide (Count (podcast_id (category = 'technology')), Count (podcast_id)) * 100\nWhat percentage of podcasts are \"technology\" podcasts? List all of them.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts-performing-arts', 'arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['really interesting!', 'Must listen for anyone interested in the']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncategory 'arts-performing-arts' refers to category = 'arts-performing-arts';\nPlease list the titles of all the podcasts under the category \"arts-performing-arts\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts-performing-arts'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts-performing-arts'", "index": 3747, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts-performing-arts', 'arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n slug text, -- example: ['scaling-global', 'cornerstone-baptist-church-of-orlando']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['really interesting!', 'Must listen for anyone interested in the']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncategory 'arts-performing-arts' refers to category = 'arts-performing-arts';\nPlease list the titles of all the podcasts under the category \"arts-performing-arts\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Scaling Global', 'Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['how many', 'CREATE!', 'Create.', 'Create!', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Scaling Global\" is the title of podcast\nHow many reviews are created for the podcast \"Scaling Global\" under?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(T2.content) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Scaling Global'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT COUNT(T2.content) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Scaling Global'", "index": 3748, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Scaling Global', 'Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n max_rowid integer, -- max row id, example: [3266481, 3300773]\n reviews_added integer, -- example: [1215223, 13139]\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['how many', 'CREATE!', 'Create.', 'Create!', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Scaling Global\" is the title of podcast\nHow many reviews are created for the podcast \"Scaling Global\" under?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Author', 'author', 'Which', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nauthor whose ID is F7E5A318989779D refers to author_id = 'F7E5A318989779D'\nPlease list the titles of the podcasts for which the author whose ID is F7E5A318989779D has written a review.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'F7E5A318989779D'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT T2.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'F7E5A318989779D'", "index": 3749, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE runs (\n run_at text, -- example: ['2021-05-10 02:53:00', '2021-06-06 21:34:36']\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Author', 'author', 'Which', 'really interesting!', 'Must listen for anyone interested in the']\n content text, -- example: ['Thanks for providing these insights. Re', 'Super excited to see this podcast grow. ']\n author_id text, -- example: ['F7E5A318989779D', 'F6BF5472689BD12']\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nauthor whose ID is F7E5A318989779D refers to author_id = 'F7E5A318989779D'\nPlease list the titles of the podcasts for which the author whose ID is F7E5A318989779D has written a review.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['how many', 'Ratings', 'rating', 'Rating', 'Sally', 'Excuses']\n rating integer, -- example: [5, 1]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Please Excuse My Dead Aunt Sally', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrating of 5 refers to rating = 5; 'Please Excuse My Dead Aunt Sally' is the title of podcast\nHow many ratings of 5 have been given to the podcast \"Please Excuse My Dead Aunt Sally\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.rating = 5", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.rating = 5", "index": 3750, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['how many', 'Ratings', 'rating', 'Rating', 'Sally', 'Excuses']\n rating integer, -- example: [5, 1]\n);\n\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Please Excuse My Dead Aunt Sally', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrating of 5 refers to rating = 5; 'Please Excuse My Dead Aunt Sally' is the title of podcast\nHow many ratings of 5 have been given to the podcast \"Please Excuse My Dead Aunt Sally\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Please Excuse My Dead Aunt Sally', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Sally', 'Average!']\n rating integer, -- example: [5, 1]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Please Excuse My Dead Aunty Sally\" is the title of podcast; Average rating = Divide (Sum(rating), Count(rating))\nWhat is the average rating of the podcast \"Please Excuse My Dead Aunt Sally\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally'", "style": "rule" }
{ "db_id": "music_platform_2.sqlite", "gt_sql": "SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally'", "index": 3751, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE podcasts (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n title text, -- example: ['Please Excuse My Dead Aunt Sally', 'Scaling Global', 'Cornerstone Baptist Church of Orlando']\n PRIMARY KEY (podcast_id)\n);\n\nCREATE TABLE categories (\n podcast_id text, -- example: ['a00018b54eb342567c94dacfb2a3e504', 'a00043d34e734b09246d17dc5d56f63c']\n category text, -- example: ['arts', 'arts-performing-arts']\n PRIMARY KEY (podcast_id, category)\n);\n\nCREATE TABLE reviews (\n podcast_id text, -- example: ['c61aa81c9b929a66f0c1db6cbe5d8548', 'ad4f2bf69c72b8db75978423c25f379e']\n title text, -- example: ['Average', 'average', 'rating', 'Rating', 'Sally', 'Average!']\n rating integer, -- example: [5, 1]\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Please Excuse My Dead Aunty Sally\" is the title of podcast; Average rating = Divide (Sum(rating), Count(rating))\nWhat is the average rating of the podcast \"Please Excuse My Dead Aunt Sally\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhave at least 80,000 students refers to num_students > 8000; year = 2011\nHow many universities have at least 80,000 students in the year 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011", "index": 3752, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhave at least 80,000 students refers to num_students > 8000; year = 2011\nHow many universities have at least 80,000 students in the year 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest student staff ratio refers to max(student_staff_ratio)\nWhat is the student staff ratio of the university with the highest student staff ratio of all time?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT MAX(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT MAX(student_staff_ratio) FROM university_year )", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT MAX(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT MAX(student_staff_ratio) FROM university_year )", "index": 3753, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest student staff ratio refers to max(student_staff_ratio)\nWhat is the student staff ratio of the university with the highest student staff ratio of all time?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nHow many criteria belong to ranking system ID 3?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(id) FROM ranking_criteria WHERE ranking_system_id = 3", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(id) FROM ranking_criteria WHERE ranking_system_id = 3", "index": 3754, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nHow many criteria belong to ranking system ID 3?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhas only 1% of international students refers to pct_international_students = 1; between 2011 to 2015 refers to year BETWEEN 2011 AND 2015; ID of university refers to university_id\nWhat is the ID of the university that has only 1% of international students between 2011 to 2015?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT university_id FROM university_year WHERE pct_international_students = 1 AND year BETWEEN 2011 AND 2015", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT university_id FROM university_year WHERE pct_international_students = 1 AND year BETWEEN 2011 AND 2015", "index": 3755, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhas only 1% of international students refers to pct_international_students = 1; between 2011 to 2015 refers to year BETWEEN 2011 AND 2015; ID of university refers to university_id\nWhat is the ID of the university that has only 1% of international students between 2011 to 2015?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhad the highest number of international students refers to max(pct_international_students); for 6 consecutive years refers to count(SUBTRACT(year, rm)) > = 6; name of university refers to university_name;\nWhat is the name of the university that had the highest number of international students for 6 consecutive years?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.pct_international_students DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.pct_international_students DESC LIMIT 1", "index": 3756, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhad the highest number of international students refers to max(pct_international_students); for 6 consecutive years refers to count(SUBTRACT(year, rm)) > = 6; name of university refers to university_name;\nWhat is the name of the university that had the highest number of international students for 6 consecutive years?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Publications Rank', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nIn 2014 refers to year = 2014; leader refers to MAX(score); in the publications rank refers to criteria_name = 'Publications Rank'; name of university refers to university_name;\nIn 2014, what is the name of the university which was considered a leader in the publications rank?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Publications Rank' AND T2.year = 2014 AND T1.id = 17 ORDER BY T2.score DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Publications Rank' AND T2.year = 2014 AND T1.id = 17 ORDER BY T2.score DESC LIMIT 1", "index": 3757, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Publications Rank', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nIn 2014 refers to year = 2014; leader refers to MAX(score); in the publications rank refers to criteria_name = 'Publications Rank'; name of university refers to university_name;\nIn 2014, what is the name of the university which was considered a leader in the publications rank?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['United States of America', 'Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin the United States of America refers to country_name = 'United States of America';\nHow many universities are there in the United States of America?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'United States of America'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'United States of America'", "index": 3758, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['United States of America', 'Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin the United States of America refers to country_name = 'United States of America';\nHow many universities are there in the United States of America?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Award', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbetween 2005 to 2015 refers to year BETWEEN 2005 AND 2015; scored 0 refers to score = 0; in Awards refers to criteria_name = 'Award'\nHow many universities scored 0 in Awards between 2005 to 2015?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Award' AND T2.year BETWEEN 2005 AND 2015 AND T2.score = 0", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Award' AND T2.year BETWEEN 2005 AND 2015 AND T2.score = 0", "index": 3759, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Award', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbetween 2005 to 2015 refers to year BETWEEN 2005 AND 2015; scored 0 refers to score = 0; in Awards refers to criteria_name = 'Award'\nHow many universities scored 0 in Awards between 2005 to 2015?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['University of Oxford', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nUniversity of Oxford refers to university_name = 'University of Oxford'; which country refers to country_name\nWhich country is the University of Oxford located?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE university_name = 'University of Oxford'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE university_name = 'University of Oxford'", "index": 3760, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['University of Oxford', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nUniversity of Oxford refers to university_name = 'University of Oxford'; which country refers to country_name\nWhich country is the University of Oxford located?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Quality of Education Rank', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Yale University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nYale University refers to university_name = 'Yale University'; a score of no less than 10 refers to score > = 10; in the Quality of Education Rank refers to criteria_name = 'Quality of Education Rank'\nHow many times did the Yale University achieve a score of no less than 10 in the Quality of Education Rank?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'Yale University' AND T2.score >= 10 AND T1.criteria_name = 'Quality of Education Rank'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'Yale University' AND T2.score >= 10 AND T1.criteria_name = 'Quality of Education Rank'", "index": 3761, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Quality of Education Rank', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Yale University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nYale University refers to university_name = 'Yale University'; a score of no less than 10 refers to score > = 10; in the Quality of Education Rank refers to criteria_name = 'Quality of Education Rank'\nHow many times did the Yale University achieve a score of no less than 10 in the Quality of Education Rank?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Center for World University Rankings', 'Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnames of the criteria refers to criteria_name; under Center for World University Rankings refers to system_name = 'Center for World University Rankings';\nWhat are the names of the criteria under Center for World University Rankings?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings'", "index": 3762, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Center for World University Rankings', 'Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnames of the criteria refers to criteria_name; under Center for World University Rankings refers to system_name = 'Center for World University Rankings';\nWhat are the names of the criteria under Center for World University Rankings?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhave no less than 50,000 students refers to num_students > 50000; name of university refers to university_name;\nList the names of all the universities that have no less than 50,000 students in the year 2012.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.num_students > 50000 AND T1.year = 2012", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.num_students > 50000 AND T1.year = 2012", "index": 3763, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhave no less than 50,000 students refers to num_students > 50000; name of university refers to university_name;\nList the names of all the universities that have no less than 50,000 students in the year 2012.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nBetween 2011 to 2016 refers to year BETWEEN 2011 AND 2016; at least 50% of its students are international students refers to pct_international_students > 50; which country refers to country_name\nBetween 2011 to 2016, in which countries can you find the universities where at least 50% of its students are international students?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT DISTINCT T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.pct_international_students > 50 AND T2.year BETWEEN 2011 AND 2016", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT DISTINCT T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.pct_international_students > 50 AND T2.year BETWEEN 2011 AND 2016", "index": 3764, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nBetween 2011 to 2016 refers to year BETWEEN 2011 AND 2016; at least 50% of its students are international students refers to pct_international_students > 50; which country refers to country_name\nBetween 2011 to 2016, in which countries can you find the universities where at least 50% of its students are international students?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['United States of America', 'Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhave no less than 20,000 female students refers to DIVIDE(MULTIPLY(pct_female_students, num_students), 100) > 20000; in 2016 refers to year = 2016; located in the United States of America refers to country_name = 'United States of America'\nHow many universities have no less than 20,000 female students in 2016? Identify how many of the said universities are located in the United States of America.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) , SUM(CASE WHEN T3.country_name = 'United States of America' THEN 1 ELSE 0 END) AS nums_in_usa FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2016 AND T2.num_students * T2.pct_female_students / 100 > 20000", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) , SUM(CASE WHEN T3.country_name = 'United States of America' THEN 1 ELSE 0 END) AS nums_in_usa FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2016 AND T2.num_students * T2.pct_female_students / 100 > 20000", "index": 3765, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['United States of America', 'Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhave no less than 20,000 female students refers to DIVIDE(MULTIPLY(pct_female_students, num_students), 100) > 20000; in 2016 refers to year = 2016; located in the United States of America refers to country_name = 'United States of America'\nHow many universities have no less than 20,000 female students in 2016? Identify how many of the said universities are located in the United States of America.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe largest student staff ratio refers to max(student_staff_ratio)\nWhat is the university ID of the university with the largest student staff ratio?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT university_id FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT university_id FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1", "index": 3766, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe largest student staff ratio refers to max(student_staff_ratio)\nWhat is the university ID of the university with the largest student staff ratio?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhad the lowest number of students refers to MIN(num_students)\nGive the year where a university had the lowest number of students.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT year FROM university_year ORDER BY num_students ASC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT year FROM university_year ORDER BY num_students ASC LIMIT 1", "index": 3767, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhad the lowest number of students refers to MIN(num_students)\nGive the year where a university had the lowest number of students.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\naverage percentage of female students refers to avg(pct_female_students)\nCompute the average percentage of female students.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT AVG(pct_female_students) FROM university_year", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT AVG(pct_female_students) FROM university_year", "index": 3768, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\naverage percentage of female students refers to avg(pct_female_students)\nCompute the average percentage of female students.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Quality of Education Rank', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncriteria named Quality of Education Rank refers to criteria_name = 'Quality of Education Rank'; ranking system refers to system_name;\nProvide the ranking system of the ranking criteria named Quality of Education Rank.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Quality of Education Rank'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Quality of Education Rank'", "index": 3769, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Quality of Education Rank', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncriteria named Quality of Education Rank refers to criteria_name = 'Quality of Education Rank'; ranking system refers to system_name;\nProvide the ranking system of the ranking criteria named Quality of Education Rank.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Brown University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nBrown University refers to university_name = 'Brown University'; in 2014 refers to year = 2014\nWhat is the ranking criteria ID of Brown University in 2014?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.ranking_criteria_id FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Brown University' AND T1.year = 2014", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.ranking_criteria_id FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Brown University' AND T1.year = 2014", "index": 3770, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Brown University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nBrown University refers to university_name = 'Brown University'; in 2014 refers to year = 2014\nWhat is the ranking criteria ID of Brown University in 2014?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2015 refers to year = 2015\nWhat is the criteria name of the university ID 32 in 2015?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.criteria_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.university_id = 32 AND T2.year = 2015", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.criteria_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.university_id = 32 AND T2.year = 2015", "index": 3771, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2015 refers to year = 2015\nWhat is the criteria name of the university ID 32 in 2015?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe most populated university refers to max(num_students); in 2014 refers to year = 2014\nIn which country does the most populated university in 2014 located ?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.country_id FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2014 ORDER BY T1.num_students DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T2.country_id FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2014 ORDER BY T1.num_students DESC LIMIT 1", "index": 3772, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe most populated university refers to max(num_students); in 2014 refers to year = 2014\nIn which country does the most populated university in 2014 located ?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnumber of students greater than 98% of the average student population of all universities refers to num_students >  MULTPLY(num_students, 0.98); in 2013 refers to year = 2013\nProvide the country name of universities with the number of students greater than 98% of the average student population of all universities in 2013.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT DISTINCT T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2013 AND T2.num_students * 100 > ( SELECT AVG(num_students) FROM university_year ) * 98", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT DISTINCT T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2013 AND T2.num_students * 100 > ( SELECT AVG(num_students) FROM university_year ) * 98", "index": 3773, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnumber of students greater than 98% of the average student population of all universities refers to num_students >  MULTPLY(num_students, 0.98); in 2013 refers to year = 2013\nProvide the country name of universities with the number of students greater than 98% of the average student population of all universities in 2013.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nscore below 80 refers to score < 80; in 2015 refers to year 2015; percentage of international students refers to DIVIDE(SUM(DIVIDE(MULTIPLY(num_students, pct_international_students), 100)), SUM(num_students))\nAmong universities that score below 80 in 2015, what is the percentage of international students?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) / COUNT(*) * 100 FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score < 80 AND T1.year = 2015", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) / COUNT(*) * 100 FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score < 80 AND T1.year = 2015", "index": 3774, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nscore below 80 refers to score < 80; in 2015 refers to year 2015; percentage of international students refers to DIVIDE(SUM(DIVIDE(MULTIPLY(num_students, pct_international_students), 100)), SUM(num_students))\nAmong universities that score below 80 in 2015, what is the percentage of international students?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year = 2011; female students refers to SUM(DIVIDE(MULTIPLY(num_students, pct_female_students), 100))\nAmong all universities, how many female students were there in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year = 2011", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year = 2011", "index": 3775, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year = 2011; female students refers to SUM(DIVIDE(MULTIPLY(num_students, pct_female_students), 100))\nAmong all universities, how many female students were there in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmost students refers to MAX(num_students), in 2011 refers to year = 2011\nWhat is the university ID with the most students in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT university_id FROM university_year WHERE year = 2011 ORDER BY num_students DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT university_id FROM university_year WHERE year = 2011 ORDER BY num_students DESC LIMIT 1", "index": 3776, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmost students refers to MAX(num_students), in 2011 refers to year = 2011\nWhat is the university ID with the most students in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ninstitutions with over 50,000 students refers to num_students > 50000; in 2011 refers to year = 2011; percentage of oversea students of more than 10% refers to pct_international_students > 10;\nHow many institutions with over 50,000 students in 2011 had a percentage of oversea students of more than 10%?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM university_year WHERE year = 2011 AND num_students > 50000 AND pct_international_students > 10", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM university_year WHERE year = 2011 AND num_students > 50000 AND pct_international_students > 10", "index": 3777, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ninstitutions with over 50,000 students refers to num_students > 50000; in 2011 refers to year = 2011; percentage of oversea students of more than 10% refers to pct_international_students > 10;\nHow many institutions with over 50,000 students in 2011 had a percentage of oversea students of more than 10%?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2012 refers to year = 2012; highest percentage of female students  refers to MAX(pct_female_students); ID of the university refers to university_id\nProvide the ID of the university with the highest percentage of female students in 2012.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT university_id FROM university_year WHERE year = 2012 ORDER BY pct_female_students DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT university_id FROM university_year WHERE year = 2012 ORDER BY pct_female_students DESC LIMIT 1", "index": 3778, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2012 refers to year = 2012; highest percentage of female students  refers to MAX(pct_female_students); ID of the university refers to university_id\nProvide the ID of the university with the highest percentage of female students in 2012.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year = 2011; had the most students refers to MAX(num_students); name of university refers to university_name;\nName the university that had the most students in 2011.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 ORDER BY T1.num_students DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 ORDER BY T1.num_students DESC LIMIT 1", "index": 3779, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year = 2011; had the most students refers to MAX(num_students); name of university refers to university_name;\nName the university that had the most students in 2011.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Stanford University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; female students refers to DIVIDE(MULTIPLY(pct_female_students, num_students), 100); Stanford University refers to university_name = 'Stanford University';\nHow many female students were there at Stanford University in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT CAST(T1.num_students * T1.pct_female_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T2.university_name = 'Stanford University'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT CAST(T1.num_students * T1.pct_female_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T2.university_name = 'Stanford University'", "index": 3780, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Stanford University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; female students refers to DIVIDE(MULTIPLY(pct_female_students, num_students), 100); Stanford University refers to university_name = 'Stanford University';\nHow many female students were there at Stanford University in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nTeaching criteria refers to criteria_name = 'Teaching'; name of the ranking system refers to system_name\nWhat is the name of the ranking system for Teaching criteria?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Teaching'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Teaching'", "index": 3781, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nTeaching criteria refers to criteria_name = 'Teaching'; name of the ranking system refers to system_name\nWhat is the name of the ranking system for Teaching criteria?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin Argentina refers to country_name = 'Argentina';  most famous refers to MAX(SUM(score))\nName the most famous university in Argentina.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.university_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'Argentina' GROUP BY T1.university_name ORDER BY SUM(T2.score) DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.university_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'Argentina' GROUP BY T1.university_name ORDER BY SUM(T2.score) DESC LIMIT 1", "index": 3782, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin Argentina refers to country_name = 'Argentina';  most famous refers to MAX(SUM(score))\nName the most famous university in Argentina.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Center for World University Rankings', 'Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nranking system Center for World University Rankings refers to system_name = 'Center for World University Rankings';\nHow many criteria are associated with ranking system Center for World University Rankings?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(T2.criteria_name) FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(T2.criteria_name) FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings'", "index": 3783, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Center for World University Rankings', 'Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nranking system Center for World University Rankings refers to system_name = 'Center for World University Rankings';\nHow many criteria are associated with ranking system Center for World University Rankings?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; earned a score of 90 refers to score = 90;\nHow many students at the university earned a score of 90 in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score = 90 AND T1.year = 2011", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score = 90 AND T1.year = 2011", "index": 3784, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; earned a score of 90 refers to score = 90;\nHow many students at the university earned a score of 90 in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; had over 30000 students refers to num_students > 30000;\nHow many universities had over 30000 students in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM university_year WHERE year = 2011 AND num_students > 30000", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM university_year WHERE year = 2011 AND num_students > 30000", "index": 3785, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; had over 30000 students refers to num_students > 30000;\nHow many universities had over 30000 students in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Center for World University Rankings', 'Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe Center for World University Rankings refers to system_name = 'Center for World University Rankings';\nProvide the ranking system ID of the Center for World University Rankings.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT id FROM ranking_system WHERE system_name = 'Center for World University Rankings'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT id FROM ranking_system WHERE system_name = 'Center for World University Rankings'", "index": 3786, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Center for World University Rankings', 'Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe Center for World University Rankings refers to system_name = 'Center for World University Rankings';\nProvide the ranking system ID of the Center for World University Rankings.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhad above 30% of international students refers to pct_international_students > 30; in 2013 refers to year = 2013\nHow many universities had above 30% of international students in 2013?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM university_year WHERE pct_international_students > 30 AND year = 2013", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM university_year WHERE pct_international_students > 30 AND year = 2013", "index": 3787, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhad above 30% of international students refers to pct_international_students > 30; in 2013 refers to year = 2013\nHow many universities had above 30% of international students in 2013?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; less than 50 scores refers to score < 50;\nHow many universities got less than 50 scores under ranking criteria ID 6 in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT COUNT(*) FROM university_ranking_year WHERE ranking_criteria_id = 6 AND year = 2011 AND score < 50", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT COUNT(*) FROM university_ranking_year WHERE ranking_criteria_id = 6 AND year = 2011 AND score < 50", "index": 3788, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; less than 50 scores refers to score < 50;\nHow many universities got less than 50 scores under ranking criteria ID 6 in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Yale University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnumber of students refers to num_students; Yale University refers to university_name = 'Yale University'; in 2016 refers to year = 2016\nProvide the number of students at Yale University in 2016.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.num_students FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Yale University' AND T1.year = 2016", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.num_students FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Yale University' AND T1.year = 2016", "index": 3789, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Yale University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnumber of students refers to num_students; Yale University refers to university_name = 'Yale University'; in 2016 refers to year = 2016\nProvide the number of students at Yale University in 2016.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['University of São Paulo', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe University of São Paulo refers to university_name = 'University of São Paulo'; which country refers to country_name;\nWhich country has the University of São Paulo?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'University of São Paulo'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'University of São Paulo'", "index": 3790, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['University of São Paulo', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe University of São Paulo refers to university_name = 'University of São Paulo'; which country refers to country_name;\nWhich country has the University of São Paulo?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nHarvard University refers to university_name = 'Harvard University'; international students refers to DIVIDE(MULTIPLY(num_students, pct_international_students), 100); in 2012 refers to year = 2012\nHow many international students attended Harvard University in 2012?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT CAST(T2.num_students * T2.pct_international_students AS REAL) / 100 FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id WHERE T1.university_name = 'Harvard University' AND T2.year = 2012", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT CAST(T2.num_students * T2.pct_international_students AS REAL) / 100 FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id WHERE T1.university_name = 'Harvard University' AND T2.year = 2012", "index": 3791, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nHarvard University refers to university_name = 'Harvard University'; international students refers to DIVIDE(MULTIPLY(num_students, pct_international_students), 100); in 2012 refers to year = 2012\nHow many international students attended Harvard University in 2012?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Arizona State University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfemale students refers to DIVIDE(MULTIPLY(pct_female_students, num_students), 100); at Arizona State University refers to university_name = 'Arizona State University'; in 2014 refers to year = 2014\nCalculate the number of female students at Arizona State University in 2014.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT CAST(T2.num_students * T2.pct_female_students AS REAL) / 100 FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id WHERE T1.university_name = 'Arizona State University' AND T2.year = 2014", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT CAST(T2.num_students * T2.pct_female_students AS REAL) / 100 FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id WHERE T1.university_name = 'Arizona State University' AND T2.year = 2014", "index": 3792, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Arizona State University', 'Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfemale students refers to DIVIDE(MULTIPLY(pct_female_students, num_students), 100); at Arizona State University refers to university_name = 'Arizona State University'; in 2014 refers to year = 2014\nCalculate the number of female students at Arizona State University in 2014.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngot the highest scores refers to MAX(SUM(score))\nProvide the universities which got the highest scores.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.university_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id GROUP BY T1.university_name ORDER BY SUM(T2.score) DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.university_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id GROUP BY T1.university_name ORDER BY SUM(T2.score) DESC LIMIT 1", "index": 3793, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngot the highest scores refers to MAX(SUM(score))\nProvide the universities which got the highest scores.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Shanghai Ranking', 'Times Higher Education World University ']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nShanghai Ranking system refers to system_name = 'Shanghai Ranking'; ranking criteria refers to criteria_name\nList the ranking criteria under the Shanghai Ranking system.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Shanghai Ranking'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Shanghai Ranking'", "index": 3794, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Shanghai Ranking', 'Times Higher Education World University ']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nShanghai Ranking system refers to system_name = 'Shanghai Ranking'; ranking criteria refers to criteria_name\nList the ranking criteria under the Shanghai Ranking system.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; got the lowest score refers to MIN(score), teaching criteria refers to criteria_name = 'Teaching'\nIn 2011, which university got the lowest score in teaching criteria?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 ORDER BY T2.score ASC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 ORDER BY T2.score ASC LIMIT 1", "index": 3795, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2011 refers to year 2011; got the lowest score refers to MIN(score), teaching criteria refers to criteria_name = 'Teaching'\nIn 2011, which university got the lowest score in teaching criteria?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Quality of Education Rank', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe \"Quality of Education Rank\" criteria refers to criteria_name = 'Quality of Education Rank'; ranking system refers to system_name\nProvide the ranking system name for the \"Quality of Education Rank\" criteria.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Quality of Education Rank'", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Quality of Education Rank'", "index": 3796, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Quality of Education Rank', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe \"Quality of Education Rank\" criteria refers to criteria_name = 'Quality of Education Rank'; ranking system refers to system_name\nProvide the ranking system name for the \"Quality of Education Rank\" criteria.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngot a score above 80 refers to score > 80; under International criteria refers to criteria_name = 'International'; in 2016 refers to year = 2016; highest score refers to MAX(score)\nHow many percent of universities got a score above 80 under International criteria in 2016? Among them, name the university which got the highest score.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT CAST(SUM(CASE WHEN T2.score > 80 THEN 1 ELSE 0 END) AS REAL) / COUNT(*), ( SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'International' AND T2.year = 2016 AND T2.score > 80 ORDER BY T2.score DESC LIMIT 1 ) AS max FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'International' AND T2.year = 2016", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT CAST(SUM(CASE WHEN T2.score > 80 THEN 1 ELSE 0 END) AS REAL) / COUNT(*), ( SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'International' AND T2.year = 2016 AND T2.score > 80 ORDER BY T2.score DESC LIMIT 1 ) AS max FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'International' AND T2.year = 2016", "index": 3797, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngot a score above 80 refers to score > 80; under International criteria refers to criteria_name = 'International'; in 2016 refers to year = 2016; highest score refers to MAX(score)\nHow many percent of universities got a score above 80 under International criteria in 2016? Among them, name the university which got the highest score.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Alumni', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nunder Alumni criteria refers to criteria_name = 'Alumni'; in 2008 refers to year = 2008; average score refers to DIVIDE(SUM(score), COUNT(university_id))\nCalculate the average score per university under Alumni criteria in 2008.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT AVG(T2.score) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Alumni' AND T2.year = 2008", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT AVG(T2.score) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Alumni' AND T2.year = 2008", "index": 3798, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n system_name text, -- example: ['Times Higher Education World University ', 'Shanghai Ranking']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['Alumni', 'Teaching', 'International']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n score integer, -- example: [100, 98]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\n\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nunder Alumni criteria refers to criteria_name = 'Alumni'; in 2008 refers to year = 2008; average score refers to DIVIDE(SUM(score), COUNT(university_id))\nCalculate the average score per university under Alumni criteria in 2008.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }
nl2sql
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest number of international students refers to MAX(DIVIDE(MULTIPLY(num_students, pct_international_students), 100)); in 2015 refers to year = 2015; name of university refers to university_name;\nName the university and country which had the highest number of international students in 2015.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "role": "user" } ]
nl2sql
{ "ground_truth": "SELECT T1.university_name, T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2015 ORDER BY T2.num_students DESC LIMIT 1", "style": "rule" }
{ "db_id": "university.sqlite", "gt_sql": "SELECT T1.university_name, T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2015 ORDER BY T2.num_students DESC LIMIT 1", "index": 3799, "question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE university (\n id integer, -- example: [1, 2]\n country_id integer, -- example: [73, 72]\n university_name text, -- example: ['Harvard University', 'Massachusetts Institute of Technology']\n PRIMARY KEY (id),\n CONSTRAINT fk_university_country_id FOREIGN KEY (country_id) REFERENCES country (id)\n);\n\nCREATE TABLE university_year (\n university_id integer, -- example: [1, 5]\n `year` integer, -- example: [2011, 2012]\n num_students integer, -- number of students, example: [20152, 2243]\n student_staff_ratio real, -- example: [8.9, 6.9]\n pct_international_students integer, -- pct internation student, example: [25, 27]\n pct_female_students integer, -- example: [33, 37]\n CONSTRAINT fk_university_year_university_id FOREIGN KEY (university_id) REFERENCES university (id)\n);\n\nCREATE TABLE ranking_criteria (\n id integer, -- example: [1, 2]\n ranking_system_id integer, -- example: [1, 2]\n criteria_name text, -- example: ['International', 'Teaching']\n PRIMARY KEY (id),\n CONSTRAINT fk_ranking_criteria_ranking_system_id FOREIGN KEY (ranking_system_id) REFERENCES ranking_system (id)\n);\n\nCREATE TABLE country (\n id integer, -- example: [1, 2]\n country_name text, -- example: ['Argentina', 'Australia']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE ranking_system (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE university_ranking_year (\n university_id integer, -- example: [1, 5]\n ranking_criteria_id integer, -- example: [1, 2]\n `year` integer, -- example: [2011, 2012]\n CONSTRAINT fk_university_ranking_year_university_id FOREIGN KEY (university_id) REFERENCES university (id),\n CONSTRAINT fk_university_ranking_year_ranking_criteria_id FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest number of international students refers to MAX(DIVIDE(MULTIPLY(num_students, pct_international_students), 100)); in 2015 refers to year = 2015; name of university refers to university_name;\nName the university and country which had the highest number of international students in 2015.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n", "split": "train" }