spider_train_prompts / spider_prompt_train.json
nicolof88's picture
Upload spider_prompt_train.json
a0e0a3f verified
[{"train_prompt": "<s>[INST] \n### INSTRUCTIONS\nYou are a tool to generate a SQLite SQL statement based on the given question and database schema.\nYour answer should ONLY be a SQL statement, and strictly no other content. If you can't generate an answer with the given schema, return \"NOT SURE\" only.\n\n### SCHEMA\nCREATE TABLE \"School\" (\n\"School_id\" text,\n\"School_name\" text,\n\"Location\" text,\n\"Mascot\" text,\n\"Enrollment\" int,\n\"IHSAA_Class\" text,\n\"IHSAA_Football_Class\" text,\n\"County\" text,\nPRIMARY KEY (\"School_id\")\n);\n\nCREATE TABLE \"budget\" (\n\"School_id\" int,\n\"Year\" int,\n\"Budgeted\" int,\n\"total_budget_percent_budgeted\" real,\n\"Invested\" int,\n\"total_budget_percent_invested\" real,\n\"Budget_invested_percent\" text,\nPRIMARY KEY(\"School_id\",\"YEAR\"),\nFOREIGN KEY(\"School_id\") REFERENCES \"School\"(\"School_id\")\n\n);\n\nCREATE TABLE \"endowment\" (\n\"endowment_id\" int,\n\"School_id\" int,\n\"donator_name\" text,\n\"amount\" real,\nPRIMARY KEY(\"endowment_id\"),\nFOREIGN KEY(\"School_id\") REFERENCES \"School\"(\"School_id\")\n);\n\n### QUESTION\nList all the names of schools with an endowment amount smaller than or equal to 10.\n\n### ANSWER [/INST]\nSELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount) <= 10 </s>"}, {"train_prompt": "<s>[INST] \n### INSTRUCTIONS\nYou are a tool to generate a SQLite SQL statement based on the given question and database schema.\nYour answer should ONLY be a SQL statement, and strictly no other content. If you can't generate an answer with the given schema, return \"NOT SURE\" only.\n\n### SCHEMA\nCREATE TABLE actor (\n actor_id SMALLINT UNSIGNED NOT NULL,\n first_name VARCHAR(45) NOT NULL,\n last_name VARCHAR(45) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (actor_id)\n);\n\nCREATE TABLE address (\n address_id SMALLINT UNSIGNED NOT NULL,\n address VARCHAR(50) NOT NULL,\n address2 VARCHAR(50) DEFAULT NULL,\n district VARCHAR(20) NOT NULL,\n city_id SMALLINT UNSIGNED NOT NULL,\n postal_code VARCHAR(10) DEFAULT NULL,\n phone VARCHAR(20) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (address_id),\n FOREIGN KEY (city_id) REFERENCES city (city_id)\n);\n\nCREATE TABLE category (\n category_id TINYINT UNSIGNED NOT NULL,\n name VARCHAR(25) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (category_id)\n);\n\nCREATE TABLE city (\n city_id SMALLINT UNSIGNED NOT NULL,\n city VARCHAR(50) NOT NULL,\n country_id SMALLINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (city_id),\n FOREIGN KEY (country_id) REFERENCES country (country_id)\n);\n\nCREATE TABLE country (\n country_id SMALLINT UNSIGNED NOT NULL,\n country VARCHAR(50) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (country_id)\n);\n\nCREATE TABLE customer (\n customer_id SMALLINT UNSIGNED NOT NULL,\n store_id TINYINT UNSIGNED NOT NULL,\n first_name VARCHAR(45) NOT NULL,\n last_name VARCHAR(45) NOT NULL,\n email VARCHAR(50) DEFAULT NULL,\n address_id SMALLINT UNSIGNED NOT NULL,\n active BOOLEAN NOT NULL DEFAULT TRUE,\n create_date DATETIME NOT NULL,\n last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (customer_id),\n FOREIGN KEY (address_id) REFERENCES address (address_id),\n FOREIGN KEY (store_id) REFERENCES store (store_id)\n);\n\nCREATE TABLE film (\n film_id SMALLINT UNSIGNED NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT DEFAULT NULL,\n release_year YEAR DEFAULT NULL,\n language_id TINYINT UNSIGNED NOT NULL,\n original_language_id TINYINT UNSIGNED DEFAULT NULL,\n rental_duration TINYINT UNSIGNED NOT NULL DEFAULT 3,\n rental_rate DECIMAL(4,2) NOT NULL DEFAULT 4.99,\n length SMALLINT UNSIGNED DEFAULT NULL,\n replacement_cost DECIMAL(5,2) NOT NULL DEFAULT 19.99,\n rating DEFAULT 'G',\n special_features DEFAULT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (film_id),\n FOREIGN KEY (language_id) REFERENCES language (language_id),\n FOREIGN KEY (original_language_id) REFERENCES language (language_id)\n);\n\nCREATE TABLE film_actor (\n actor_id SMALLINT UNSIGNED NOT NULL,\n film_id SMALLINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (actor_id,film_id),\n FOREIGN KEY (actor_id) REFERENCES actor (actor_id),\n FOREIGN KEY (film_id) REFERENCES film (film_id)\n);\n\nCREATE TABLE film_category (\n film_id SMALLINT UNSIGNED NOT NULL,\n category_id TINYINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (film_id, category_id),\n FOREIGN KEY (film_id) REFERENCES film (film_id),\n FOREIGN KEY (category_id) REFERENCES category (category_id)\n);\n\nCREATE TABLE film_text (\n film_id SMALLINT NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT,\n PRIMARY KEY (film_id)\n);\n\nCREATE TABLE inventory (\n inventory_id MEDIUMINT UNSIGNED NOT NULL,\n film_id SMALLINT UNSIGNED NOT NULL,\n store_id TINYINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (inventory_id),\n FOREIGN KEY (store_id) REFERENCES store (store_id),\n FOREIGN KEY (film_id) REFERENCES film (film_id)\n);\n\nCREATE TABLE language (\n language_id TINYINT UNSIGNED NOT NULL,\n name CHAR(20) NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (language_id)\n);\n\nCREATE TABLE payment (\n payment_id SMALLINT UNSIGNED NOT NULL,\n customer_id SMALLINT UNSIGNED NOT NULL,\n staff_id TINYINT UNSIGNED NOT NULL,\n rental_id INT DEFAULT NULL,\n amount DECIMAL(5,2) NOT NULL,\n payment_date DATETIME NOT NULL,\n last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (payment_id),\n FOREIGN KEY (rental_id) REFERENCES rental (rental_id),\n FOREIGN KEY (customer_id) REFERENCES customer (customer_id),\n FOREIGN KEY (staff_id) REFERENCES staff (staff_id)\n);\n\nCREATE TABLE rental (\n rental_id INT NOT NULL,\n rental_date DATETIME NOT NULL,\n inventory_id MEDIUMINT UNSIGNED NOT NULL,\n customer_id SMALLINT UNSIGNED NOT NULL,\n return_date DATETIME DEFAULT NULL,\n staff_id TINYINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (rental_id),\n FOREIGN KEY (staff_id) REFERENCES staff (staff_id),\n FOREIGN KEY (inventory_id) REFERENCES inventory (inventory_id),\n FOREIGN KEY (customer_id) REFERENCES customer (customer_id)\n);\n\nCREATE TABLE staff (\n staff_id TINYINT UNSIGNED NOT NULL,\n first_name VARCHAR(45) NOT NULL,\n last_name VARCHAR(45) NOT NULL,\n address_id SMALLINT UNSIGNED NOT NULL,\n picture BLOB DEFAULT NULL,\n email VARCHAR(50) DEFAULT NULL,\n store_id TINYINT UNSIGNED NOT NULL,\n active BOOLEAN NOT NULL DEFAULT TRUE,\n username VARCHAR(16) NOT NULL,\n password VARCHAR(40) DEFAULT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (staff_id),\n --FOREIGN KEY (store_id) REFERENCES store (store_id),\n FOREIGN KEY (address_id) REFERENCES address (address_id)\n);\n\nCREATE TABLE store (\n store_id TINYINT UNSIGNED NOT NULL,\n manager_staff_id TINYINT UNSIGNED NOT NULL,\n address_id SMALLINT UNSIGNED NOT NULL,\n last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (store_id),\n FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id),\n FOREIGN KEY (address_id) REFERENCES address (address_id)\n);\n\n### QUESTION\nCount the number of items store 1 has in stock.\n\n### ANSWER [/INST]\nSELECT count(*) FROM inventory WHERE store_id = 1 </s>"}]