db_id
stringclasses
140 values
schema
listlengths
0
26
question
stringlengths
16
224
query
stringlengths
18
577
query_toks
listlengths
4
90
query_toks_no_value
listlengths
4
125
question_toks
listlengths
4
44
sakila_1
[ "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE TABLE film_text (\n film_id SMALLINT NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT,\n PRIMARY KEY (film_id)\n);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);" ]
What is the largest payment amount?
SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
[ "SELECT", "amount", "FROM", "payment", "ORDER", "BY", "amount", "DESC", "LIMIT", "1" ]
[ "select", "amount", "from", "payment", "order", "by", "amount", "desc", "limit", "value" ]
[ "What", "is", "the", "largest", "payment", "amount", "?" ]
sakila_1
[ "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE TABLE film_text (\n film_id SMALLINT NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT,\n PRIMARY KEY (film_id)\n);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);" ]
Return the amount of the largest payment.
SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
[ "SELECT", "amount", "FROM", "payment", "ORDER", "BY", "amount", "DESC", "LIMIT", "1" ]
[ "select", "amount", "from", "payment", "order", "by", "amount", "desc", "limit", "value" ]
[ "Return", "the", "amount", "of", "the", "largest", "payment", "." ]
sakila_1
[ "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE TABLE film_text (\n film_id SMALLINT NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT,\n PRIMARY KEY (film_id)\n);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);" ]
Where does the staff member with the first name Elsa live?
SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa'
[ "SELECT", "T2.address", "FROM", "staff", "AS", "T1", "JOIN", "address", "AS", "T2", "ON", "T1.address_id", "=", "T2.address_id", "WHERE", "T1.first_name", "=", "'Elsa", "'" ]
[ "select", "t2", ".", "address", "from", "staff", "as", "t1", "join", "address", "as", "t2", "on", "t1", ".", "address_id", "=", "t2", ".", "address_id", "where", "t1", ".", "first_name", "=", "value" ]
[ "Where", "does", "the", "staff", "member", "with", "the", "first", "name", "Elsa", "live", "?" ]
sakila_1
[ "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE TABLE film_text (\n film_id SMALLINT NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT,\n PRIMARY KEY (film_id)\n);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);" ]
Give the address of the staff member who has the first name Elsa.
SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa'
[ "SELECT", "T2.address", "FROM", "staff", "AS", "T1", "JOIN", "address", "AS", "T2", "ON", "T1.address_id", "=", "T2.address_id", "WHERE", "T1.first_name", "=", "'Elsa", "'" ]
[ "select", "t2", ".", "address", "from", "staff", "as", "t1", "join", "address", "as", "t2", "on", "t1", ".", "address_id", "=", "t2", ".", "address_id", "where", "t1", ".", "first_name", "=", "value" ]
[ "Give", "the", "address", "of", "the", "staff", "member", "who", "has", "the", "first", "name", "Elsa", "." ]
sakila_1
[ "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE TABLE film_text (\n film_id SMALLINT NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT,\n PRIMARY KEY (film_id)\n);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);" ]
What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?
SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01' )
[ "SELECT", "first_name", "FROM", "customer", "WHERE", "customer_id", "NOT", "IN", "(", "SELECT", "customer_id", "FROM", "rental", "WHERE", "rental_date", ">", "'2005-08-23", "02:06:01", "'", ")" ]
[ "select", "first_name", "from", "customer", "where", "customer_id", "not", "in", "(", "select", "customer_id", "from", "rental", "where", "rental_date", ">", "value", ")" ]
[ "What", "are", "the", "first", "names", "of", "customers", "who", "have", "not", "rented", "any", "films", "after", "'2005-08-23", "02:06:01", "'", "?" ]
sakila_1
[ "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE TABLE film_text (\n film_id SMALLINT NOT NULL,\n title VARCHAR(255) NOT NULL,\n description TEXT,\n PRIMARY KEY (film_id)\n);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);", "CREATE 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);" ]
Return the first names of customers who did not rented a film after the date '2005-08-23 02:06:01'.
SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01' )
[ "SELECT", "first_name", "FROM", "customer", "WHERE", "customer_id", "NOT", "IN", "(", "SELECT", "customer_id", "FROM", "rental", "WHERE", "rental_date", ">", "'2005-08-23", "02:06:01", "'", ")" ]
[ "select", "first_name", "from", "customer", "where", "customer_id", "not", "in", "(", "select", "customer_id", "from", "rental", "where", "rental_date", ">", "value", ")" ]
[ "Return", "the", "first", "names", "of", "customers", "who", "did", "not", "rented", "a", "film", "after", "the", "date", "'2005-08-23", "02:06:01", "'", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
How many bank branches are there?
SELECT count(*) FROM bank
[ "SELECT", "count", "(", "*", ")", "FROM", "bank" ]
[ "select", "count", "(", "*", ")", "from", "bank" ]
[ "How", "many", "bank", "branches", "are", "there", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Count the number of bank branches.
SELECT count(*) FROM bank
[ "SELECT", "count", "(", "*", ")", "FROM", "bank" ]
[ "select", "count", "(", "*", ")", "from", "bank" ]
[ "Count", "the", "number", "of", "bank", "branches", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
How many customers are there?
SELECT sum(no_of_customers) FROM bank
[ "SELECT", "sum", "(", "no_of_customers", ")", "FROM", "bank" ]
[ "select", "sum", "(", "no_of_customers", ")", "from", "bank" ]
[ "How", "many", "customers", "are", "there", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the total number of customers across banks?
SELECT sum(no_of_customers) FROM bank
[ "SELECT", "sum", "(", "no_of_customers", ")", "FROM", "bank" ]
[ "select", "sum", "(", "no_of_customers", ")", "from", "bank" ]
[ "What", "is", "the", "total", "number", "of", "customers", "across", "banks", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the number of customers in the banks at New York City.
SELECT sum(no_of_customers) FROM bank WHERE city = 'New York City'
[ "SELECT", "sum", "(", "no_of_customers", ")", "FROM", "bank", "WHERE", "city", "=", "'New", "York", "City", "'" ]
[ "select", "sum", "(", "no_of_customers", ")", "from", "bank", "where", "city", "=", "value" ]
[ "Find", "the", "number", "of", "customers", "in", "the", "banks", "at", "New", "York", "City", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the total number of customers who use banks in New York City?
SELECT sum(no_of_customers) FROM bank WHERE city = 'New York City'
[ "SELECT", "sum", "(", "no_of_customers", ")", "FROM", "bank", "WHERE", "city", "=", "'New", "York", "City", "'" ]
[ "select", "sum", "(", "no_of_customers", ")", "from", "bank", "where", "city", "=", "value" ]
[ "What", "is", "the", "total", "number", "of", "customers", "who", "use", "banks", "in", "New", "York", "City", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the average number of customers in all banks of Utah state.
SELECT avg(no_of_customers) FROM bank WHERE state = 'Utah'
[ "SELECT", "avg", "(", "no_of_customers", ")", "FROM", "bank", "WHERE", "state", "=", "'Utah", "'" ]
[ "select", "avg", "(", "no_of_customers", ")", "from", "bank", "where", "state", "=", "value" ]
[ "Find", "the", "average", "number", "of", "customers", "in", "all", "banks", "of", "Utah", "state", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the average number of customers across banks in the state of Utah?
SELECT avg(no_of_customers) FROM bank WHERE state = 'Utah'
[ "SELECT", "avg", "(", "no_of_customers", ")", "FROM", "bank", "WHERE", "state", "=", "'Utah", "'" ]
[ "select", "avg", "(", "no_of_customers", ")", "from", "bank", "where", "state", "=", "value" ]
[ "What", "is", "the", "average", "number", "of", "customers", "across", "banks", "in", "the", "state", "of", "Utah", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the average number of customers cross all banks.
SELECT avg(no_of_customers) FROM bank
[ "SELECT", "avg", "(", "no_of_customers", ")", "FROM", "bank" ]
[ "select", "avg", "(", "no_of_customers", ")", "from", "bank" ]
[ "Find", "the", "average", "number", "of", "customers", "cross", "all", "banks", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the average number of bank customers?
SELECT avg(no_of_customers) FROM bank
[ "SELECT", "avg", "(", "no_of_customers", ")", "FROM", "bank" ]
[ "select", "avg", "(", "no_of_customers", ")", "from", "bank" ]
[ "What", "is", "the", "average", "number", "of", "bank", "customers", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the city and state of the bank branch named morningside.
SELECT city , state FROM bank WHERE bname = 'morningside'
[ "SELECT", "city", ",", "state", "FROM", "bank", "WHERE", "bname", "=", "'morningside", "'" ]
[ "select", "city", ",", "state", "from", "bank", "where", "bname", "=", "value" ]
[ "Find", "the", "city", "and", "state", "of", "the", "bank", "branch", "named", "morningside", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What city and state is the bank with the name morningside in?
SELECT city , state FROM bank WHERE bname = 'morningside'
[ "SELECT", "city", ",", "state", "FROM", "bank", "WHERE", "bname", "=", "'morningside", "'" ]
[ "select", "city", ",", "state", "from", "bank", "where", "bname", "=", "value" ]
[ "What", "city", "and", "state", "is", "the", "bank", "with", "the", "name", "morningside", "in", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the branch names of banks in the New York state.
SELECT bname FROM bank WHERE state = 'New York'
[ "SELECT", "bname", "FROM", "bank", "WHERE", "state", "=", "'New", "York", "'" ]
[ "select", "bname", "from", "bank", "where", "state", "=", "value" ]
[ "Find", "the", "branch", "names", "of", "banks", "in", "the", "New", "York", "state", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of banks in the state of New York?
SELECT bname FROM bank WHERE state = 'New York'
[ "SELECT", "bname", "FROM", "bank", "WHERE", "state", "=", "'New", "York", "'" ]
[ "select", "bname", "from", "bank", "where", "state", "=", "value" ]
[ "What", "are", "the", "names", "of", "banks", "in", "the", "state", "of", "New", "York", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
List the name of all customers sorted by their account balance in ascending order.
SELECT cust_name FROM customer ORDER BY acc_bal
[ "SELECT", "cust_name", "FROM", "customer", "ORDER", "BY", "acc_bal" ]
[ "select", "cust_name", "from", "customer", "order", "by", "acc_bal" ]
[ "List", "the", "name", "of", "all", "customers", "sorted", "by", "their", "account", "balance", "in", "ascending", "order", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of all customers, ordered by account balance?
SELECT cust_name FROM customer ORDER BY acc_bal
[ "SELECT", "cust_name", "FROM", "customer", "ORDER", "BY", "acc_bal" ]
[ "select", "cust_name", "from", "customer", "order", "by", "acc_bal" ]
[ "What", "are", "the", "names", "of", "all", "customers", ",", "ordered", "by", "account", "balance", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
List the name of all different customers who have some loan sorted by their total loan amount.
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "GROUP", "BY", "T1.cust_name", "ORDER", "BY", "sum", "(", "T2.amount", ")" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "group", "by", "t1", ".", "cust_name", "order", "by", "sum", "(", "t2", ".", "amount", ")" ]
[ "List", "the", "name", "of", "all", "different", "customers", "who", "have", "some", "loan", "sorted", "by", "their", "total", "loan", "amount", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of the different customers who have taken out a loan, ordered by the total amount that they have taken?
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "GROUP", "BY", "T1.cust_name", "ORDER", "BY", "sum", "(", "T2.amount", ")" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "group", "by", "t1", ".", "cust_name", "order", "by", "sum", "(", "t2", ".", "amount", ")" ]
[ "What", "are", "the", "names", "of", "the", "different", "customers", "who", "have", "taken", "out", "a", "loan", ",", "ordered", "by", "the", "total", "amount", "that", "they", "have", "taken", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the state, account type, and credit score of the customer whose number of loan is 0.
SELECT state , acc_type , credit_score FROM customer WHERE no_of_loans = 0
[ "SELECT", "state", ",", "acc_type", ",", "credit_score", "FROM", "customer", "WHERE", "no_of_loans", "=", "0" ]
[ "select", "state", ",", "acc_type", ",", "credit_score", "from", "customer", "where", "no_of_loans", "=", "value" ]
[ "Find", "the", "state", ",", "account", "type", ",", "and", "credit", "score", "of", "the", "customer", "whose", "number", "of", "loan", "is", "0", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the states, account types, and credit scores for customers who have 0 loans?
SELECT state , acc_type , credit_score FROM customer WHERE no_of_loans = 0
[ "SELECT", "state", ",", "acc_type", ",", "credit_score", "FROM", "customer", "WHERE", "no_of_loans", "=", "0" ]
[ "select", "state", ",", "acc_type", ",", "credit_score", "from", "customer", "where", "no_of_loans", "=", "value" ]
[ "What", "are", "the", "states", ",", "account", "types", ",", "and", "credit", "scores", "for", "customers", "who", "have", "0", "loans", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the number of different cities which banks are located at.
SELECT count(DISTINCT city) FROM bank
[ "SELECT", "count", "(", "DISTINCT", "city", ")", "FROM", "bank" ]
[ "select", "count", "(", "distinct", "city", ")", "from", "bank" ]
[ "Find", "the", "number", "of", "different", "cities", "which", "banks", "are", "located", "at", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
In how many different cities are banks located?
SELECT count(DISTINCT city) FROM bank
[ "SELECT", "count", "(", "DISTINCT", "city", ")", "FROM", "bank" ]
[ "select", "count", "(", "distinct", "city", ")", "from", "bank" ]
[ "In", "how", "many", "different", "cities", "are", "banks", "located", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the number of different states which banks are located at.
SELECT count(DISTINCT state) FROM bank
[ "SELECT", "count", "(", "DISTINCT", "state", ")", "FROM", "bank" ]
[ "select", "count", "(", "distinct", "state", ")", "from", "bank" ]
[ "Find", "the", "number", "of", "different", "states", "which", "banks", "are", "located", "at", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
In how many different states are banks located?
SELECT count(DISTINCT state) FROM bank
[ "SELECT", "count", "(", "DISTINCT", "state", ")", "FROM", "bank" ]
[ "select", "count", "(", "distinct", "state", ")", "from", "bank" ]
[ "In", "how", "many", "different", "states", "are", "banks", "located", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
How many distinct types of accounts are there?
SELECT count(DISTINCT acc_type) FROM customer
[ "SELECT", "count", "(", "DISTINCT", "acc_type", ")", "FROM", "customer" ]
[ "select", "count", "(", "distinct", "acc_type", ")", "from", "customer" ]
[ "How", "many", "distinct", "types", "of", "accounts", "are", "there", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Count the number of different account types.
SELECT count(DISTINCT acc_type) FROM customer
[ "SELECT", "count", "(", "DISTINCT", "acc_type", ")", "FROM", "customer" ]
[ "select", "count", "(", "distinct", "acc_type", ")", "from", "customer" ]
[ "Count", "the", "number", "of", "different", "account", "types", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name and account balance of the customer whose name includes the letter ‘a’.
SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%'
[ "SELECT", "cust_name", ",", "acc_bal", "FROM", "customer", "WHERE", "cust_name", "LIKE", "'", "%", "a", "%", "'" ]
[ "select", "cust_name", ",", "acc_bal", "from", "customer", "where", "cust_name", "like", "value" ]
[ "Find", "the", "name", "and", "account", "balance", "of", "the", "customer", "whose", "name", "includes", "the", "letter", "‘a’", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names and account balances of customers with the letter a in their names?
SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%'
[ "SELECT", "cust_name", ",", "acc_bal", "FROM", "customer", "WHERE", "cust_name", "LIKE", "'", "%", "a", "%", "'" ]
[ "select", "cust_name", ",", "acc_bal", "from", "customer", "where", "cust_name", "like", "value" ]
[ "What", "are", "the", "names", "and", "account", "balances", "of", "customers", "with", "the", "letter", "a", "in", "their", "names", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the total account balance of each customer from Utah or Texas.
SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'
[ "SELECT", "sum", "(", "acc_bal", ")", "FROM", "customer", "WHERE", "state", "=", "'Utah", "'", "OR", "state", "=", "'Texas", "'" ]
[ "select", "sum", "(", "acc_bal", ")", "from", "customer", "where", "state", "=", "value", "or", "state", "=", "value" ]
[ "Find", "the", "total", "account", "balance", "of", "each", "customer", "from", "Utah", "or", "Texas", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the total account balances for each customer from Utah or Texas?
SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'
[ "SELECT", "sum", "(", "acc_bal", ")", "FROM", "customer", "WHERE", "state", "=", "'Utah", "'", "OR", "state", "=", "'Texas", "'" ]
[ "select", "sum", "(", "acc_bal", ")", "from", "customer", "where", "state", "=", "value", "or", "state", "=", "value" ]
[ "What", "are", "the", "total", "account", "balances", "for", "each", "customer", "from", "Utah", "or", "Texas", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of customers who have both saving and checking account types.
SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'
[ "SELECT", "cust_name", "FROM", "customer", "WHERE", "acc_type", "=", "'saving", "'", "INTERSECT", "SELECT", "cust_name", "FROM", "customer", "WHERE", "acc_type", "=", "'checking", "'" ]
[ "select", "cust_name", "from", "customer", "where", "acc_type", "=", "value", "intersect", "select", "cust_name", "from", "customer", "where", "acc_type", "=", "value" ]
[ "Find", "the", "name", "of", "customers", "who", "have", "both", "saving", "and", "checking", "account", "types", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of customers who have both savings and checking accounts?
SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'
[ "SELECT", "cust_name", "FROM", "customer", "WHERE", "acc_type", "=", "'saving", "'", "INTERSECT", "SELECT", "cust_name", "FROM", "customer", "WHERE", "acc_type", "=", "'checking", "'" ]
[ "select", "cust_name", "from", "customer", "where", "acc_type", "=", "value", "intersect", "select", "cust_name", "from", "customer", "where", "acc_type", "=", "value" ]
[ "What", "are", "the", "names", "of", "customers", "who", "have", "both", "savings", "and", "checking", "accounts", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of customers who do not have an saving account.
SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'
[ "SELECT", "cust_name", "FROM", "customer", "EXCEPT", "SELECT", "cust_name", "FROM", "customer", "WHERE", "acc_type", "=", "'saving", "'" ]
[ "select", "cust_name", "from", "customer", "except", "select", "cust_name", "from", "customer", "where", "acc_type", "=", "value" ]
[ "Find", "the", "name", "of", "customers", "who", "do", "not", "have", "an", "saving", "account", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of customers who do not have saving accounts?
SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'
[ "SELECT", "cust_name", "FROM", "customer", "EXCEPT", "SELECT", "cust_name", "FROM", "customer", "WHERE", "acc_type", "=", "'saving", "'" ]
[ "select", "cust_name", "from", "customer", "except", "select", "cust_name", "from", "customer", "where", "acc_type", "=", "value" ]
[ "What", "are", "the", "names", "of", "customers", "who", "do", "not", "have", "saving", "accounts", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of customers who do not have a loan with a type of Mortgages.
SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages'
[ "SELECT", "cust_name", "FROM", "customer", "EXCEPT", "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "WHERE", "T2.loan_type", "=", "'Mortgages", "'" ]
[ "select", "cust_name", "from", "customer", "except", "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "where", "t2", ".", "loan_type", "=", "value" ]
[ "Find", "the", "name", "of", "customers", "who", "do", "not", "have", "a", "loan", "with", "a", "type", "of", "Mortgages", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of customers who have not taken a Mortage loan?
SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages'
[ "SELECT", "cust_name", "FROM", "customer", "EXCEPT", "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "WHERE", "T2.loan_type", "=", "'Mortgages", "'" ]
[ "select", "cust_name", "from", "customer", "except", "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "where", "t2", ".", "loan_type", "=", "value" ]
[ "What", "are", "the", "names", "of", "customers", "who", "have", "not", "taken", "a", "Mortage", "loan", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of customers who have loans of both Mortgages and Auto.
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "WHERE", "loan_type", "=", "'Mortgages", "'", "INTERSECT", "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "WHERE", "loan_type", "=", "'Auto", "'" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "where", "loan_type", "=", "value", "intersect", "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "where", "loan_type", "=", "value" ]
[ "Find", "the", "name", "of", "customers", "who", "have", "loans", "of", "both", "Mortgages", "and", "Auto", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of customers who have taken both Mortgage and Auto loans?
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "WHERE", "loan_type", "=", "'Mortgages", "'", "INTERSECT", "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "WHERE", "loan_type", "=", "'Auto", "'" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "where", "loan_type", "=", "value", "intersect", "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "where", "loan_type", "=", "value" ]
[ "What", "are", "the", "names", "of", "customers", "who", "have", "taken", "both", "Mortgage", "and", "Auto", "loans", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of customers whose credit score is below the average credit scores of all customers.
SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer)
[ "SELECT", "cust_name", "FROM", "customer", "WHERE", "credit_score", "<", "(", "SELECT", "avg", "(", "credit_score", ")", "FROM", "customer", ")" ]
[ "select", "cust_name", "from", "customer", "where", "credit_score", "<", "(", "select", "avg", "(", "credit_score", ")", "from", "customer", ")" ]
[ "Find", "the", "name", "of", "customers", "whose", "credit", "score", "is", "below", "the", "average", "credit", "scores", "of", "all", "customers", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of customers with credit score less than the average credit score across customers?
SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer)
[ "SELECT", "cust_name", "FROM", "customer", "WHERE", "credit_score", "<", "(", "SELECT", "avg", "(", "credit_score", ")", "FROM", "customer", ")" ]
[ "select", "cust_name", "from", "customer", "where", "credit_score", "<", "(", "select", "avg", "(", "credit_score", ")", "from", "customer", ")" ]
[ "What", "are", "the", "names", "of", "customers", "with", "credit", "score", "less", "than", "the", "average", "credit", "score", "across", "customers", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the branch name of the bank that has the most number of customers.
SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
[ "SELECT", "bname", "FROM", "bank", "ORDER", "BY", "no_of_customers", "DESC", "LIMIT", "1" ]
[ "select", "bname", "from", "bank", "order", "by", "no_of_customers", "desc", "limit", "value" ]
[ "Find", "the", "branch", "name", "of", "the", "bank", "that", "has", "the", "most", "number", "of", "customers", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the name of the bank branch with the greatest number of customers?
SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
[ "SELECT", "bname", "FROM", "bank", "ORDER", "BY", "no_of_customers", "DESC", "LIMIT", "1" ]
[ "select", "bname", "from", "bank", "order", "by", "no_of_customers", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "bank", "branch", "with", "the", "greatest", "number", "of", "customers", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of customer who has the lowest credit score.
SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
[ "SELECT", "cust_name", "FROM", "customer", "ORDER", "BY", "credit_score", "LIMIT", "1" ]
[ "select", "cust_name", "from", "customer", "order", "by", "credit_score", "limit", "value" ]
[ "Find", "the", "name", "of", "customer", "who", "has", "the", "lowest", "credit", "score", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the name of the customer with the worst credit score?
SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
[ "SELECT", "cust_name", "FROM", "customer", "ORDER", "BY", "credit_score", "LIMIT", "1" ]
[ "select", "cust_name", "from", "customer", "order", "by", "credit_score", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "customer", "with", "the", "worst", "credit", "score", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name, account type, and account balance of the customer who has the highest credit score.
SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
[ "SELECT", "cust_name", ",", "acc_type", ",", "acc_bal", "FROM", "customer", "ORDER", "BY", "credit_score", "DESC", "LIMIT", "1" ]
[ "select", "cust_name", ",", "acc_type", ",", "acc_bal", "from", "customer", "order", "by", "credit_score", "desc", "limit", "value" ]
[ "Find", "the", "name", ",", "account", "type", ",", "and", "account", "balance", "of", "the", "customer", "who", "has", "the", "highest", "credit", "score", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the name, account type, and account balance corresponding to the customer with the highest credit score?
SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
[ "SELECT", "cust_name", ",", "acc_type", ",", "acc_bal", "FROM", "customer", "ORDER", "BY", "credit_score", "DESC", "LIMIT", "1" ]
[ "select", "cust_name", ",", "acc_type", ",", "acc_bal", "from", "customer", "order", "by", "credit_score", "desc", "limit", "value" ]
[ "What", "is", "the", "name", ",", "account", "type", ",", "and", "account", "balance", "corresponding", "to", "the", "customer", "with", "the", "highest", "credit", "score", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of customer who has the highest amount of loans.
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "GROUP", "BY", "T1.cust_name", "ORDER", "BY", "sum", "(", "T2.amount", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "group", "by", "t1", ".", "cust_name", "order", "by", "sum", "(", "t2", ".", "amount", ")", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "customer", "who", "has", "the", "highest", "amount", "of", "loans", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the name of the customer who has greatest total loan amount?
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "GROUP", "BY", "T1.cust_name", "ORDER", "BY", "sum", "(", "T2.amount", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "group", "by", "t1", ".", "cust_name", "order", "by", "sum", "(", "t2", ".", "amount", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "customer", "who", "has", "greatest", "total", "loan", "amount", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the state which has the most number of customers.
SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1
[ "SELECT", "state", "FROM", "bank", "GROUP", "BY", "state", "ORDER", "BY", "sum", "(", "no_of_customers", ")", "DESC", "LIMIT", "1" ]
[ "select", "state", "from", "bank", "group", "by", "state", "order", "by", "sum", "(", "no_of_customers", ")", "desc", "limit", "value" ]
[ "Find", "the", "state", "which", "has", "the", "most", "number", "of", "customers", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Which state has the greatest total number of bank customers?
SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1
[ "SELECT", "state", "FROM", "bank", "GROUP", "BY", "state", "ORDER", "BY", "sum", "(", "no_of_customers", ")", "DESC", "LIMIT", "1" ]
[ "select", "state", "from", "bank", "group", "by", "state", "order", "by", "sum", "(", "no_of_customers", ")", "desc", "limit", "value" ]
[ "Which", "state", "has", "the", "greatest", "total", "number", "of", "bank", "customers", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
For each account type, find the average account balance of customers with credit score lower than 50.
SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type
[ "SELECT", "avg", "(", "acc_bal", ")", ",", "acc_type", "FROM", "customer", "WHERE", "credit_score", "<", "50", "GROUP", "BY", "acc_type" ]
[ "select", "avg", "(", "acc_bal", ")", ",", "acc_type", "from", "customer", "where", "credit_score", "<", "value", "group", "by", "acc_type" ]
[ "For", "each", "account", "type", ",", "find", "the", "average", "account", "balance", "of", "customers", "with", "credit", "score", "lower", "than", "50", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the average account balance of customers with credit score below 50 for the different account types?
SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type
[ "SELECT", "avg", "(", "acc_bal", ")", ",", "acc_type", "FROM", "customer", "WHERE", "credit_score", "<", "50", "GROUP", "BY", "acc_type" ]
[ "select", "avg", "(", "acc_bal", ")", ",", "acc_type", "from", "customer", "where", "credit_score", "<", "value", "group", "by", "acc_type" ]
[ "What", "is", "the", "average", "account", "balance", "of", "customers", "with", "credit", "score", "below", "50", "for", "the", "different", "account", "types", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
For each state, find the total account balance of customers whose credit score is above 100.
SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state
[ "SELECT", "sum", "(", "acc_bal", ")", ",", "state", "FROM", "customer", "WHERE", "credit_score", ">", "100", "GROUP", "BY", "state" ]
[ "select", "sum", "(", "acc_bal", ")", ",", "state", "from", "customer", "where", "credit_score", ">", "value", "group", "by", "state" ]
[ "For", "each", "state", ",", "find", "the", "total", "account", "balance", "of", "customers", "whose", "credit", "score", "is", "above", "100", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the total account balance for customers with a credit score of above 100 for the different states?
SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state
[ "SELECT", "sum", "(", "acc_bal", ")", ",", "state", "FROM", "customer", "WHERE", "credit_score", ">", "100", "GROUP", "BY", "state" ]
[ "select", "sum", "(", "acc_bal", ")", ",", "state", "from", "customer", "where", "credit_score", ">", "value", "group", "by", "state" ]
[ "What", "is", "the", "total", "account", "balance", "for", "customers", "with", "a", "credit", "score", "of", "above", "100", "for", "the", "different", "states", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the total amount of loans offered by each bank branch.
SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname
[ "SELECT", "sum", "(", "amount", ")", ",", "T1.bname", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "GROUP", "BY", "T1.bname" ]
[ "select", "sum", "(", "amount", ")", ",", "t1", ".", "bname", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "group", "by", "t1", ".", "bname" ]
[ "Find", "the", "total", "amount", "of", "loans", "offered", "by", "each", "bank", "branch", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of the different bank branches, and what are their total loan amounts?
SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname
[ "SELECT", "sum", "(", "amount", ")", ",", "T1.bname", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "GROUP", "BY", "T1.bname" ]
[ "select", "sum", "(", "amount", ")", ",", "t1", ".", "bname", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "group", "by", "t1", ".", "bname" ]
[ "What", "are", "the", "names", "of", "the", "different", "bank", "branches", ",", "and", "what", "are", "their", "total", "loan", "amounts", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of customers who have more than one loan.
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING count(*) > 1
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "GROUP", "BY", "T1.cust_name", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "group", "by", "t1", ".", "cust_name", "having", "count", "(", "*", ")", ">", "value" ]
[ "Find", "the", "name", "of", "customers", "who", "have", "more", "than", "one", "loan", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of customers who have taken out more than one loan?
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING count(*) > 1
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "GROUP", "BY", "T1.cust_name", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "group", "by", "t1", ".", "cust_name", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "are", "the", "names", "of", "customers", "who", "have", "taken", "out", "more", "than", "one", "loan", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name and account balance of the customers who have loans with a total amount of more than 5000.
SELECT T1.cust_name , T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount) > 5000
[ "SELECT", "T1.cust_name", ",", "T1.acc_type", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "GROUP", "BY", "T1.cust_name", "HAVING", "sum", "(", "T2.amount", ")", ">", "5000" ]
[ "select", "t1", ".", "cust_name", ",", "t1", ".", "acc_type", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "group", "by", "t1", ".", "cust_name", "having", "sum", "(", "t2", ".", "amount", ")", ">", "value" ]
[ "Find", "the", "name", "and", "account", "balance", "of", "the", "customers", "who", "have", "loans", "with", "a", "total", "amount", "of", "more", "than", "5000", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names and account balances for customers who have taken a total amount of more than 5000 in loans?
SELECT T1.cust_name , T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount) > 5000
[ "SELECT", "T1.cust_name", ",", "T1.acc_type", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "GROUP", "BY", "T1.cust_name", "HAVING", "sum", "(", "T2.amount", ")", ">", "5000" ]
[ "select", "t1", ".", "cust_name", ",", "t1", ".", "acc_type", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "group", "by", "t1", ".", "cust_name", "having", "sum", "(", "t2", ".", "amount", ")", ">", "value" ]
[ "What", "are", "the", "names", "and", "account", "balances", "for", "customers", "who", "have", "taken", "a", "total", "amount", "of", "more", "than", "5000", "in", "loans", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of bank branch that provided the greatest total amount of loans.
SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1
[ "SELECT", "T1.bname", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "GROUP", "BY", "T1.bname", "ORDER", "BY", "sum", "(", "T2.amount", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "bname", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "group", "by", "t1", ".", "bname", "order", "by", "sum", "(", "t2", ".", "amount", ")", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "bank", "branch", "that", "provided", "the", "greatest", "total", "amount", "of", "loans", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the name of the bank branch that has lent the greatest amount?
SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1
[ "SELECT", "T1.bname", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "GROUP", "BY", "T1.bname", "ORDER", "BY", "sum", "(", "T2.amount", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "bname", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "group", "by", "t1", ".", "bname", "order", "by", "sum", "(", "t2", ".", "amount", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "bank", "branch", "that", "has", "lent", "the", "greatest", "amount", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.
SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1
[ "SELECT", "T2.bname", "FROM", "loan", "AS", "T1", "JOIN", "bank", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "JOIN", "customer", "AS", "T3", "ON", "T1.cust_id", "=", "T3.cust_id", "WHERE", "T3.credit_score", "<", "100", "GROUP", "BY", "T2.bname", "ORDER", "BY", "sum", "(", "T1.amount", ")", "DESC", "LIMIT", "1" ]
[ "select", "t2", ".", "bname", "from", "loan", "as", "t1", "join", "bank", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "join", "customer", "as", "t3", "on", "t1", ".", "cust_id", "=", "t3", ".", "cust_id", "where", "t3", ".", "credit_score", "<", "value", "group", "by", "t2", ".", "bname", "order", "by", "sum", "(", "t1", ".", "amount", ")", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "bank", "branch", "that", "provided", "the", "greatest", "total", "amount", "of", "loans", "to", "customers", "with", "credit", "score", "is", "less", "than", "100", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the name of the bank branch that has lended the largest total amount in loans, specifically to customers with credit scores below 100?
SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1
[ "SELECT", "T2.bname", "FROM", "loan", "AS", "T1", "JOIN", "bank", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "JOIN", "customer", "AS", "T3", "ON", "T1.cust_id", "=", "T3.cust_id", "WHERE", "T3.credit_score", "<", "100", "GROUP", "BY", "T2.bname", "ORDER", "BY", "sum", "(", "T1.amount", ")", "DESC", "LIMIT", "1" ]
[ "select", "t2", ".", "bname", "from", "loan", "as", "t1", "join", "bank", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "join", "customer", "as", "t3", "on", "t1", ".", "cust_id", "=", "t3", ".", "cust_id", "where", "t3", ".", "credit_score", "<", "value", "group", "by", "t2", ".", "bname", "order", "by", "sum", "(", "t1", ".", "amount", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "bank", "branch", "that", "has", "lended", "the", "largest", "total", "amount", "in", "loans", ",", "specifically", "to", "customers", "with", "credit", "scores", "below", "100", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name of bank branches that provided some loans.
SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id
[ "SELECT", "DISTINCT", "T1.bname", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id" ]
[ "select", "distinct", "t1", ".", "bname", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id" ]
[ "Find", "the", "name", "of", "bank", "branches", "that", "provided", "some", "loans", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of the different banks that have provided loans?
SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id
[ "SELECT", "DISTINCT", "T1.bname", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id" ]
[ "select", "distinct", "t1", ".", "bname", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id" ]
[ "What", "are", "the", "names", "of", "the", "different", "banks", "that", "have", "provided", "loans", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the name and credit score of the customers who have some loans.
SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id
[ "SELECT", "DISTINCT", "T1.cust_name", ",", "T1.credit_score", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id" ]
[ "select", "distinct", "t1", ".", "cust_name", ",", "t1", ".", "credit_score", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id" ]
[ "Find", "the", "name", "and", "credit", "score", "of", "the", "customers", "who", "have", "some", "loans", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the different names and credit scores of customers who have taken a loan?
SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id
[ "SELECT", "DISTINCT", "T1.cust_name", ",", "T1.credit_score", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id" ]
[ "select", "distinct", "t1", ".", "cust_name", ",", "t1", ".", "credit_score", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id" ]
[ "What", "are", "the", "different", "names", "and", "credit", "scores", "of", "customers", "who", "have", "taken", "a", "loan", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the the name of the customers who have a loan with amount more than 3000.
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "WHERE", "amount", ">", "3000" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "where", "amount", ">", "value" ]
[ "Find", "the", "the", "name", "of", "the", "customers", "who", "have", "a", "loan", "with", "amount", "more", "than", "3000", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of customers who have a loan of more than 3000 in amount?
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000
[ "SELECT", "T1.cust_name", "FROM", "customer", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.cust_id", "=", "T2.cust_id", "WHERE", "amount", ">", "3000" ]
[ "select", "t1", ".", "cust_name", "from", "customer", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "cust_id", "=", "t2", ".", "cust_id", "where", "amount", ">", "value" ]
[ "What", "are", "the", "names", "of", "customers", "who", "have", "a", "loan", "of", "more", "than", "3000", "in", "amount", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the city and name of bank branches that provide business loans.
SELECT T1.bname , T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'
[ "SELECT", "T1.bname", ",", "T1.city", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "WHERE", "T2.loan_type", "=", "'Business", "'" ]
[ "select", "t1", ".", "bname", ",", "t1", ".", "city", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "where", "t2", ".", "loan_type", "=", "value" ]
[ "Find", "the", "city", "and", "name", "of", "bank", "branches", "that", "provide", "business", "loans", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names and cities of bank branches that offer loans for business?
SELECT T1.bname , T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'
[ "SELECT", "T1.bname", ",", "T1.city", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "WHERE", "T2.loan_type", "=", "'Business", "'" ]
[ "select", "t1", ".", "bname", ",", "t1", ".", "city", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "where", "t2", ".", "loan_type", "=", "value" ]
[ "What", "are", "the", "names", "and", "cities", "of", "bank", "branches", "that", "offer", "loans", "for", "business", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the names of bank branches that have provided a loan to any customer whose credit score is below 100.
SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100
[ "SELECT", "T2.bname", "FROM", "loan", "AS", "T1", "JOIN", "bank", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "JOIN", "customer", "AS", "T3", "ON", "T1.cust_id", "=", "T3.cust_id", "WHERE", "T3.credit_score", "<", "100" ]
[ "select", "t2", ".", "bname", "from", "loan", "as", "t1", "join", "bank", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "join", "customer", "as", "t3", "on", "t1", ".", "cust_id", "=", "t3", ".", "cust_id", "where", "t3", ".", "credit_score", "<", "value" ]
[ "Find", "the", "names", "of", "bank", "branches", "that", "have", "provided", "a", "loan", "to", "any", "customer", "whose", "credit", "score", "is", "below", "100", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What are the names of banks that have loaned money to customers with credit scores below 100?
SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100
[ "SELECT", "T2.bname", "FROM", "loan", "AS", "T1", "JOIN", "bank", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "JOIN", "customer", "AS", "T3", "ON", "T1.cust_id", "=", "T3.cust_id", "WHERE", "T3.credit_score", "<", "100" ]
[ "select", "t2", ".", "bname", "from", "loan", "as", "t1", "join", "bank", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "join", "customer", "as", "t3", "on", "t1", ".", "cust_id", "=", "t3", ".", "cust_id", "where", "t3", ".", "credit_score", "<", "value" ]
[ "What", "are", "the", "names", "of", "banks", "that", "have", "loaned", "money", "to", "customers", "with", "credit", "scores", "below", "100", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the total amount of loans provided by bank branches in the state of New York.
SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York'
[ "SELECT", "sum", "(", "T2.amount", ")", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "WHERE", "T1.state", "=", "'New", "York", "'" ]
[ "select", "sum", "(", "t2", ".", "amount", ")", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "where", "t1", ".", "state", "=", "value" ]
[ "Find", "the", "total", "amount", "of", "loans", "provided", "by", "bank", "branches", "in", "the", "state", "of", "New", "York", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the total amount of money loaned by banks in New York state?
SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York'
[ "SELECT", "sum", "(", "T2.amount", ")", "FROM", "bank", "AS", "T1", "JOIN", "loan", "AS", "T2", "ON", "T1.branch_id", "=", "T2.branch_id", "WHERE", "T1.state", "=", "'New", "York", "'" ]
[ "select", "sum", "(", "t2", ".", "amount", ")", "from", "bank", "as", "t1", "join", "loan", "as", "t2", "on", "t1", ".", "branch_id", "=", "t2", ".", "branch_id", "where", "t1", ".", "state", "=", "value" ]
[ "What", "is", "the", "total", "amount", "of", "money", "loaned", "by", "banks", "in", "New", "York", "state", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the average credit score of the customers who have some loan.
SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)
[ "SELECT", "avg", "(", "credit_score", ")", "FROM", "customer", "WHERE", "cust_id", "IN", "(", "SELECT", "cust_id", "FROM", "loan", ")" ]
[ "select", "avg", "(", "credit_score", ")", "from", "customer", "where", "cust_id", "in", "(", "select", "cust_id", "from", "loan", ")" ]
[ "Find", "the", "average", "credit", "score", "of", "the", "customers", "who", "have", "some", "loan", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the average credit score for customers who have taken a loan?
SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)
[ "SELECT", "avg", "(", "credit_score", ")", "FROM", "customer", "WHERE", "cust_id", "IN", "(", "SELECT", "cust_id", "FROM", "loan", ")" ]
[ "select", "avg", "(", "credit_score", ")", "from", "customer", "where", "cust_id", "in", "(", "select", "cust_id", "from", "loan", ")" ]
[ "What", "is", "the", "average", "credit", "score", "for", "customers", "who", "have", "taken", "a", "loan", "?" ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
Find the average credit score of the customers who do not have any loan.
SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
[ "SELECT", "avg", "(", "credit_score", ")", "FROM", "customer", "WHERE", "cust_id", "NOT", "IN", "(", "SELECT", "cust_id", "FROM", "loan", ")" ]
[ "select", "avg", "(", "credit_score", ")", "from", "customer", "where", "cust_id", "not", "in", "(", "select", "cust_id", "from", "loan", ")" ]
[ "Find", "the", "average", "credit", "score", "of", "the", "customers", "who", "do", "not", "have", "any", "loan", "." ]
loan_1
[ "CREATE TABLE bank (\nbranch_ID int PRIMARY KEY,\nbname varchar(20),\nno_of_customers int,\ncity varchar(10),\nstate varchar(20));", "CREATE TABLE customer (\ncust_ID varchar(3) PRIMARY KEY,\ncust_name varchar(20),\nacc_type char(1),\nacc_bal int,\nno_of_loans int,\ncredit_score int,\nbranch_ID int,\nstate varchar(20),\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID));", "CREATE TABLE loan (\nloan_ID varchar(3) PRIMARY KEY,\nloan_type varchar(15),\ncust_ID varchar(3),\nbranch_ID varchar(3),\namount int,\nFOREIGN KEY(branch_ID) REFERENCES bank(branch_ID),\nFOREIGN KEY(Cust_ID) REFERENCES customer(Cust_ID));" ]
What is the average credit score for customers who have never taken a loan?
SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
[ "SELECT", "avg", "(", "credit_score", ")", "FROM", "customer", "WHERE", "cust_id", "NOT", "IN", "(", "SELECT", "cust_id", "FROM", "loan", ")" ]
[ "select", "avg", "(", "credit_score", ")", "from", "customer", "where", "cust_id", "not", "in", "(", "select", "cust_id", "from", "loan", ")" ]
[ "What", "is", "the", "average", "credit", "score", "for", "customers", "who", "have", "never", "taken", "a", "loan", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
How many assessment notes are there in total?
SELECT count(*) FROM ASSESSMENT_NOTES
[ "SELECT", "count", "(", "*", ")", "FROM", "ASSESSMENT_NOTES" ]
[ "select", "count", "(", "*", ")", "from", "assessment_notes" ]
[ "How", "many", "assessment", "notes", "are", "there", "in", "total", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
What are the dates of the assessment notes?
SELECT date_of_notes FROM Assessment_Notes
[ "SELECT", "date_of_notes", "FROM", "Assessment_Notes" ]
[ "select", "date_of_notes", "from", "assessment_notes" ]
[ "What", "are", "the", "dates", "of", "the", "assessment", "notes", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
How many addresses have zip code 197?
SELECT count(*) FROM ADDRESSES WHERE zip_postcode = "197"
[ "SELECT", "count", "(", "*", ")", "FROM", "ADDRESSES", "WHERE", "zip_postcode", "=", "``", "197", "''" ]
[ "select", "count", "(", "*", ")", "from", "addresses", "where", "zip_postcode", "=", "value" ]
[ "How", "many", "addresses", "have", "zip", "code", "197", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
How many distinct incident type codes are there?
SELECT count(DISTINCT incident_type_code) FROM Behavior_Incident
[ "SELECT", "count", "(", "DISTINCT", "incident_type_code", ")", "FROM", "Behavior_Incident" ]
[ "select", "count", "(", "distinct", "incident_type_code", ")", "from", "behavior_incident" ]
[ "How", "many", "distinct", "incident", "type", "codes", "are", "there", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
Return all distinct detention type codes.
SELECT DISTINCT detention_type_code FROM Detention
[ "SELECT", "DISTINCT", "detention_type_code", "FROM", "Detention" ]
[ "select", "distinct", "detention_type_code", "from", "detention" ]
[ "Return", "all", "distinct", "detention", "type", "codes", "." ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
What are the start and end dates for incidents with incident type code "NOISE"?
SELECT date_incident_start , date_incident_end FROM Behavior_Incident WHERE incident_type_code = "NOISE"
[ "SELECT", "date_incident_start", ",", "date_incident_end", "FROM", "Behavior_Incident", "WHERE", "incident_type_code", "=", "``", "NOISE", "''" ]
[ "select", "date_incident_start", ",", "date_incident_end", "from", "behavior_incident", "where", "incident_type_code", "=", "value" ]
[ "What", "are", "the", "start", "and", "end", "dates", "for", "incidents", "with", "incident", "type", "code", "``", "NOISE", "''", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
Return all detention summaries.
SELECT detention_summary FROM Detention
[ "SELECT", "detention_summary", "FROM", "Detention" ]
[ "select", "detention_summary", "from", "detention" ]
[ "Return", "all", "detention", "summaries", "." ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
Return the cell phone number and email address for all students.
SELECT cell_mobile_number , email_address FROM STUDENTS
[ "SELECT", "cell_mobile_number", ",", "email_address", "FROM", "STUDENTS" ]
[ "select", "cell_mobile_number", ",", "email_address", "from", "students" ]
[ "Return", "the", "cell", "phone", "number", "and", "email", "address", "for", "all", "students", "." ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
What is the email of the student with first name "Emma" and last name "Rohan"?
SELECT email_address FROM Students WHERE first_name = "Emma" AND last_name = "Rohan"
[ "SELECT", "email_address", "FROM", "Students", "WHERE", "first_name", "=", "``", "Emma", "''", "AND", "last_name", "=", "``", "Rohan", "''" ]
[ "select", "email_address", "from", "students", "where", "first_name", "=", "value", "and", "last_name", "=", "value" ]
[ "What", "is", "the", "email", "of", "the", "student", "with", "first", "name", "``", "Emma", "''", "and", "last", "name", "``", "Rohan", "''", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
How many distinct students have been in detention?
SELECT count(DISTINCT student_id) FROM Students_in_Detention
[ "SELECT", "count", "(", "DISTINCT", "student_id", ")", "FROM", "Students_in_Detention" ]
[ "select", "count", "(", "distinct", "student_id", ")", "from", "students_in_detention" ]
[ "How", "many", "distinct", "students", "have", "been", "in", "detention", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
What is the gender of the teacher with last name "Medhurst"?
SELECT gender FROM TEACHERS WHERE last_name = "Medhurst"
[ "SELECT", "gender", "FROM", "TEACHERS", "WHERE", "last_name", "=", "``", "Medhurst", "''" ]
[ "select", "gender", "from", "teachers", "where", "last_name", "=", "value" ]
[ "What", "is", "the", "gender", "of", "the", "teacher", "with", "last", "name", "``", "Medhurst", "''", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
What is the incident type description for the incident type with code "VIOLENCE"?
SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code = "VIOLENCE"
[ "SELECT", "incident_type_description", "FROM", "Ref_Incident_Type", "WHERE", "incident_type_code", "=", "``", "VIOLENCE", "''" ]
[ "select", "incident_type_description", "from", "ref_incident_type", "where", "incident_type_code", "=", "value" ]
[ "What", "is", "the", "incident", "type", "description", "for", "the", "incident", "type", "with", "code", "``", "VIOLENCE", "''", "?" ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
Find the maximum and minimum monthly rental for all student addresses.
SELECT max(monthly_rental) , min(monthly_rental) FROM Student_Addresses
[ "SELECT", "max", "(", "monthly_rental", ")", ",", "min", "(", "monthly_rental", ")", "FROM", "Student_Addresses" ]
[ "select", "max", "(", "monthly_rental", ")", ",", "min", "(", "monthly_rental", ")", "from", "student_addresses" ]
[ "Find", "the", "maximum", "and", "minimum", "monthly", "rental", "for", "all", "student", "addresses", "." ]
behavior_monitoring
[ "CREATE TABLE `Ref_Address_Types` (\n`address_type_code` VARCHAR(15) PRIMARY KEY,\n`address_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Detention_Type` (\n`detention_type_code` VARCHAR(10) PRIMARY KEY,\n`detention_type_description` VARCHAR(80)\n);", "CREATE TABLE `Ref_Incident_Type` (\n`incident_type_code` VARCHAR(10) PRIMARY KEY,\n`incident_type_description` VARCHAR(80)\n);", "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1` VARCHAR(120),\n`line_2` VARCHAR(120),\n`line_3` VARCHAR(120),\n`city` VARCHAR(80),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50),\n`other_address_details` VARCHAR(255)\n);", "CREATE TABLE `Students` (\n`student_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(40),\n`last_name` VARCHAR(40),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`date_first_rental` DATETIME,\n`date_left_university` DATETIME,\n`other_student_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Teachers` (\n`teacher_id` INTEGER PRIMARY KEY,\n`address_id` INTEGER NOT NULL,\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`gender` VARCHAR(1),\n`cell_mobile_number` VARCHAR(40),\n`email_address` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Assessment_Notes` (\n`notes_id` INTEGER NOT NULL ,\n`student_id` INTEGER,\n`teacher_id` INTEGER NOT NULL,\n`date_of_notes` DATETIME,\n`text_of_notes` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Behavior_Incident` (\n`incident_id` INTEGER PRIMARY KEY,\n`incident_type_code` VARCHAR(10) NOT NULL,\n`student_id` INTEGER NOT NULL,\n`date_incident_start` DATETIME,\n`date_incident_end` DATETIME,\n`incident_summary` VARCHAR(255),\n`recommendations` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`incident_type_code` ) REFERENCES `Ref_Incident_Type`(`incident_type_code` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Detention` (\n`detention_id` INTEGER PRIMARY KEY,\n`detention_type_code` VARCHAR(10) NOT NULL,\n`teacher_id` INTEGER,\n`datetime_detention_start` DATETIME,\n`datetime_detention_end` DATETIME,\n`detention_summary` VARCHAR(255),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`detention_type_code` ) REFERENCES `Ref_Detention_Type`(`detention_type_code` ),\nFOREIGN KEY (`teacher_id` ) REFERENCES `Teachers`(`teacher_id` )\n);", "CREATE TABLE `Student_Addresses` (\n`student_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`date_address_to` DATETIME,\n`monthly_rental` DECIMAL(19,4),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);", "CREATE TABLE `Students_in_Detention` (\n`student_id` INTEGER NOT NULL,\n`detention_id` INTEGER NOT NULL,\n`incident_id` INTEGER NOT NULL,\nFOREIGN KEY (`incident_id` ) REFERENCES `Behavior_Incident`(`incident_id` ),\nFOREIGN KEY (`detention_id` ) REFERENCES `Detention`(`detention_id` ),\nFOREIGN KEY (`student_id` ) REFERENCES `Students`(`student_id` )\n);" ]
Find the first names of teachers whose email address contains the word "man".
SELECT first_name FROM Teachers WHERE email_address LIKE '%man%'
[ "SELECT", "first_name", "FROM", "Teachers", "WHERE", "email_address", "LIKE", "'", "%", "man", "%", "'" ]
[ "select", "first_name", "from", "teachers", "where", "email_address", "like", "value" ]
[ "Find", "the", "first", "names", "of", "teachers", "whose", "email", "address", "contains", "the", "word", "``", "man", "''", "." ]