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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['JASON TRAP', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['JASON', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['JASON TRAP', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'Jason trap' is a title of a film; cast means actor; actor refers to first_name, last_name\nProvide the cast for the film \"Jason trap\".\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.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'JASON TRAP'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'JASON TRAP'", "index": 4400, "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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['JASON TRAP', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['JASON', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['JASON TRAP', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'Jason trap' is a title of a film; cast means actor; actor refers to first_name, last_name\nProvide the cast for the film \"Jason trap\".\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 payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n release_year text, -- example: ['2006']\n rental_rate real, -- example: [0.99, 4.99]\n replacement_cost real, -- example: [20.99, 12.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWho refers to first_name, last_name; the largest payment for rental refers to MAX(SUM(amount))\nWho is the customer with the largest payment for rental films?\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 T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T2.amount) AS num FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T2.amount) AS num FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1", "index": 4401, "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 payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n release_year text, -- example: ['2006']\n rental_rate real, -- example: [0.99, 4.99]\n replacement_cost real, -- example: [20.99, 12.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWho refers to first_name, last_name; the largest payment for rental refers to MAX(SUM(amount))\nWho is the customer with the largest payment for rental films?\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 customer (\n customer_id integer, -- country id, example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n length integer, -- example: [86, 48]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['Sasebo', 'A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'Sasebo' is a city\nWhich country does Sasebo 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.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Sasebo'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Sasebo'", "index": 4402, "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 customer (\n customer_id integer, -- country id, example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n length integer, -- example: [86, 48]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['Sasebo', 'A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'Sasebo' is a city\nWhich country does Sasebo 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 `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n store_id integer, -- example: [1, 2]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Animation', 'Action']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'animation' is a name of a category\nList all the animation titles.\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.title AS per FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Animation'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T3.title AS per FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Animation'", "index": 4403, "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 `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n store_id integer, -- example: [1, 2]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Animation', 'Action']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'animation' is a name of a category\nList all the animation titles.\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 customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n release_year text, -- example: ['2006']\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_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 customers refers to MAX(COUNT(customer_id))\nWhat is the city with the most customers?\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 T.city FROM ( SELECT T1.city, COUNT(T3.customer_id) AS num FROM city AS T1 INNER JOIN address AS T2 ON T2.city_id = T1.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id GROUP BY T1.city ) AS T ORDER BY T.num DESC LIMIT 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T.city FROM ( SELECT T1.city, COUNT(T3.customer_id) AS num FROM city AS T1 INNER JOIN address AS T2 ON T2.city_id = T1.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id GROUP BY T1.city ) AS T ORDER BY T.num DESC LIMIT 1", "index": 4404, "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 customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n release_year text, -- example: ['2006']\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_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 customers refers to MAX(COUNT(customer_id))\nWhat is the city with the most customers?\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 inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactor refers to first_name, last_name; the most film refers to MAX(SUM(film_id))\nWhich actor acted in the most films?\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 T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, SUM(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, SUM(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1", "index": 4405, "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 inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactor refers to first_name, last_name; the most film refers to MAX(SUM(film_id))\nWhich actor acted in the most films?\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 store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfull name refers to first_name, last_name\nPlease indicate the full name of actor id 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 first_name, last_name FROM actor WHERE actor_id = 5", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT first_name, last_name FROM actor WHERE actor_id = 5", "index": 4406, "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 store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfull name refers to first_name, last_name\nPlease indicate the full name of actor id 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 city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nid movies refers to film_id\nHow many id movies have category id 11?\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(film_id) FROM film_category WHERE category_id = 11", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(film_id) FROM film_category WHERE category_id = 11", "index": 4407, "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 city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nid movies refers to film_id\nHow many id movies have category id 11?\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 customer (\n customer_id integer, -- country id, example: [1, 2]\n last_name text, -- example: ['HALL', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BABY HALL', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BABY HALL', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_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 refers to name; BABY HALL film refers to title = 'BABY HALL'\nWhich category does BABY HALL film 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 T3.`name` FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BABY HALL'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T3.`name` FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BABY HALL'", "index": 4408, "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 customer (\n customer_id integer, -- country id, example: [1, 2]\n last_name text, -- example: ['HALL', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BABY HALL', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BABY HALL', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_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 refers to name; BABY HALL film refers to title = 'BABY HALL'\nWhich category does BABY HALL film 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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfull name refers to first_name, last_name; more than 10$ refers to amount > 10\nList the full names of customers who have paid 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 T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10", "index": 4409, "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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfull name refers to first_name, last_name; more than 10$ refers to amount > 10\nList the full names of customers who have paid 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 city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Travel', 'Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_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 category Travel refers to category.name = 'Travel'\nList the descriptions of movies under the category Travel.\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.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Travel'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Travel'", "index": 4410, "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 city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Travel', 'Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_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 category Travel refers to category.name = 'Travel'\nList the descriptions of movies under the category Travel.\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 staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n language_id integer, -- example: [1]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Nagasaki', 'Alberta', 'QLD']\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_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 total payment amount refers to sum(amount)\nCalculate the total payment amount of customers in Nagasaki district.\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(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id WHERE T3.district = 'Nagasaki'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id WHERE T3.district = 'Nagasaki'", "index": 4411, "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 staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n language_id integer, -- example: [1]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Nagasaki', 'Alberta', 'QLD']\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_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 total payment amount refers to sum(amount)\nCalculate the total payment amount of customers in Nagasaki district.\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 address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARGARET', 'MARY', 'PATRICIA']\n last_name text, -- example: ['MOORE', 'SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npercentage = divide(sum(amount where first_name = 'MARGARET' and last_name = 'MOORE'), sum(amount)) * 100%\nCalculate the percentage of total payment of MARGARET MOORE customers.\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(IIF(T2.first_name = 'MARGARET' AND T2.last_name = 'MOORE', T1.amount, 0)) AS REAL) * 100 / SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT CAST(SUM(IIF(T2.first_name = 'MARGARET' AND T2.last_name = 'MOORE', T1.amount, 0)) AS REAL) * 100 / SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id", "index": 4412, "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 address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARGARET', 'MARY', 'PATRICIA']\n last_name text, -- example: ['MOORE', 'SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npercentage = divide(sum(amount where first_name = 'MARGARET' and last_name = 'MOORE'), sum(amount)) * 100%\nCalculate the percentage of total payment of MARGARET MOORE customers.\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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreleased in 2006 refers to release_year = 2006\nHow many film titles were released in 2006?\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(film_id) FROM film WHERE release_year = 2006", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(film_id) FROM film WHERE release_year = 2006", "index": 4413, "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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreleased in 2006 refers to release_year = 2006\nHow many film titles were released in 2006?\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 country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nid 1 to 10 refers to film_id BETWEEN 1 and 10\nList down film titles from id 1 to 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 title FROM film WHERE film_id BETWEEN 1 AND 10", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT title FROM film WHERE film_id BETWEEN 1 AND 10", "index": 4414, "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 country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nid 1 to 10 refers to film_id BETWEEN 1 and 10\nList down film titles from id 1 to 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 city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_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 rental duration refers to max(rental_duration)\nList down all of the film IDs with highest rental duration.\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 film_id FROM film WHERE rental_duration = ( SELECT MAX(rental_duration) FROM film )", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT film_id FROM film WHERE rental_duration = ( SELECT MAX(rental_duration) FROM film )", "index": 4415, "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 city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_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 rental duration refers to max(rental_duration)\nList down all of the film IDs with highest rental duration.\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 country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_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 expensive rental rate refers to max(rental_rate)\nWhich film titles have the most expensive rental rate?\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 film WHERE rental_rate = ( SELECT MAX(rental_rate) FROM film )", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT title FROM film WHERE rental_rate = ( SELECT MAX(rental_rate) FROM film )", "index": 4416, "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 country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_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 expensive rental rate refers to max(rental_rate)\nWhich film titles have the most expensive rental rate?\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 inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['CHILL LUCK', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['CHILL LUCK', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\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 language for film titled \"CHILL LUCK\"?\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 film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'CHILL LUCK'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T2.`name` FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'CHILL LUCK'", "index": 4417, "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 inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['CHILL LUCK', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['CHILL LUCK', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\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 language for film titled \"CHILL LUCK\"?\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 customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['Italian', 'English']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n username text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes', 'Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nItalian is name of language; special featured with deleted scenes refers to special_features = 'deleted scenes'\nHow many Italian film titles were special featured with deleted scenes?\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(T1.film_id) FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T2.`name` = 'Italian' AND T1.special_features = 'deleted scenes'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T2.`name` = 'Italian' AND T1.special_features = 'deleted scenes'", "index": 4418, "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 customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['Italian', 'English']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n username text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes', 'Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nItalian is name of language; special featured with deleted scenes refers to special_features = 'deleted scenes'\nHow many Italian film titles were special featured with deleted scenes?\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 category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n original_language_id integer,\n length integer, -- example: [86, 48]\n rating text, -- example: ['NC-17', 'PG-13', 'PG', 'R', 'G']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n store_id integer, -- example: [1, 2]\n username text, -- example: ['Mike', 'Jon']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfor General Audiences means rating = 'G'; Parental Guidance Suggested means rating = 'PG'; Parents Strongly Cautioned means rating = 'PG-13'; Restricted means rating = 'R'; Adults Only means rating = 'NC-17'; action film refers to category.name = 'action'\nList down all ratings of action film titles.\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.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'action'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'action'", "index": 4419, "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 category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n original_language_id integer,\n length integer, -- example: [86, 48]\n rating text, -- example: ['NC-17', 'PG-13', 'PG', 'R', 'G']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n store_id integer, -- example: [1, 2]\n username text, -- example: ['Mike', 'Jon']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfor General Audiences means rating = 'G'; Parental Guidance Suggested means rating = 'PG'; Parents Strongly Cautioned means rating = 'PG-13'; Restricted means rating = 'R'; Adults Only means rating = 'NC-17'; action film refers to category.name = 'action'\nList down all ratings of action film titles.\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 country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Comedy', 'Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (address_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncomedy is name of category\nList down all film IDs of comedy film titles.\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.film_id FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.name = 'comedy'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.film_id FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.name = 'comedy'", "index": 4420, "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 country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Comedy', 'Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (address_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncomedy is name of category\nList down all film IDs of comedy film titles.\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 film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n language_id integer, -- example: [1]\n length integer, -- example: [86, 48]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\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 Mary Smith's rental ID?\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.rental_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'MARY' AND T1.last_name = 'SMITH'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T2.rental_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'MARY' AND T1.last_name = 'SMITH'", "index": 4421, "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 film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n language_id integer, -- example: [1]\n length integer, -- example: [86, 48]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\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 Mary Smith's rental ID?\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 category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n username text, -- example: ['Mike', 'Jon']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList down all of the customers' first name who were attended by staff with ID 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 DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 1", "index": 4422, "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 category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n username text, -- example: ['Mike', 'Jon']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList down all of the customers' first name who were attended by staff with ID 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 store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BOUND CHEAPER', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BOUND CHEAPER', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList down the actor IDs of film titled \"BOUND CHEAPER\".\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.actor_id FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'BOUND CHEAPER'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T2.actor_id FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'BOUND CHEAPER'", "index": 4423, "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 store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BOUND CHEAPER', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BOUND CHEAPER', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList down the actor IDs of film titled \"BOUND CHEAPER\".\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 film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['JANE', 'PENELOPE', 'NICK']\n last_name text, -- example: ['JACKMAN', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n store_id integer, -- example: [1, 2]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['JANE', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList down all film titles starred by Jane Jackman.\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.title FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T3.first_name = 'JANE' AND T3.last_name = 'JACKMAN'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.title FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T3.first_name = 'JANE' AND T3.last_name = 'JACKMAN'", "index": 4424, "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 film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['JANE', 'PENELOPE', 'NICK']\n last_name text, -- example: ['JACKMAN', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n store_id integer, -- example: [1, 2]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['JANE', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList down all film titles starred by Jane Jackman.\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 city_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BIRD INDEPENDENCE', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BIRD INDEPENDENCE', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactor refers to first_name, last_name\nWho are the actors of film titled \"BIRD INDEPENDENCE\"?\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.first_name, T3.last_name FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T1.title = 'BIRD INDEPENDENCE'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T3.first_name, T3.last_name FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T1.title = 'BIRD INDEPENDENCE'", "index": 4425, "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 city_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BIRD INDEPENDENCE', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BIRD INDEPENDENCE', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactor refers to first_name, last_name\nWho are the actors of film titled \"BIRD INDEPENDENCE\"?\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 film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Animation', 'Action']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n active integer, -- example: [1]\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nanimation film refers to category.name = 'Animation'; total rental rate = sum(rental_rate)\nCalculate the total rental rate for animation film titles.\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(T1.rental_rate) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Animation'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT SUM(T1.rental_rate) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Animation'", "index": 4426, "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 film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Animation', 'Action']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n active integer, -- example: [1]\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nanimation film refers to category.name = 'Animation'; total rental rate = sum(rental_rate)\nCalculate the total rental rate for animation film titles.\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 inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Horror', 'Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n city_id integer, -- example: [300, 576]\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhorror film refers to category.name = 'Horror'; English film refers to language.name = 'English'; percentage = divide(count(film_id where category.name = 'Horror'), count(film_id)) where language.name = 'English' * 100%\nWhat is the percentage of horror film titles in English film titles?\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(IIF(T3.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id INNER JOIN language AS T4 ON T2.language_id = T4.language_id WHERE T4.name = 'English'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT CAST(SUM(IIF(T3.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id INNER JOIN language AS T4 ON T2.language_id = T4.language_id WHERE T4.name = 'English'", "index": 4427, "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 inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Horror', 'Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n city_id integer, -- example: [300, 576]\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhorror film refers to category.name = 'Horror'; English film refers to language.name = 'English'; percentage = divide(count(film_id where category.name = 'Horror'), count(film_id)) where language.name = 'English' * 100%\nWhat is the percentage of horror film titles in English film titles?\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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['NC-17', 'PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['DAY', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nadult film refers to rating = 'NC-17'; rental duration of fewer than 4 days refers to rental_duration < 4\nAmong the adult films, how many of them have a rental duration of fewer than 4 days?\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(film_id) FROM film WHERE rating = 'NC-17' AND rental_duration < 4", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND rental_duration < 4", "index": 4428, "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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['NC-17', 'PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['DAY', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nadult film refers to rating = 'NC-17'; rental duration of fewer than 4 days refers to rental_duration < 4\nAmong the adult films, how many of them have a rental duration of fewer than 4 days?\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 staff (\n staff_id integer, -- example: [1, 2]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nemail address refers to email; active refers to active = 1; between 5/25/2005 at 7:37:47 PM and 5/26/2005 at 10:06:49 AM refers to rental_date between '2005-5-25 07:37:47' and '2005-5-26 10:06:49'\nWrite down the email addresses of active customers who rented between 5/25/2005 at 7:37:47 PM and 5/26/2005 at 10:06:49 AM.\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.email FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.rental_date BETWEEN '2005-5-25 07:37:47' AND '2005-5-26 10:06:49' AND T2.active = 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T2.email FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.rental_date BETWEEN '2005-5-25 07:37:47' AND '2005-5-26 10:06:49' AND T2.active = 1", "index": 4429, "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 staff (\n staff_id integer, -- example: [1, 2]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nemail address refers to email; active refers to active = 1; between 5/25/2005 at 7:37:47 PM and 5/26/2005 at 10:06:49 AM refers to rental_date between '2005-5-25 07:37:47' and '2005-5-26 10:06:49'\nWrite down the email addresses of active customers who rented between 5/25/2005 at 7:37:47 PM and 5/26/2005 at 10:06:49 AM.\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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['LEWIS', 'SARAH', 'MARY', 'PATRICIA']\n last_name text, -- example: ['LEWIS', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal payment = sum(amount)\nCompute the total payment made by Sarah Lewis for film rentals so far.\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(T3.amount) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN payment AS T3 ON T1.rental_id = T3.rental_id WHERE T2.first_name = 'SARAH' AND T2.last_name = 'LEWIS'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT SUM(T3.amount) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN payment AS T3 ON T1.rental_id = T3.rental_id WHERE T2.first_name = 'SARAH' AND T2.last_name = 'LEWIS'", "index": 4430, "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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['LEWIS', 'SARAH', 'MARY', 'PATRICIA']\n last_name text, -- example: ['LEWIS', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal payment = sum(amount)\nCompute the total payment made by Sarah Lewis for film rentals so far.\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 `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['SUSAN', 'PENELOPE', 'NICK']\n last_name text, -- example: ['WILSON', 'GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n payment_date datetime, -- example: ['2005-05-30 03:43:54.0', '2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n language_id integer, -- example: [1]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['SUSAN', 'MARY', 'PATRICIA']\n last_name text, -- example: ['WILSON', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n PRIMARY KEY (staff_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfrom 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM refers to payment_date between '2005-05-30 03:43:54' and '2005-07-31 10:08:29'\nFrom 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM, how many times did Susan Wilson pay for film rentals?\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(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_date BETWEEN '2005-05-30 03:43:54' AND '2005-07-31 10:08:29'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_date BETWEEN '2005-05-30 03:43:54' AND '2005-07-31 10:08:29'", "index": 4431, "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 `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['SUSAN', 'PENELOPE', 'NICK']\n last_name text, -- example: ['WILSON', 'GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n payment_date datetime, -- example: ['2005-05-30 03:43:54.0', '2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n language_id integer, -- example: [1]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['SUSAN', 'MARY', 'PATRICIA']\n last_name text, -- example: ['WILSON', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n PRIMARY KEY (staff_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfrom 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM refers to payment_date between '2005-05-30 03:43:54' and '2005-07-31 10:08:29'\nFrom 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM, how many times did Susan Wilson pay for film rentals?\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 inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['SANDRA', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['SANDRA', 'PENELOPE', 'NICK']\n last_name text, -- example: ['KILMER', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nTell me the title of the film in which Sandra Kilmer is one of the actors.\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.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'SANDRA' AND T2.last_name = 'KILMER'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'SANDRA' AND T2.last_name = 'KILMER'", "index": 4432, "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 inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['SANDRA', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['SANDRA', 'PENELOPE', 'NICK']\n last_name text, -- example: ['KILMER', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address2 text,\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nTell me the title of the film in which Sandra Kilmer is one of the actors.\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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG-13', 'PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Documentary', 'Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ndocumentary film refers to category.name = 'documentary'; rated PG-13 refers to rating = 'PG-13'\nHow many documentary films are rated PG-13?\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(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Documentary' AND T1.rating = 'PG-13'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Documentary' AND T1.rating = 'PG-13'", "index": 4433, "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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG-13', 'PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Documentary', 'Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ndocumentary film refers to category.name = 'documentary'; rated PG-13 refers to rating = 'PG-13'\nHow many documentary films are rated PG-13?\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 film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['PRICE', 'DAY', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_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 name refers to category.name; price per day is more than $30 refers to multiply(rental_duration, rental_rate) > 30\nGive me the title and category name of films whose price per day is more than $30. Please include their special features.\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.title, T3.name, T1.special_features FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.rental_duration * T1.rental_rate > 30", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.title, T3.name, T1.special_features FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.rental_duration * T1.rental_rate > 30", "index": 4434, "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 film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['PRICE', 'DAY', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_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 name refers to category.name; price per day is more than $30 refers to multiply(rental_duration, rental_rate) > 30\nGive me the title and category name of films whose price per day is more than $30. Please include their special features.\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 film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARIA', 'MARY', 'PATRICIA']\n last_name text, -- example: ['MILLER', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nIdentify the number of movies rented by Maria Miller.\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.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller'", "index": 4435, "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 film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARIA', 'MARY', 'PATRICIA']\n last_name text, -- example: ['MILLER', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nIdentify the number of movies rented by Maria Miller.\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 address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['DOROTHY', 'MAX', 'MARY', 'PATRICIA']\n last_name text, -- example: ['TAYLOR', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmovie name refers to title; the most recent refers to max(rental_date)\nName the most recent movie rented by Dorothy Taylor.\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 T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'DOROTHY' AND T1.last_name = 'TAYLOR' ORDER BY T2.rental_date DESC LIMIT 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'DOROTHY' AND T1.last_name = 'TAYLOR' ORDER BY T2.rental_date DESC LIMIT 1", "index": 4436, "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 address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['DOROTHY', 'MAX', 'MARY', 'PATRICIA']\n last_name text, -- example: ['TAYLOR', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmovie name refers to title; the most recent refers to max(rental_date)\nName the most recent movie rented by Dorothy Taylor.\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 staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n city_id integer, -- example: [300, 576]\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['WYOMING STORM', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['WYOMING STORM', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'Wyoming Storm' refers to title = 'WYOMING STORM'\nWhere can you rent the movie 'Wyoming Storm'? Identify the address of the rental store and the rental rate.\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.store_id, T1.address, T4.rental_rate FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id INNER JOIN inventory AS T3 ON T2.store_id = T3.store_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.title = 'WYOMING STORM'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T2.store_id, T1.address, T4.rental_rate FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id INNER JOIN inventory AS T3 ON T2.store_id = T3.store_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.title = 'WYOMING STORM'", "index": 4437, "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 staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n city_id integer, -- example: [300, 576]\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['WYOMING STORM', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['WYOMING STORM', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'Wyoming Storm' refers to title = 'WYOMING STORM'\nWhere can you rent the movie 'Wyoming Storm'? Identify the address of the rental store and the rental rate.\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 film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['DESTINY SATURDAY', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['AUSTIN', 'MARY', 'PATRICIA']\n last_name text, -- example: ['CINTRON', 'AUSTIN', 'LONG', 'SMITH', 'JOHNSON']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['DESTINY SATURDAY', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n rental_duration integer, -- example: [6, 3]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'Destiny Saturday' refers to title = 'DESTINY SATURDAY'; length = subtract(return_date, rental_date)\nHow long did Austin Cintron take to return the movie 'Destiny Saturday'?\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.rental_date - T2.return_date FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'AUSTIN' AND T4.title = 'DESTINY SATURDAY'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T2.rental_date - T2.return_date FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'AUSTIN' AND T4.title = 'DESTINY SATURDAY'", "index": 4438, "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 film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['DESTINY SATURDAY', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['AUSTIN', 'MARY', 'PATRICIA']\n last_name text, -- example: ['CINTRON', 'AUSTIN', 'LONG', 'SMITH', 'JOHNSON']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['DESTINY SATURDAY', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n rental_duration integer, -- example: [6, 3]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'Destiny Saturday' refers to title = 'DESTINY SATURDAY'; length = subtract(return_date, rental_date)\nHow long did Austin Cintron take to return the movie 'Destiny Saturday'?\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 film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['STEPHANIE', 'MITCHELL', 'JUNE', 'MARY', 'PATRICIA']\n last_name text, -- example: ['MITCHELL', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_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 total amount = sum(amount); in June 2005 refers to payment_date like '2005-06%'\nCalculate the total amount paid by Stephanie Mitchell for film rentals in June 2005.\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(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'STEPHANIE' AND T2.last_name = 'MITCHELL' AND SUBSTR(T1.payment_date, 1, 7) = '2005-06'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'STEPHANIE' AND T2.last_name = 'MITCHELL' AND SUBSTR(T1.payment_date, 1, 7) = '2005-06'", "index": 4439, "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 film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['STEPHANIE', 'MITCHELL', 'JUNE', 'MARY', 'PATRICIA']\n last_name text, -- example: ['MITCHELL', 'SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_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 total amount = sum(amount); in June 2005 refers to payment_date like '2005-06%'\nCalculate the total amount paid by Stephanie Mitchell for film rentals in June 2005.\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 payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\na rental rate of 4.99 refers to rental_rate = 4.99; average replacement cost = avg(replacement_cost)\nWhat is the average replacement cost for the movies with a rental rate of 4.99?\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(replacement_cost) FROM film WHERE rental_rate = 4.99", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT AVG(replacement_cost) FROM film WHERE rental_rate = 4.99", "index": 4440, "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 payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\na rental rate of 4.99 refers to rental_rate = 4.99; average replacement cost = avg(replacement_cost)\nWhat is the average replacement cost for the movies with a rental rate of 4.99?\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 customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG-13', 'PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nPG-13 rated movie refers to rating = 'PG-13'; average rental rate = avg(rental_rate)\nWhat is the average rental rate for PG-13 rated movies?\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(rental_rate) FROM film WHERE rating = 'PG-13'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT AVG(rental_rate) FROM film WHERE rating = 'PG-13'", "index": 4441, "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 customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG-13', 'PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nPG-13 rated movie refers to rating = 'PG-13'; average rental rate = avg(rental_rate)\nWhat is the average rental rate for PG-13 rated movies?\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 country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['SHEILA.WELLS@sakilacustomer.org', 'MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfull name refers to first_name, last_name\nIdentify the full name of the customer, who has the following email address: SHEILA.WELLS@sakilacustomer.org.\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 first_name, last_name FROM customer WHERE email = 'SHEILA.WELLS@sakilacustomer.org'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT first_name, last_name FROM customer WHERE email = 'SHEILA.WELLS@sakilacustomer.org'", "index": 4442, "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 country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['SHEILA.WELLS@sakilacustomer.org', 'MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfull name refers to first_name, last_name\nIdentify the full name of the customer, who has the following email address: SHEILA.WELLS@sakilacustomer.org.\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 staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['United Arab Emirates', 'Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nUnited Arab Emirates refers to country = 'United Arab Emirates'\nList all the cities that belong to United Arab Emirates.\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.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'United Arab Emirates'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'United Arab Emirates'", "index": 4443, "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 staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['United Arab Emirates', 'Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nUnited Arab Emirates refers to country = 'United Arab Emirates'\nList all the cities that belong to United Arab Emirates.\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 category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['BURT', 'PENELOPE', 'NICK']\n last_name text, -- example: ['DUKAKIS', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfilm refers to title\nWhat films did Burt Dukakis got star in?\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.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'BURT' AND T2.last_name = 'DUKAKIS'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'BURT' AND T2.last_name = 'DUKAKIS'", "index": 4444, "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 category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['BURT', 'PENELOPE', 'NICK']\n last_name text, -- example: ['DUKAKIS', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfilm refers to title\nWhat films did Burt Dukakis got star in?\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 `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BOUND CHEAPER', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BOUND CHEAPER', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactor refers to first_name, last_name; film \"Bound Cheaper\" refers to title = 'BOUND CHEAPER'\nWho are the actors starred in the film \"Bound Cheaper\"?\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.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'BOUND CHEAPER'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'BOUND CHEAPER'", "index": 4445, "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 `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BOUND CHEAPER', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['BOUND CHEAPER', 'ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactor refers to first_name, last_name; film \"Bound Cheaper\" refers to title = 'BOUND CHEAPER'\nWho are the actors starred in the film \"Bound Cheaper\"?\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 country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['KARL', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['KARL', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfilm refers to title; rated as PG refers to rating = 'PG'\nList all the films that Karl Berr starred in and rated as PG.\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.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'KARL' AND T1.last_name = 'BERRY' AND T3.rating = 'PG'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'KARL' AND T1.last_name = 'BERRY' AND T3.rating = 'PG'", "index": 4446, "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 country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n length integer, -- example: [86, 48]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['KARL', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['KARL', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfilm refers to title; rated as PG refers to rating = 'PG'\nList all the films that Karl Berr starred in and rated as PG.\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 film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Philippines', 'Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList at least 3 cities under the country of Philippines.\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.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'Philippines'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'Philippines'", "index": 4447, "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 film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Philippines', 'Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList at least 3 cities under the country of Philippines.\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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['LUCILLE', 'PENELOPE', 'NICK']\n last_name text, -- example: ['TRACY', 'GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['LUCILLE', 'TRACY', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n original_language_id integer,\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList all the description of the films starring Lucille Tracy?\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.film_id FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id WHERE T2.first_name = 'LUCILLE' AND T2.last_name = 'TRACY'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.film_id FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id WHERE T2.first_name = 'LUCILLE' AND T2.last_name = 'TRACY'", "index": 4448, "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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['LUCILLE', 'PENELOPE', 'NICK']\n last_name text, -- example: ['TRACY', 'GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['LUCILLE', 'TRACY', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n original_language_id integer,\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList all the description of the films starring Lucille Tracy?\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 customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n original_language_id integer,\n replacement_cost real, -- example: [20.99, 12.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Horror', 'Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (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:\nfilm refers to title; Horror category refers to category.name = 'Horror'\nList at least 10 films that falls into the Horror 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 T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror'", "index": 4449, "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 customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n original_language_id integer,\n replacement_cost real, -- example: [20.99, 12.99]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Horror', 'Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (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:\nfilm refers to title; Horror category refers to category.name = 'Horror'\nList at least 10 films that falls into the Horror 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 customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['LUCILLE', 'TRACY', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['LUCILLE', 'PENELOPE', 'NICK']\n last_name text, -- example: ['TRACY', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (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:\naverage rate = divide(sum(rental_rate), count(film_id))\nCalculate the average rate of renting the film that Lucille Tracy got starred.\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.rental_rate) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'LUCILLE' AND T1.last_name = 'TRACY'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT AVG(T3.rental_rate) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'LUCILLE' AND T1.last_name = 'TRACY'", "index": 4450, "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 customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['LUCILLE', 'TRACY', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['LUCILLE', 'PENELOPE', 'NICK']\n last_name text, -- example: ['TRACY', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (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:\naverage rate = divide(sum(rental_rate), count(film_id))\nCalculate the average rate of renting the film that Lucille Tracy got starred.\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 payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n length integer, -- example: [86, 48]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nduration between 100 to 110 minutes refers to length between 100 and 110\nHow many films have a duration between 100 to 110 minutes?\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(film_id) FROM film WHERE length BETWEEN 100 AND 110", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(film_id) FROM film WHERE length BETWEEN 100 AND 110", "index": 4451, "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 payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n length integer, -- example: [86, 48]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nduration between 100 to 110 minutes refers to length between 100 and 110\nHow many films have a duration between 100 to 110 minutes?\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 store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['DEE', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList down the actor ID of actors with Dee as their last name.\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 actor_id FROM actor WHERE last_name = 'Dee'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT actor_id FROM actor WHERE last_name = 'Dee'", "index": 4452, "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 store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['DEE', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nList down the actor ID of actors with Dee as their last name.\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 customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['NINA', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactive refers to active = 1\nAmong the active customers, how many of them have Nina as their first name?\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(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1", "index": 4453, "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 customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['NINA', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactive refers to active = 1\nAmong the active customers, how many of them have Nina as their first name?\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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['NICK', 'PENELOPE']\n last_name text, -- example: ['WAHLBERG', 'GUINESS']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nduration refers to length; the highest rental rate refers to max(rental_rate)\nGive the duration of the film starred by Nick Wahlberg with the highest rental rate.\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.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Nick' AND T1.last_name = 'Wahlberg' ORDER BY T3.rental_rate DESC LIMIT 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Nick' AND T1.last_name = 'Wahlberg' ORDER BY T3.rental_rate DESC LIMIT 1", "index": 4454, "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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MAX', 'MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['NICK', 'PENELOPE']\n last_name text, -- example: ['WAHLBERG', 'GUINESS']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nduration refers to length; the highest rental rate refers to max(rental_rate)\nGive the duration of the film starred by Nick Wahlberg with the highest rental rate.\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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['RUSSELL', 'PENELOPE', 'NICK']\n last_name text, -- example: ['CLOSE', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['RUSSELL', 'MARY', 'PATRICIA']\n last_name text, -- example: ['RUSSELL', 'SMITH', 'JOHNSON']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n original_language_id integer,\n rating text, -- example: ['PG', 'G']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (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:\nWhat are the titles of the films starred by Russell Close?\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.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'Russell' AND T2.last_name = 'Close'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'Russell' AND T2.last_name = 'Close'", "index": 4455, "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 actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['RUSSELL', 'PENELOPE', 'NICK']\n last_name text, -- example: ['CLOSE', 'GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['RUSSELL', 'MARY', 'PATRICIA']\n last_name text, -- example: ['RUSSELL', 'SMITH', 'JOHNSON']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n inventory_id integer, -- example: [367, 1525]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n original_language_id integer,\n rating text, -- example: ['PG', 'G']\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n district text, -- example: ['Alberta', 'QLD']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (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:\nWhat are the titles of the films starred by Russell Close?\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 payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['692 Joliet Street', '47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\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 postal code of the address 692 Joliet Street?\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 postal_code FROM address WHERE address = '692 Joliet Street'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT postal_code FROM address WHERE address = '692 Joliet Street'", "index": 4456, "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 payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n email text, -- example: ['MARY.SMITH@sakilacustomer.org', 'PATRICIA.JOHNSON@sakilacustomer.org']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['692 Joliet Street', '47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\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 postal code of the address 692 Joliet Street?\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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactive refers to active = 1\nHow many customers are active?\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(customer_id) FROM customer WHERE active = 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(customer_id) FROM customer WHERE active = 1", "index": 4457, "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 rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n last_update datetime, -- example: ['2006-02-15 05:05:03.0']\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n postal_code text, -- example: ['35200', '17886']\n last_update datetime, -- example: ['2006-02-15 04:45:30.0']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_duration integer, -- example: [6, 3]\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:57:12.0']\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactive refers to active = 1\nHow many customers are active?\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 actor (\n actor_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n original_language_id integer,\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (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:\nactive refers to active = 1\nAmong all the customers of store no.1, how many of them are active?\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(customer_id) FROM customer WHERE active = 1 AND store_id = 1", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(customer_id) FROM customer WHERE active = 1 AND store_id = 1", "index": 4458, "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 actor (\n actor_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n postal_code text, -- example: ['35200', '17886']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1, 0]\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n original_language_id integer,\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (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:\nactive refers to active = 1\nAmong all the customers of store no.1, how many of them are active?\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 `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n store_id integer, -- example: [1, 2]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\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 address of Mary Smith?\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.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'", "index": 4459, "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 `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n store_id integer, -- example: [1, 2]\n username text, -- example: ['Mike', 'Jon']\n password text, -- example: ['8cb2237d0679ca88db6464eac60da96345513964']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n language_id integer, -- example: [1]\n rental_rate real, -- example: [0.99, 4.99]\n PRIMARY KEY (film_id)\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 address of Mary Smith?\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 staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n active integer, -- example: [1]\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Italy', 'Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfull name refers to first_name, last_name; Italy refers to country = 'Italy'\nPlease list the full names of all the customers who live in Italy.\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 T4.first_name, T4.last_name FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T3.country = 'Italy'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT T4.first_name, T4.last_name FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T3.country = 'Italy'", "index": 4460, "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 staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n active integer, -- example: [1]\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n city_id integer, -- example: [300, 576]\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n release_year text, -- example: ['2006']\n language_id integer, -- example: [1]\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n last_update datetime, -- example: ['2006-02-15 05:03:42.0']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n address_id integer, -- example: [5, 6]\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Italy', 'Afghanistan', 'Algeria']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n last_update datetime, -- example: ['2006-02-15 22:12:30.0', '2006-02-15 22:12:31.0']\n PRIMARY KEY (payment_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfull name refers to first_name, last_name; Italy refers to country = 'Italy'\nPlease list the full names of all the customers who live in Italy.\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 film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_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 total amount = sum(amount)\nWhat is the total amount of money Mary Smith has spent on film rentals?\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(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'", "index": 4461, "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 film_text (\n film_id integer, -- example: [1, 2]\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n title text, -- example: ['ACADEMY DINOSAUR', 'ACE GOLDFINGER']\n description text, -- example: ['A Epic Drama of a Feminist And a Mad Sci', 'A Astounding Epistle of a Database Admin']\n release_year text, -- example: ['2006']\n original_language_id integer,\n rental_rate real, -- example: [0.99, 4.99]\n length integer, -- example: [86, 48]\n replacement_cost real, -- example: [20.99, 12.99]\n rating text, -- example: ['PG', 'G']\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n last_update datetime, -- example: ['2006-02-15 04:46:27.0']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n manager_staff_id integer, -- example: [1, 2]\n address_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n address text, -- example: ['47 MySakila Drive', '28 MySQL Boulevard']\n address2 text,\n district text, -- example: ['Alberta', 'QLD']\n city_id integer, -- example: [300, 576]\n postal_code text, -- example: ['35200', '17886']\n phone text, -- example: ['14033335568', '6172235589']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n last_update datetime, -- example: ['2006-02-15 04:34:33.0']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n country text, -- the name of the country, example: ['Afghanistan', 'Algeria']\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n address_id integer, -- example: [3, 4]\n picture blob, -- picture of the staff, example: ['0x3F504E470D0A1A0A0000000D49484452000000']\n email text, -- email of the staff, example: ['Mike.Hillyer@sakilastaff.com', 'Jon.Stephens@sakilastaff.com']\n store_id integer, -- example: [1, 2]\n active integer, -- example: [1]\n username text, -- example: ['Mike', 'Jon']\n last_update datetime, -- example: ['2006-02-15 04:57:16.0']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n last_update datetime, -- example: ['2006-02-15 05:02:19.0']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n last_update datetime, -- example: ['2006-02-15 05:07:09.0']\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE city (\n city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n last_update datetime, -- example: ['2006-02-15 04:45:25.0']\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n rental_date datetime, -- example: ['2005-05-24 22:53:30.0', '2005-05-24 22:54:33.0']\n inventory_id integer, -- example: [367, 1525]\n customer_id integer, -- example: [130, 459]\n return_date datetime, -- example: ['2005-05-26 22:04:30.0', '2005-05-28 19:40:33.0']\n staff_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 21:30:53.0', '2006-02-23 04:12:08.0']\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n store_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n active integer, -- example: [1, 0]\n create_date datetime, -- example: ['2006-02-14 22:04:36.0', '2006-02-14 22:04:37.0']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 05:09:17.0']\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n rental_id integer, -- example: [76, 573]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_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 total amount = sum(amount)\nWhat is the total amount of money Mary Smith has spent on film rentals?\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 city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n release_year text, -- example: ['2006']\n rental_duration integer, -- example: [6, 3]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nover 4.99 refers to amount > 4.99\nAmong the payments made by Mary Smith, how many of them are over 4.99?\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(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND T1.amount > 4.99", "style": "rule" }
{ "db_id": "movie_3.sqlite", "gt_sql": "SELECT COUNT(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND T1.amount > 4.99", "index": 4462, "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 city_id integer, -- example: [1, 2]\n city text, -- example: ['A Corua (La Corua)', 'Abha']\n country_id integer, -- example: [87, 82]\n PRIMARY KEY (city_id)\n);\n\nCREATE TABLE film_text (\n film_id integer, -- example: [1, 2]\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE staff (\n staff_id integer, -- example: [1, 2]\n first_name text, -- example: ['Mike', 'Jon']\n last_name text, -- example: ['Hillyer', 'Stephens']\n PRIMARY KEY (staff_id)\n);\n\nCREATE TABLE category (\n category_id integer, -- example: [1, 2]\n name text, -- example: ['Action', 'Animation']\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE address (\n address_id integer, -- example: [1, 2]\n district text, -- example: ['Alberta', 'QLD']\n PRIMARY KEY (address_id)\n);\n\nCREATE TABLE actor (\n actor_id integer, -- example: [1, 2]\n first_name text, -- example: ['MARY', 'PENELOPE', 'NICK']\n last_name text, -- example: ['GUINESS', 'WAHLBERG']\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE film_category (\n film_id integer, -- example: [1, 2]\n category_id integer, -- example: [6, 11]\n PRIMARY KEY (film_id, category_id)\n);\n\nCREATE TABLE inventory (\n inventory_id integer, -- example: [1, 2]\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (inventory_id)\n);\n\nCREATE TABLE film (\n film_id integer, -- example: [1, 2]\n release_year text, -- example: ['2006']\n rental_duration integer, -- example: [6, 3]\n replacement_cost real, -- example: [20.99, 12.99]\n special_features text, -- example: ['Deleted Scenes,Behind the Scenes', 'Trailers,Deleted Scenes']\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE film_actor (\n actor_id integer, -- example: [1, 2]\n film_id integer, -- example: [1, 23]\n PRIMARY KEY (actor_id, film_id)\n);\n\nCREATE TABLE country (\n country_id integer, -- example: [1, 2]\n last_update datetime, -- example: ['2006-02-15 04:44:00.0']\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE store (\n store_id integer, -- example: [1, 2]\n PRIMARY KEY (store_id)\n);\n\nCREATE TABLE `language` (\n language_id integer, -- example: [1, 2]\n name text, -- example: ['English', 'Italian']\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE payment (\n payment_id integer, -- example: [1, 2]\n customer_id integer, -- example: [1, 2]\n staff_id integer, -- example: [1, 2]\n amount real, -- example: [2.99, 0.99]\n payment_date datetime, -- example: ['2005-05-25 11:30:37.0', '2005-05-28 10:35:23.0']\n PRIMARY KEY (payment_id)\n);\n\nCREATE TABLE rental (\n rental_id integer, -- example: [1, 2]\n customer_id integer, -- example: [130, 459]\n PRIMARY KEY (rental_id)\n);\n\nCREATE TABLE customer (\n customer_id integer, -- country id, example: [1, 2]\n first_name text, -- example: ['MARY', 'PATRICIA']\n last_name text, -- example: ['SMITH', 'JOHNSON']\n last_update datetime, -- example: ['2006-02-15 04:57:20.0']\n PRIMARY KEY (customer_id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nover 4.99 refers to amount > 4.99\nAmong the payments made by Mary Smith, how many of them are over 4.99?\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" }