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
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
How many customers are there in the customer type with the most customers?
SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "count", "(", "*", ")", "FROM", "customers", "GROUP", "BY", "customer_type_code", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "count", "(", "*", ")", "from", "customers", "group", "by", "customer_type_code", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "How", "many", "customers", "are", "there", "in", "the", "customer", "type", "with", "the", "most", "customers", "?" ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Count the number of customers that have the customer type that is most common.
SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "count", "(", "*", ")", "FROM", "customers", "GROUP", "BY", "customer_type_code", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "count", "(", "*", ")", "from", "customers", "group", "by", "customer_type_code", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Count", "the", "number", "of", "customers", "that", "have", "the", "customer", "type", "that", "is", "most", "common", "." ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What is the last name of the staff who has handled the first ever complaint?
SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
[ "SELECT", "t1.last_name", "FROM", "staff", "AS", "t1", "JOIN", "complaints", "AS", "t2", "ON", "t1.staff_id", "=", "t2.staff_id", "ORDER", "BY", "t2.date_complaint_raised", "LIMIT", "1" ]
[ "select", "t1", ".", "last_name", "from", "staff", "as", "t1", "join", "complaints", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "order", "by", "t2", ".", "date_complaint_raised", "limit", "value" ]
[ "What", "is", "the", "last", "name", "of", "the", "staff", "who", "has", "handled", "the", "first", "ever", "complaint", "?" ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Return the last name of the staff member who handled the complaint with the earliest date raised.
SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
[ "SELECT", "t1.last_name", "FROM", "staff", "AS", "t1", "JOIN", "complaints", "AS", "t2", "ON", "t1.staff_id", "=", "t2.staff_id", "ORDER", "BY", "t2.date_complaint_raised", "LIMIT", "1" ]
[ "select", "t1", ".", "last_name", "from", "staff", "as", "t1", "join", "complaints", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "order", "by", "t2", ".", "date_complaint_raised", "limit", "value" ]
[ "Return", "the", "last", "name", "of", "the", "staff", "member", "who", "handled", "the", "complaint", "with", "the", "earliest", "date", "raised", "." ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
How many distinct complaint type codes are there in the database?
SELECT count(DISTINCT complaint_type_code) FROM complaints
[ "SELECT", "count", "(", "DISTINCT", "complaint_type_code", ")", "FROM", "complaints" ]
[ "select", "count", "(", "distinct", "complaint_type_code", ")", "from", "complaints" ]
[ "How", "many", "distinct", "complaint", "type", "codes", "are", "there", "in", "the", "database", "?" ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Count the number of different complaint type codes.
SELECT count(DISTINCT complaint_type_code) FROM complaints
[ "SELECT", "count", "(", "DISTINCT", "complaint_type_code", ")", "FROM", "complaints" ]
[ "select", "count", "(", "distinct", "complaint_type_code", ")", "from", "complaints" ]
[ "Count", "the", "number", "of", "different", "complaint", "type", "codes", "." ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Find the address line 1 and 2 of the customer with email "vbogisich@example.org".
SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = "vbogisich@example.org"
[ "SELECT", "address_line_1", ",", "address_line_2", "FROM", "customers", "WHERE", "email_address", "=", "``", "vbogisich", "@", "example.org", "''" ]
[ "select", "address_line_1", ",", "address_line_2", "from", "customers", "where", "email_address", "=", "value" ]
[ "Find", "the", "address", "line", "1", "and", "2", "of", "the", "customer", "with", "email", "``", "vbogisich", "@", "example.org", "''", "." ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What are lines 1 and 2 of the addressed of the customer with the email "vbogisich@example.org"?
SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = "vbogisich@example.org"
[ "SELECT", "address_line_1", ",", "address_line_2", "FROM", "customers", "WHERE", "email_address", "=", "``", "vbogisich", "@", "example.org", "''" ]
[ "select", "address_line_1", ",", "address_line_2", "from", "customers", "where", "email_address", "=", "value" ]
[ "What", "are", "lines", "1", "and", "2", "of", "the", "addressed", "of", "the", "customer", "with", "the", "email", "``", "vbogisich", "@", "example.org", "''", "?" ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Find the number of complaints with Product Failure type for each complaint status.
SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = "Product Failure" GROUP BY complaint_status_code
[ "SELECT", "complaint_status_code", ",", "count", "(", "*", ")", "FROM", "complaints", "WHERE", "complaint_type_code", "=", "``", "Product", "Failure", "''", "GROUP", "BY", "complaint_status_code" ]
[ "select", "complaint_status_code", ",", "count", "(", "*", ")", "from", "complaints", "where", "complaint_type_code", "=", "value", "group", "by", "complaint_status_code" ]
[ "Find", "the", "number", "of", "complaints", "with", "Product", "Failure", "type", "for", "each", "complaint", "status", "." ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Of complaints with the type code "Product Failure", how many had each different status code?
SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = "Product Failure" GROUP BY complaint_status_code
[ "SELECT", "complaint_status_code", ",", "count", "(", "*", ")", "FROM", "complaints", "WHERE", "complaint_type_code", "=", "``", "Product", "Failure", "''", "GROUP", "BY", "complaint_status_code" ]
[ "select", "complaint_status_code", ",", "count", "(", "*", ")", "from", "complaints", "where", "complaint_type_code", "=", "value", "group", "by", "complaint_status_code" ]
[ "Of", "complaints", "with", "the", "type", "code", "``", "Product", "Failure", "''", ",", "how", "many", "had", "each", "different", "status", "code", "?" ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What is first names of the top 5 staff who have handled the greatest number of complaints?
SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5
[ "SELECT", "t1.first_name", "FROM", "staff", "AS", "t1", "JOIN", "complaints", "AS", "t2", "ON", "t1.staff_id", "=", "t2.staff_id", "GROUP", "BY", "t2.staff_id", "ORDER", "BY", "count", "(", "*", ")", "LIMIT", "5" ]
[ "select", "t1", ".", "first_name", "from", "staff", "as", "t1", "join", "complaints", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "group", "by", "t2", ".", "staff_id", "order", "by", "count", "(", "*", ")", "limit", "value" ]
[ "What", "is", "first", "names", "of", "the", "top", "5", "staff", "who", "have", "handled", "the", "greatest", "number", "of", "complaints", "?" ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Return the first names of the 5 staff members who have handled the most complaints.
SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5
[ "SELECT", "t1.first_name", "FROM", "staff", "AS", "t1", "JOIN", "complaints", "AS", "t2", "ON", "t1.staff_id", "=", "t2.staff_id", "GROUP", "BY", "t2.staff_id", "ORDER", "BY", "count", "(", "*", ")", "LIMIT", "5" ]
[ "select", "t1", ".", "first_name", "from", "staff", "as", "t1", "join", "complaints", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "group", "by", "t2", ".", "staff_id", "order", "by", "count", "(", "*", ")", "limit", "value" ]
[ "Return", "the", "first", "names", "of", "the", "5", "staff", "members", "who", "have", "handled", "the", "most", "complaints", "." ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Which state has the most customers?
SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1
[ "SELECT", "state", "FROM", "customers", "GROUP", "BY", "state", "ORDER", "BY", "count", "(", "*", ")", "LIMIT", "1" ]
[ "select", "state", "from", "customers", "group", "by", "state", "order", "by", "count", "(", "*", ")", "limit", "value" ]
[ "Which", "state", "has", "the", "most", "customers", "?" ]
customer_complaints
[ "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`gender` VARCHAR(1),\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_type_code` VARCHAR(20) NOT NULL,\n`address_line_1` VARCHAR(80),\n`address_line_2` VARCHAR(80),\n`town_city` VARCHAR(80),\n`state` VARCHAR(80),\n`email_address` VARCHAR(255),\n`phone_number` VARCHAR(80)\n);", "CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`parent_product_id` INTEGER,\n`product_category_code` VARCHAR(20) NOT NULL,\n`date_product_first_available` DATETIME,\n`date_product_discontinued` DATETIME,\n`product_name` VARCHAR(80),\n`product_description` VARCHAR(255),\n`product_price` DECIMAL(19,4)\n);", "CREATE TABLE `Complaints` (\n`complaint_id` INTEGER NOT NULL ,\n`product_id` INTEGER NOT NULL,\n`customer_id` INTEGER NOT NULL,\n`complaint_outcome_code` VARCHAR(20) NOT NULL,\n`complaint_status_code` VARCHAR(20) NOT NULL,\n`complaint_type_code` VARCHAR(20) NOT NULL,\n`date_complaint_raised` DATETIME,\n`date_complaint_closed` DATETIME,\n`staff_id` INTEGER NOT NULL ,\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Give the state that has the most customers.
SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1
[ "SELECT", "state", "FROM", "customers", "GROUP", "BY", "state", "ORDER", "BY", "count", "(", "*", ")", "LIMIT", "1" ]
[ "select", "state", "from", "customers", "group", "by", "state", "order", "by", "count", "(", "*", ")", "limit", "value" ]
[ "Give", "the", "state", "that", "has", "the", "most", "customers", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
How many submissions are there?
SELECT count(*) FROM submission
[ "SELECT", "count", "(", "*", ")", "FROM", "submission" ]
[ "select", "count", "(", "*", ")", "from", "submission" ]
[ "How", "many", "submissions", "are", "there", "?" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Count the number of submissions.
SELECT count(*) FROM submission
[ "SELECT", "count", "(", "*", ")", "FROM", "submission" ]
[ "select", "count", "(", "*", ")", "from", "submission" ]
[ "Count", "the", "number", "of", "submissions", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
List the authors of submissions in ascending order of scores.
SELECT Author FROM submission ORDER BY Scores ASC
[ "SELECT", "Author", "FROM", "submission", "ORDER", "BY", "Scores", "ASC" ]
[ "select", "author", "from", "submission", "order", "by", "scores", "asc" ]
[ "List", "the", "authors", "of", "submissions", "in", "ascending", "order", "of", "scores", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Find the author for each submission and list them in ascending order of submission score.
SELECT Author FROM submission ORDER BY Scores ASC
[ "SELECT", "Author", "FROM", "submission", "ORDER", "BY", "Scores", "ASC" ]
[ "select", "author", "from", "submission", "order", "by", "scores", "asc" ]
[ "Find", "the", "author", "for", "each", "submission", "and", "list", "them", "in", "ascending", "order", "of", "submission", "score", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
What are the authors of submissions and their colleges?
SELECT Author , College FROM submission
[ "SELECT", "Author", ",", "College", "FROM", "submission" ]
[ "select", "author", ",", "college", "from", "submission" ]
[ "What", "are", "the", "authors", "of", "submissions", "and", "their", "colleges", "?" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
For each submission, show the author and their affiliated college.
SELECT Author , College FROM submission
[ "SELECT", "Author", ",", "College", "FROM", "submission" ]
[ "select", "author", ",", "college", "from", "submission" ]
[ "For", "each", "submission", ",", "show", "the", "author", "and", "their", "affiliated", "college", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show the names of authors from college "Florida" or "Temple"
SELECT Author FROM submission WHERE College = "Florida" OR College = "Temple"
[ "SELECT", "Author", "FROM", "submission", "WHERE", "College", "=", "``", "Florida", "''", "OR", "College", "=", "``", "Temple", "''" ]
[ "select", "author", "from", "submission", "where", "college", "=", "value", "or", "college", "=", "value" ]
[ "Show", "the", "names", "of", "authors", "from", "college", "``", "Florida", "''", "or", "``", "Temple", "''" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Which authors with submissions are from college "Florida" or "Temple"?
SELECT Author FROM submission WHERE College = "Florida" OR College = "Temple"
[ "SELECT", "Author", "FROM", "submission", "WHERE", "College", "=", "``", "Florida", "''", "OR", "College", "=", "``", "Temple", "''" ]
[ "select", "author", "from", "submission", "where", "college", "=", "value", "or", "college", "=", "value" ]
[ "Which", "authors", "with", "submissions", "are", "from", "college", "``", "Florida", "''", "or", "``", "Temple", "''", "?" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
What is the average score of submissions?
SELECT avg(Scores) FROM submission
[ "SELECT", "avg", "(", "Scores", ")", "FROM", "submission" ]
[ "select", "avg", "(", "scores", ")", "from", "submission" ]
[ "What", "is", "the", "average", "score", "of", "submissions", "?" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Compute the average score of submissions.
SELECT avg(Scores) FROM submission
[ "SELECT", "avg", "(", "Scores", ")", "FROM", "submission" ]
[ "select", "avg", "(", "scores", ")", "from", "submission" ]
[ "Compute", "the", "average", "score", "of", "submissions", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
What is the author of the submission with the highest score?
SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
[ "SELECT", "Author", "FROM", "submission", "ORDER", "BY", "Scores", "DESC", "LIMIT", "1" ]
[ "select", "author", "from", "submission", "order", "by", "scores", "desc", "limit", "value" ]
[ "What", "is", "the", "author", "of", "the", "submission", "with", "the", "highest", "score", "?" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Find the author who achieved the highest score in a submission.
SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
[ "SELECT", "Author", "FROM", "submission", "ORDER", "BY", "Scores", "DESC", "LIMIT", "1" ]
[ "select", "author", "from", "submission", "order", "by", "scores", "desc", "limit", "value" ]
[ "Find", "the", "author", "who", "achieved", "the", "highest", "score", "in", "a", "submission", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show different colleges along with the number of authors of submission from each college.
SELECT College , COUNT(*) FROM submission GROUP BY College
[ "SELECT", "College", ",", "COUNT", "(", "*", ")", "FROM", "submission", "GROUP", "BY", "College" ]
[ "select", "college", ",", "count", "(", "*", ")", "from", "submission", "group", "by", "college" ]
[ "Show", "different", "colleges", "along", "with", "the", "number", "of", "authors", "of", "submission", "from", "each", "college", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
For each college, return the college name and the count of authors with submissions from that college.
SELECT College , COUNT(*) FROM submission GROUP BY College
[ "SELECT", "College", ",", "COUNT", "(", "*", ")", "FROM", "submission", "GROUP", "BY", "College" ]
[ "select", "college", ",", "count", "(", "*", ")", "from", "submission", "group", "by", "college" ]
[ "For", "each", "college", ",", "return", "the", "college", "name", "and", "the", "count", "of", "authors", "with", "submissions", "from", "that", "college", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show the most common college of authors of submissions.
SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1
[ "SELECT", "College", "FROM", "submission", "GROUP", "BY", "College", "ORDER", "BY", "COUNT", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "college", "from", "submission", "group", "by", "college", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "most", "common", "college", "of", "authors", "of", "submissions", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Which college has the most authors with submissions?
SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1
[ "SELECT", "College", "FROM", "submission", "GROUP", "BY", "College", "ORDER", "BY", "COUNT", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "college", "from", "submission", "group", "by", "college", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Which", "college", "has", "the", "most", "authors", "with", "submissions", "?" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.
SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80
[ "SELECT", "College", "FROM", "submission", "WHERE", "Scores", ">", "90", "INTERSECT", "SELECT", "College", "FROM", "submission", "WHERE", "Scores", "<", "80" ]
[ "select", "college", "from", "submission", "where", "scores", ">", "value", "intersect", "select", "college", "from", "submission", "where", "scores", "<", "value" ]
[ "Show", "the", "colleges", "that", "have", "both", "authors", "with", "submission", "score", "larger", "than", "90", "and", "authors", "with", "submission", "score", "smaller", "than", "80", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Which colleges have both authors with submission score above 90 and authors with submission score below 80?
SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80
[ "SELECT", "College", "FROM", "submission", "WHERE", "Scores", ">", "90", "INTERSECT", "SELECT", "College", "FROM", "submission", "WHERE", "Scores", "<", "80" ]
[ "select", "college", "from", "submission", "where", "scores", ">", "value", "intersect", "select", "college", "from", "submission", "where", "scores", "<", "value" ]
[ "Which", "colleges", "have", "both", "authors", "with", "submission", "score", "above", "90", "and", "authors", "with", "submission", "score", "below", "80", "?" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show the authors of submissions and the acceptance results of their submissions.
SELECT T2.Author , T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID
[ "SELECT", "T2.Author", ",", "T1.Result", "FROM", "acceptance", "AS", "T1", "JOIN", "submission", "AS", "T2", "ON", "T1.Submission_ID", "=", "T2.Submission_ID" ]
[ "select", "t2", ".", "author", ",", "t1", ".", "result", "from", "acceptance", "as", "t1", "join", "submission", "as", "t2", "on", "t1", ".", "submission_id", "=", "t2", ".", "submission_id" ]
[ "Show", "the", "authors", "of", "submissions", "and", "the", "acceptance", "results", "of", "their", "submissions", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
For each submission, find its author and acceptance result.
SELECT T2.Author , T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID
[ "SELECT", "T2.Author", ",", "T1.Result", "FROM", "acceptance", "AS", "T1", "JOIN", "submission", "AS", "T2", "ON", "T1.Submission_ID", "=", "T2.Submission_ID" ]
[ "select", "t2", ".", "author", ",", "t1", ".", "result", "from", "acceptance", "as", "t1", "join", "submission", "as", "t2", "on", "t1", ".", "submission_id", "=", "t2", ".", "submission_id" ]
[ "For", "each", "submission", ",", "find", "its", "author", "and", "acceptance", "result", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show the result of the submission with the highest score.
SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1
[ "SELECT", "T1.Result", "FROM", "acceptance", "AS", "T1", "JOIN", "submission", "AS", "T2", "ON", "T1.Submission_ID", "=", "T2.Submission_ID", "ORDER", "BY", "T2.Scores", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "result", "from", "acceptance", "as", "t1", "join", "submission", "as", "t2", "on", "t1", ".", "submission_id", "=", "t2", ".", "submission_id", "order", "by", "t2", ".", "scores", "desc", "limit", "value" ]
[ "Show", "the", "result", "of", "the", "submission", "with", "the", "highest", "score", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Which submission received the highest score in acceptance result. Show me the result.
SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1
[ "SELECT", "T1.Result", "FROM", "acceptance", "AS", "T1", "JOIN", "submission", "AS", "T2", "ON", "T1.Submission_ID", "=", "T2.Submission_ID", "ORDER", "BY", "T2.Scores", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "result", "from", "acceptance", "as", "t1", "join", "submission", "as", "t2", "on", "t1", ".", "submission_id", "=", "t2", ".", "submission_id", "order", "by", "t2", ".", "scores", "desc", "limit", "value" ]
[ "Which", "submission", "received", "the", "highest", "score", "in", "acceptance", "result", ".", "Show", "me", "the", "result", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show each author and the number of workshops they submitted to.
SELECT T2.Author , COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author
[ "SELECT", "T2.Author", ",", "COUNT", "(", "DISTINCT", "T1.workshop_id", ")", "FROM", "acceptance", "AS", "T1", "JOIN", "submission", "AS", "T2", "ON", "T1.Submission_ID", "=", "T2.Submission_ID", "GROUP", "BY", "T2.Author" ]
[ "select", "t2", ".", "author", ",", "count", "(", "distinct", "t1", ".", "workshop_id", ")", "from", "acceptance", "as", "t1", "join", "submission", "as", "t2", "on", "t1", ".", "submission_id", "=", "t2", ".", "submission_id", "group", "by", "t2", ".", "author" ]
[ "Show", "each", "author", "and", "the", "number", "of", "workshops", "they", "submitted", "to", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
How many workshops did each author submit to? Return the author name and the number of workshops.
SELECT T2.Author , COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author
[ "SELECT", "T2.Author", ",", "COUNT", "(", "DISTINCT", "T1.workshop_id", ")", "FROM", "acceptance", "AS", "T1", "JOIN", "submission", "AS", "T2", "ON", "T1.Submission_ID", "=", "T2.Submission_ID", "GROUP", "BY", "T2.Author" ]
[ "select", "t2", ".", "author", ",", "count", "(", "distinct", "t1", ".", "workshop_id", ")", "from", "acceptance", "as", "t1", "join", "submission", "as", "t2", "on", "t1", ".", "submission_id", "=", "t2", ".", "submission_id", "group", "by", "t2", ".", "author" ]
[ "How", "many", "workshops", "did", "each", "author", "submit", "to", "?", "Return", "the", "author", "name", "and", "the", "number", "of", "workshops", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show the authors who have submissions to more than one workshop.
SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1
[ "SELECT", "T2.Author", "FROM", "acceptance", "AS", "T1", "JOIN", "submission", "AS", "T2", "ON", "T1.Submission_ID", "=", "T2.Submission_ID", "GROUP", "BY", "T2.Author", "HAVING", "COUNT", "(", "DISTINCT", "T1.workshop_id", ")", ">", "1" ]
[ "select", "t2", ".", "author", "from", "acceptance", "as", "t1", "join", "submission", "as", "t2", "on", "t1", ".", "submission_id", "=", "t2", ".", "submission_id", "group", "by", "t2", ".", "author", "having", "count", "(", "distinct", "t1", ".", "workshop_id", ")", ">", "value" ]
[ "Show", "the", "authors", "who", "have", "submissions", "to", "more", "than", "one", "workshop", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Which authors have submitted to more than one workshop?
SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1
[ "SELECT", "T2.Author", "FROM", "acceptance", "AS", "T1", "JOIN", "submission", "AS", "T2", "ON", "T1.Submission_ID", "=", "T2.Submission_ID", "GROUP", "BY", "T2.Author", "HAVING", "COUNT", "(", "DISTINCT", "T1.workshop_id", ")", ">", "1" ]
[ "select", "t2", ".", "author", "from", "acceptance", "as", "t1", "join", "submission", "as", "t2", "on", "t1", ".", "submission_id", "=", "t2", ".", "submission_id", "group", "by", "t2", ".", "author", "having", "count", "(", "distinct", "t1", ".", "workshop_id", ")", ">", "value" ]
[ "Which", "authors", "have", "submitted", "to", "more", "than", "one", "workshop", "?" ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Show the date and venue of each workshop in ascending alphabetical order of the venue.
SELECT Date , Venue FROM workshop ORDER BY Venue
[ "SELECT", "Date", ",", "Venue", "FROM", "workshop", "ORDER", "BY", "Venue" ]
[ "select", "date", ",", "venue", "from", "workshop", "order", "by", "venue" ]
[ "Show", "the", "date", "and", "venue", "of", "each", "workshop", "in", "ascending", "alphabetical", "order", "of", "the", "venue", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Sort the each workshop in alphabetical order of the venue. Return the date and venue of each workshop.
SELECT Date , Venue FROM workshop ORDER BY Venue
[ "SELECT", "Date", ",", "Venue", "FROM", "workshop", "ORDER", "BY", "Venue" ]
[ "select", "date", ",", "venue", "from", "workshop", "order", "by", "venue" ]
[ "Sort", "the", "each", "workshop", "in", "alphabetical", "order", "of", "the", "venue", ".", "Return", "the", "date", "and", "venue", "of", "each", "workshop", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
List the authors who do not have submission to any workshop.
SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)
[ "SELECT", "Author", "FROM", "submission", "WHERE", "Submission_ID", "NOT", "IN", "(", "SELECT", "Submission_ID", "FROM", "acceptance", ")" ]
[ "select", "author", "from", "submission", "where", "submission_id", "not", "in", "(", "select", "submission_id", "from", "acceptance", ")" ]
[ "List", "the", "authors", "who", "do", "not", "have", "submission", "to", "any", "workshop", "." ]
workshop_paper
[ "CREATE TABLE \"workshop\" (\n\"Workshop_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Name\" text,\nPRIMARY KEY (\"Workshop_ID\")\n);", "CREATE TABLE \"submission\" (\n\"Submission_ID\" int,\n\"Scores\" real,\n\"Author\" text,\n\"College\" text,\nPRIMARY KEY (\"Submission_ID\")\n);", "CREATE TABLE \"Acceptance\" (\n\"Submission_ID\" int,\n\"Workshop_ID\" int,\n\"Result\" text,\nPRIMARY KEY (\"Submission_ID\",\"Workshop_ID\"),\nFOREIGN KEY (\"Submission_ID\") REFERENCES `submission`(\"Submission_ID\"),\nFOREIGN KEY (\"Workshop_ID\") REFERENCES `workshop`(\"Workshop_ID\")\n);" ]
Which authors did not submit to any workshop?
SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)
[ "SELECT", "Author", "FROM", "submission", "WHERE", "Submission_ID", "NOT", "IN", "(", "SELECT", "Submission_ID", "FROM", "acceptance", ")" ]
[ "select", "author", "from", "submission", "where", "submission_id", "not", "in", "(", "select", "submission_id", "from", "acceptance", ")" ]
[ "Which", "authors", "did", "not", "submit", "to", "any", "workshop", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Find the number of investors in total.
SELECT count(*) FROM INVESTORS
[ "SELECT", "count", "(", "*", ")", "FROM", "INVESTORS" ]
[ "select", "count", "(", "*", ")", "from", "investors" ]
[ "Find", "the", "number", "of", "investors", "in", "total", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show all investor details.
SELECT Investor_details FROM INVESTORS
[ "SELECT", "Investor_details", "FROM", "INVESTORS" ]
[ "select", "investor_details", "from", "investors" ]
[ "Show", "all", "investor", "details", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show all distinct lot details.
SELECT DISTINCT lot_details FROM LOTS
[ "SELECT", "DISTINCT", "lot_details", "FROM", "LOTS" ]
[ "select", "distinct", "lot_details", "from", "lots" ]
[ "Show", "all", "distinct", "lot", "details", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the maximum amount of transaction.
SELECT max(amount_of_transaction) FROM TRANSACTIONS
[ "SELECT", "max", "(", "amount_of_transaction", ")", "FROM", "TRANSACTIONS" ]
[ "select", "max", "(", "amount_of_transaction", ")", "from", "transactions" ]
[ "Show", "the", "maximum", "amount", "of", "transaction", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show all date and share count of transactions.
SELECT date_of_transaction , share_count FROM TRANSACTIONS
[ "SELECT", "date_of_transaction", ",", "share_count", "FROM", "TRANSACTIONS" ]
[ "select", "date_of_transaction", ",", "share_count", "from", "transactions" ]
[ "Show", "all", "date", "and", "share", "count", "of", "transactions", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
What is the total share of transactions?
SELECT sum(share_count) FROM TRANSACTIONS
[ "SELECT", "sum", "(", "share_count", ")", "FROM", "TRANSACTIONS" ]
[ "select", "sum", "(", "share_count", ")", "from", "transactions" ]
[ "What", "is", "the", "total", "share", "of", "transactions", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show all transaction ids with transaction code 'PUR'.
SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR'
[ "SELECT", "transaction_id", "FROM", "TRANSACTIONS", "WHERE", "transaction_type_code", "=", "'PUR", "'" ]
[ "select", "transaction_id", "from", "transactions", "where", "transaction_type_code", "=", "value" ]
[ "Show", "all", "transaction", "ids", "with", "transaction", "code", "'PUR", "'", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show all dates of transactions whose type code is "SALE".
SELECT date_of_transaction FROM TRANSACTIONS WHERE transaction_type_code = "SALE"
[ "SELECT", "date_of_transaction", "FROM", "TRANSACTIONS", "WHERE", "transaction_type_code", "=", "``", "SALE", "''" ]
[ "select", "date_of_transaction", "from", "transactions", "where", "transaction_type_code", "=", "value" ]
[ "Show", "all", "dates", "of", "transactions", "whose", "type", "code", "is", "``", "SALE", "''", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the average amount of transactions with type code "SALE".
SELECT avg(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = "SALE"
[ "SELECT", "avg", "(", "amount_of_transaction", ")", "FROM", "TRANSACTIONS", "WHERE", "transaction_type_code", "=", "``", "SALE", "''" ]
[ "select", "avg", "(", "amount_of_transaction", ")", "from", "transactions", "where", "transaction_type_code", "=", "value" ]
[ "Show", "the", "average", "amount", "of", "transactions", "with", "type", "code", "``", "SALE", "''", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the description of transaction type with code "PUR".
SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code = "PUR"
[ "SELECT", "transaction_type_description", "FROM", "Ref_Transaction_Types", "WHERE", "transaction_type_code", "=", "``", "PUR", "''" ]
[ "select", "transaction_type_description", "from", "ref_transaction_types", "where", "transaction_type_code", "=", "value" ]
[ "Show", "the", "description", "of", "transaction", "type", "with", "code", "``", "PUR", "''", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the minimum amount of transactions whose type code is "PUR" and whose share count is bigger than 50.
SELECT min(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = "PUR" AND share_count > 50
[ "SELECT", "min", "(", "amount_of_transaction", ")", "FROM", "TRANSACTIONS", "WHERE", "transaction_type_code", "=", "``", "PUR", "''", "AND", "share_count", ">", "50" ]
[ "select", "min", "(", "amount_of_transaction", ")", "from", "transactions", "where", "transaction_type_code", "=", "value", "and", "share_count", ">", "value" ]
[ "Show", "the", "minimum", "amount", "of", "transactions", "whose", "type", "code", "is", "``", "PUR", "''", "and", "whose", "share", "count", "is", "bigger", "than", "50", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the maximum share count of transactions where the amount is smaller than 10000
SELECT max(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000
[ "SELECT", "max", "(", "share_count", ")", "FROM", "TRANSACTIONS", "WHERE", "amount_of_transaction", "<", "10000" ]
[ "select", "max", "(", "share_count", ")", "from", "transactions", "where", "amount_of_transaction", "<", "value" ]
[ "Show", "the", "maximum", "share", "count", "of", "transactions", "where", "the", "amount", "is", "smaller", "than", "10000" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.
SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000
[ "SELECT", "date_of_transaction", "FROM", "TRANSACTIONS", "WHERE", "share_count", ">", "100", "OR", "amount_of_transaction", ">", "1000" ]
[ "select", "date_of_transaction", "from", "transactions", "where", "share_count", ">", "value", "or", "amount_of_transaction", ">", "value" ]
[ "Show", "the", "dates", "of", "transactions", "if", "the", "share", "count", "is", "bigger", "than", "100", "or", "the", "amount", "is", "bigger", "than", "1000", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the transaction type descriptions and dates if the share count is smaller than 10.
SELECT T1.transaction_type_description , T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10
[ "SELECT", "T1.transaction_type_description", ",", "T2.date_of_transaction", "FROM", "Ref_Transaction_Types", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.transaction_type_code", "=", "T2.transaction_type_code", "WHERE", "T2.share_count", "<", "10" ]
[ "select", "t1", ".", "transaction_type_description", ",", "t2", ".", "date_of_transaction", "from", "ref_transaction_types", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "transaction_type_code", "=", "t2", ".", "transaction_type_code", "where", "t2", ".", "share_count", "<", "value" ]
[ "Show", "the", "transaction", "type", "descriptions", "and", "dates", "if", "the", "share", "count", "is", "smaller", "than", "10", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show details of all investors if they make any transaction with share count greater than 100.
SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100
[ "SELECT", "T1.Investor_details", "FROM", "INVESTORS", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.investor_id", "=", "T2.investor_id", "WHERE", "T2.share_count", ">", "100" ]
[ "select", "t1", ".", "investor_details", "from", "investors", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "investor_id", "=", "t2", ".", "investor_id", "where", "t2", ".", "share_count", ">", "value" ]
[ "Show", "details", "of", "all", "investors", "if", "they", "make", "any", "transaction", "with", "share", "count", "greater", "than", "100", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
How many distinct transaction types are used in the transactions?
SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS
[ "SELECT", "COUNT", "(", "DISTINCT", "transaction_type_code", ")", "FROM", "TRANSACTIONS" ]
[ "select", "count", "(", "distinct", "transaction_type_code", ")", "from", "transactions" ]
[ "How", "many", "distinct", "transaction", "types", "are", "used", "in", "the", "transactions", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Return the lot details and investor ids.
SELECT lot_details , investor_id FROM LOTS
[ "SELECT", "lot_details", ",", "investor_id", "FROM", "LOTS" ]
[ "select", "lot_details", ",", "investor_id", "from", "lots" ]
[ "Return", "the", "lot", "details", "and", "investor", "ids", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Return the lot details of lots that belong to investors with details "l"?
SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l"
[ "SELECT", "T2.lot_details", "FROM", "INVESTORS", "AS", "T1", "JOIN", "LOTS", "AS", "T2", "ON", "T1.investor_id", "=", "T2.investor_id", "WHERE", "T1.Investor_details", "=", "``", "l", "''" ]
[ "select", "t2", ".", "lot_details", "from", "investors", "as", "t1", "join", "lots", "as", "t2", "on", "t1", ".", "investor_id", "=", "t2", ".", "investor_id", "where", "t1", ".", "investor_details", "=", "value" ]
[ "Return", "the", "lot", "details", "of", "lots", "that", "belong", "to", "investors", "with", "details", "``", "l", "''", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
What are the purchase details of transactions with amount bigger than 10000?
SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000
[ "SELECT", "T1.purchase_details", "FROM", "PURCHASES", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.purchase_transaction_id", "=", "T2.transaction_id", "WHERE", "T2.amount_of_transaction", ">", "10000" ]
[ "select", "t1", ".", "purchase_details", "from", "purchases", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "purchase_transaction_id", "=", "t2", ".", "transaction_id", "where", "t2", ".", "amount_of_transaction", ">", "value" ]
[ "What", "are", "the", "purchase", "details", "of", "transactions", "with", "amount", "bigger", "than", "10000", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
What are the sale details and dates of transactions with amount smaller than 3000?
SELECT T1.sales_details , T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000
[ "SELECT", "T1.sales_details", ",", "T2.date_of_transaction", "FROM", "SALES", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.sales_transaction_id", "=", "T2.transaction_id", "WHERE", "T2.amount_of_transaction", "<", "3000" ]
[ "select", "t1", ".", "sales_details", ",", "t2", ".", "date_of_transaction", "from", "sales", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "sales_transaction_id", "=", "t2", ".", "transaction_id", "where", "t2", ".", "amount_of_transaction", "<", "value" ]
[ "What", "are", "the", "sale", "details", "and", "dates", "of", "transactions", "with", "amount", "smaller", "than", "3000", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
What are the lot details of lots associated with transactions with share count smaller than 50?
SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50
[ "SELECT", "T1.lot_details", "FROM", "LOTS", "AS", "T1", "JOIN", "TRANSACTIONS_LOTS", "AS", "T2", "ON", "T1.lot_id", "=", "T2.transaction_id", "JOIN", "TRANSACTIONS", "AS", "T3", "ON", "T2.transaction_id", "=", "T3.transaction_id", "WHERE", "T3.share_count", "<", "50" ]
[ "select", "t1", ".", "lot_details", "from", "lots", "as", "t1", "join", "transactions_lots", "as", "t2", "on", "t1", ".", "lot_id", "=", "t2", ".", "transaction_id", "join", "transactions", "as", "t3", "on", "t2", ".", "transaction_id", "=", "t3", ".", "transaction_id", "where", "t3", ".", "share_count", "<", "value" ]
[ "What", "are", "the", "lot", "details", "of", "lots", "associated", "with", "transactions", "with", "share", "count", "smaller", "than", "50", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is "PUR"?
SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = "PUR"
[ "SELECT", "T1.lot_details", "FROM", "LOTS", "AS", "T1", "JOIN", "TRANSACTIONS_LOTS", "AS", "T2", "ON", "T1.lot_id", "=", "T2.transaction_id", "JOIN", "TRANSACTIONS", "AS", "T3", "ON", "T2.transaction_id", "=", "T3.transaction_id", "WHERE", "T3.share_count", ">", "100", "AND", "T3.transaction_type_code", "=", "``", "PUR", "''" ]
[ "select", "t1", ".", "lot_details", "from", "lots", "as", "t1", "join", "transactions_lots", "as", "t2", "on", "t1", ".", "lot_id", "=", "t2", ".", "transaction_id", "join", "transactions", "as", "t3", "on", "t2", ".", "transaction_id", "=", "t3", ".", "transaction_id", "where", "t3", ".", "share_count", ">", "value", "and", "t3", ".", "transaction_type_code", "=", "value" ]
[ "What", "are", "the", "lot", "details", "of", "lots", "associated", "with", "transactions", "whose", "share", "count", "is", "bigger", "than", "100", "and", "whose", "type", "code", "is", "``", "PUR", "''", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the average transaction amount for different transaction types.
SELECT transaction_type_code , avg(amount_of_transaction) FROM TRANSACTIONS GROUP BY transaction_type_code
[ "SELECT", "transaction_type_code", ",", "avg", "(", "amount_of_transaction", ")", "FROM", "TRANSACTIONS", "GROUP", "BY", "transaction_type_code" ]
[ "select", "transaction_type_code", ",", "avg", "(", "amount_of_transaction", ")", "from", "transactions", "group", "by", "transaction_type_code" ]
[ "Show", "the", "average", "transaction", "amount", "for", "different", "transaction", "types", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the maximum and minimum share count of different transaction types.
SELECT transaction_type_code , max(share_count) , min(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code
[ "SELECT", "transaction_type_code", ",", "max", "(", "share_count", ")", ",", "min", "(", "share_count", ")", "FROM", "TRANSACTIONS", "GROUP", "BY", "transaction_type_code" ]
[ "select", "transaction_type_code", ",", "max", "(", "share_count", ")", ",", "min", "(", "share_count", ")", "from", "transactions", "group", "by", "transaction_type_code" ]
[ "Show", "the", "maximum", "and", "minimum", "share", "count", "of", "different", "transaction", "types", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the average share count of transactions for different investors.
SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id
[ "SELECT", "investor_id", ",", "avg", "(", "share_count", ")", "FROM", "TRANSACTIONS", "GROUP", "BY", "investor_id" ]
[ "select", "investor_id", ",", "avg", "(", "share_count", ")", "from", "transactions", "group", "by", "investor_id" ]
[ "Show", "the", "average", "share", "count", "of", "transactions", "for", "different", "investors", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the average share count of transactions each each investor, ordered by average share count.
SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY avg(share_count)
[ "SELECT", "investor_id", ",", "avg", "(", "share_count", ")", "FROM", "TRANSACTIONS", "GROUP", "BY", "investor_id", "ORDER", "BY", "avg", "(", "share_count", ")" ]
[ "select", "investor_id", ",", "avg", "(", "share_count", ")", "from", "transactions", "group", "by", "investor_id", "order", "by", "avg", "(", "share_count", ")" ]
[ "Show", "the", "average", "share", "count", "of", "transactions", "each", "each", "investor", ",", "ordered", "by", "average", "share", "count", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the average amount of transactions for different investors.
SELECT investor_id , avg(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id
[ "SELECT", "investor_id", ",", "avg", "(", "amount_of_transaction", ")", "FROM", "TRANSACTIONS", "GROUP", "BY", "investor_id" ]
[ "select", "investor_id", ",", "avg", "(", "amount_of_transaction", ")", "from", "transactions", "group", "by", "investor_id" ]
[ "Show", "the", "average", "amount", "of", "transactions", "for", "different", "investors", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the average amount of transactions for different lots.
SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id
[ "SELECT", "T2.lot_id", ",", "avg", "(", "amount_of_transaction", ")", "FROM", "TRANSACTIONS", "AS", "T1", "JOIN", "Transactions_Lots", "AS", "T2", "ON", "T1.transaction_id", "=", "T2.transaction_id", "GROUP", "BY", "T2.lot_id" ]
[ "select", "t2", ".", "lot_id", ",", "avg", "(", "amount_of_transaction", ")", "from", "transactions", "as", "t1", "join", "transactions_lots", "as", "t2", "on", "t1", ".", "transaction_id", "=", "t2", ".", "transaction_id", "group", "by", "t2", ".", "lot_id" ]
[ "Show", "the", "average", "amount", "of", "transactions", "for", "different", "lots", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the average amount of transactions for different lots, ordered by average amount of transactions.
SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY avg(amount_of_transaction)
[ "SELECT", "T2.lot_id", ",", "avg", "(", "amount_of_transaction", ")", "FROM", "TRANSACTIONS", "AS", "T1", "JOIN", "Transactions_Lots", "AS", "T2", "ON", "T1.transaction_id", "=", "T2.transaction_id", "GROUP", "BY", "T2.lot_id", "ORDER", "BY", "avg", "(", "amount_of_transaction", ")" ]
[ "select", "t2", ".", "lot_id", ",", "avg", "(", "amount_of_transaction", ")", "from", "transactions", "as", "t1", "join", "transactions_lots", "as", "t2", "on", "t1", ".", "transaction_id", "=", "t2", ".", "transaction_id", "group", "by", "t2", ".", "lot_id", "order", "by", "avg", "(", "amount_of_transaction", ")" ]
[ "Show", "the", "average", "amount", "of", "transactions", "for", "different", "lots", ",", "ordered", "by", "average", "amount", "of", "transactions", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the number of transactions with transaction type code "SALE" for different investors if it is larger than 0.
SELECT investor_id , COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = "SALE" GROUP BY investor_id
[ "SELECT", "investor_id", ",", "COUNT", "(", "*", ")", "FROM", "TRANSACTIONS", "WHERE", "transaction_type_code", "=", "``", "SALE", "''", "GROUP", "BY", "investor_id" ]
[ "select", "investor_id", ",", "count", "(", "*", ")", "from", "transactions", "where", "transaction_type_code", "=", "value", "group", "by", "investor_id" ]
[ "Show", "the", "number", "of", "transactions", "with", "transaction", "type", "code", "``", "SALE", "''", "for", "different", "investors", "if", "it", "is", "larger", "than", "0", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the number of transactions for different investors.
SELECT investor_id , COUNT(*) FROM TRANSACTIONS GROUP BY investor_id
[ "SELECT", "investor_id", ",", "COUNT", "(", "*", ")", "FROM", "TRANSACTIONS", "GROUP", "BY", "investor_id" ]
[ "select", "investor_id", ",", "count", "(", "*", ")", "from", "transactions", "group", "by", "investor_id" ]
[ "Show", "the", "number", "of", "transactions", "for", "different", "investors", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the transaction type code that occurs the fewest times.
SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) ASC LIMIT 1
[ "SELECT", "transaction_type_code", "FROM", "TRANSACTIONS", "GROUP", "BY", "transaction_type_code", "ORDER", "BY", "COUNT", "(", "*", ")", "ASC", "LIMIT", "1" ]
[ "select", "transaction_type_code", "from", "transactions", "group", "by", "transaction_type_code", "order", "by", "count", "(", "*", ")", "asc", "limit", "value" ]
[ "Show", "the", "transaction", "type", "code", "that", "occurs", "the", "fewest", "times", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the transaction type code that occurs the most frequently.
SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1
[ "SELECT", "transaction_type_code", "FROM", "TRANSACTIONS", "GROUP", "BY", "transaction_type_code", "ORDER", "BY", "COUNT", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "transaction_type_code", "from", "transactions", "group", "by", "transaction_type_code", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "transaction", "type", "code", "that", "occurs", "the", "most", "frequently", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the description of the transaction type that occurs most frequently.
SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1
[ "SELECT", "T1.transaction_type_description", "FROM", "Ref_Transaction_Types", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.transaction_type_code", "=", "T2.transaction_type_code", "GROUP", "BY", "T1.transaction_type_code", "ORDER", "BY", "COUNT", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "transaction_type_description", "from", "ref_transaction_types", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "transaction_type_code", "=", "t2", ".", "transaction_type_code", "group", "by", "t1", ".", "transaction_type_code", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "description", "of", "the", "transaction", "type", "that", "occurs", "most", "frequently", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the id and details of the investor that has the largest number of transactions.
SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1
[ "SELECT", "T2.investor_id", ",", "T1.Investor_details", "FROM", "INVESTORS", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.investor_id", "=", "T2.investor_id", "GROUP", "BY", "T2.investor_id", "ORDER", "BY", "COUNT", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t2", ".", "investor_id", ",", "t1", ".", "investor_details", "from", "investors", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "investor_id", "=", "t2", ".", "investor_id", "group", "by", "t2", ".", "investor_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "id", "and", "details", "of", "the", "investor", "that", "has", "the", "largest", "number", "of", "transactions", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the id and details for the investors who have the top 3 number of transactions.
SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3
[ "SELECT", "T2.investor_id", ",", "T1.Investor_details", "FROM", "INVESTORS", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.investor_id", "=", "T2.investor_id", "GROUP", "BY", "T2.investor_id", "ORDER", "BY", "COUNT", "(", "*", ")", "DESC", "LIMIT", "3" ]
[ "select", "t2", ".", "investor_id", ",", "t1", ".", "investor_details", "from", "investors", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "investor_id", "=", "t2", ".", "investor_id", "group", "by", "t2", ".", "investor_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "id", "and", "details", "for", "the", "investors", "who", "have", "the", "top", "3", "number", "of", "transactions", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the ids of the investors who have at least two transactions.
SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2
[ "SELECT", "T2.investor_id", "FROM", "INVESTORS", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.investor_id", "=", "T2.investor_id", "GROUP", "BY", "T2.investor_id", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2" ]
[ "select", "t2", ".", "investor_id", "from", "investors", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "investor_id", "=", "t2", ".", "investor_id", "group", "by", "t2", ".", "investor_id", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "Show", "the", "ids", "of", "the", "investors", "who", "have", "at", "least", "two", "transactions", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
Show the ids and details of the investors who have at least two transactions with type code "SALE".
SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = "SALE" GROUP BY T2.investor_id HAVING COUNT(*) >= 2
[ "SELECT", "T2.investor_id", ",", "T1.Investor_details", "FROM", "INVESTORS", "AS", "T1", "JOIN", "TRANSACTIONS", "AS", "T2", "ON", "T1.investor_id", "=", "T2.investor_id", "WHERE", "T2.transaction_type_code", "=", "``", "SALE", "''", "GROUP", "BY", "T2.investor_id", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2" ]
[ "select", "t2", ".", "investor_id", ",", "t1", ".", "investor_details", "from", "investors", "as", "t1", "join", "transactions", "as", "t2", "on", "t1", ".", "investor_id", "=", "t2", ".", "investor_id", "where", "t2", ".", "transaction_type_code", "=", "value", "group", "by", "t2", ".", "investor_id", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "Show", "the", "ids", "and", "details", "of", "the", "investors", "who", "have", "at", "least", "two", "transactions", "with", "type", "code", "``", "SALE", "''", "." ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
What are the dates of transactions with at least 100 share count or amount bigger than 100?
SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100
[ "SELECT", "date_of_transaction", "FROM", "TRANSACTIONS", "WHERE", "share_count", ">", "=", "100", "OR", "amount_of_transaction", ">", "=", "100" ]
[ "select", "date_of_transaction", "from", "transactions", "where", "share_count", ">", "=", "value", "or", "amount_of_transaction", ">", "=", "value" ]
[ "What", "are", "the", "dates", "of", "transactions", "with", "at", "least", "100", "share", "count", "or", "amount", "bigger", "than", "100", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
What are the details of all sales and purchases?
SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases
[ "SELECT", "sales_details", "FROM", "sales", "UNION", "SELECT", "purchase_details", "FROM", "purchases" ]
[ "select", "sales_details", "from", "sales", "union", "select", "purchase_details", "from", "purchases" ]
[ "What", "are", "the", "details", "of", "all", "sales", "and", "purchases", "?" ]
tracking_share_transactions
[ "CREATE TABLE `Investors` (\n`investor_id` INTEGER PRIMARY KEY,\n`Investor_details` VARCHAR(255)\n);", "CREATE TABLE `Lots` (\n`lot_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`lot_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` )\n);", "CREATE TABLE `Ref_Transaction_Types` (\n`transaction_type_code` VARCHAR(10) PRIMARY KEY,\n`transaction_type_description` VARCHAR(80) NOT NULL\n);", "CREATE TABLE `Transactions` (\n`transaction_id` INTEGER PRIMARY KEY,\n`investor_id` INTEGER NOT NULL,\n`transaction_type_code` VARCHAR(10) NOT NULL,\n`date_of_transaction` DATETIME,\n`amount_of_transaction` DECIMAL(19,4),\n`share_count` VARCHAR(40),\n`other_details` VARCHAR(255),\nFOREIGN KEY (`investor_id` ) REFERENCES `Investors`(`investor_id` ),FOREIGN KEY (`transaction_type_code` ) REFERENCES `Ref_Transaction_Types`(`transaction_type_code` )\n);", "CREATE TABLE `Sales` (\n`sales_transaction_id` INTEGER PRIMARY KEY,\n`sales_details` VARCHAR(255),\nFOREIGN KEY (`sales_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Purchases` (\n`purchase_transaction_id` INTEGER NOT NULL,\n`purchase_details` VARCHAR(255) NOT NULL,\nFOREIGN KEY (`purchase_transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);", "CREATE TABLE `Transactions_Lots` (\n`transaction_id` INTEGER NOT NULL,\n`lot_id` INTEGER NOT NULL,\nFOREIGN KEY (`lot_id` ) REFERENCES `Lots`(`lot_id` ),\nFOREIGN KEY (`transaction_id` ) REFERENCES `Transactions`(`transaction_id` )\n);" ]
What are the details of the lots which are not used in any transactions?
SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id
[ "SELECT", "lot_details", "FROM", "Lots", "EXCEPT", "SELECT", "T1.lot_details", "FROM", "Lots", "AS", "T1", "JOIN", "transactions_lots", "AS", "T2", "ON", "T1.lot_id", "=", "T2.lot_id" ]
[ "select", "lot_details", "from", "lots", "except", "select", "t1", ".", "lot_details", "from", "lots", "as", "t1", "join", "transactions_lots", "as", "t2", "on", "t1", ".", "lot_id", "=", "t2", ".", "lot_id" ]
[ "What", "are", "the", "details", "of", "the", "lots", "which", "are", "not", "used", "in", "any", "transactions", "?" ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
How many available hotels are there in total?
SELECT count(*) FROM HOTELS
[ "SELECT", "count", "(", "*", ")", "FROM", "HOTELS" ]
[ "select", "count", "(", "*", ")", "from", "hotels" ]
[ "How", "many", "available", "hotels", "are", "there", "in", "total", "?" ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
Find the total number of available hotels.
SELECT count(*) FROM HOTELS
[ "SELECT", "count", "(", "*", ")", "FROM", "HOTELS" ]
[ "select", "count", "(", "*", ")", "from", "hotels" ]
[ "Find", "the", "total", "number", "of", "available", "hotels", "." ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
What are the price ranges of hotels?
SELECT price_range FROM HOTELS
[ "SELECT", "price_range", "FROM", "HOTELS" ]
[ "select", "price_range", "from", "hotels" ]
[ "What", "are", "the", "price", "ranges", "of", "hotels", "?" ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
Tell me the price ranges for all the hotels.
SELECT price_range FROM HOTELS
[ "SELECT", "price_range", "FROM", "HOTELS" ]
[ "select", "price_range", "from", "hotels" ]
[ "Tell", "me", "the", "price", "ranges", "for", "all", "the", "hotels", "." ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
Show all distinct location names.
SELECT DISTINCT Location_Name FROM LOCATIONS
[ "SELECT", "DISTINCT", "Location_Name", "FROM", "LOCATIONS" ]
[ "select", "distinct", "location_name", "from", "locations" ]
[ "Show", "all", "distinct", "location", "names", "." ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
What are the distinct location names?
SELECT DISTINCT Location_Name FROM LOCATIONS
[ "SELECT", "DISTINCT", "Location_Name", "FROM", "LOCATIONS" ]
[ "select", "distinct", "location_name", "from", "locations" ]
[ "What", "are", "the", "distinct", "location", "names", "?" ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
Show the names and details of all the staff members.
SELECT Name , Other_Details FROM Staff
[ "SELECT", "Name", ",", "Other_Details", "FROM", "Staff" ]
[ "select", "name", ",", "other_details", "from", "staff" ]
[ "Show", "the", "names", "and", "details", "of", "all", "the", "staff", "members", "." ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
What is the name and detail of each staff member?
SELECT Name , Other_Details FROM Staff
[ "SELECT", "Name", ",", "Other_Details", "FROM", "Staff" ]
[ "select", "name", ",", "other_details", "from", "staff" ]
[ "What", "is", "the", "name", "and", "detail", "of", "each", "staff", "member", "?" ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
Show details of all visitors.
SELECT Tourist_Details FROM VISITORS
[ "SELECT", "Tourist_Details", "FROM", "VISITORS" ]
[ "select", "tourist_details", "from", "visitors" ]
[ "Show", "details", "of", "all", "visitors", "." ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
What is the detail of each visitor?
SELECT Tourist_Details FROM VISITORS
[ "SELECT", "Tourist_Details", "FROM", "VISITORS" ]
[ "select", "tourist_details", "from", "visitors" ]
[ "What", "is", "the", "detail", "of", "each", "visitor", "?" ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
Show the price ranges of hotels with 5 star ratings.
SELECT price_range FROM HOTELS WHERE star_rating_code = "5"
[ "SELECT", "price_range", "FROM", "HOTELS", "WHERE", "star_rating_code", "=", "``", "5", "''" ]
[ "select", "price_range", "from", "hotels", "where", "star_rating_code", "=", "value" ]
[ "Show", "the", "price", "ranges", "of", "hotels", "with", "5", "star", "ratings", "." ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
What are the price ranges of five star hotels?
SELECT price_range FROM HOTELS WHERE star_rating_code = "5"
[ "SELECT", "price_range", "FROM", "HOTELS", "WHERE", "star_rating_code", "=", "``", "5", "''" ]
[ "select", "price_range", "from", "hotels", "where", "star_rating_code", "=", "value" ]
[ "What", "are", "the", "price", "ranges", "of", "five", "star", "hotels", "?" ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
Show the average price range of hotels that have 5 star ratings and allow pets.
SELECT avg(price_range) FROM HOTELS WHERE star_rating_code = "5" AND pets_allowed_yn = 1
[ "SELECT", "avg", "(", "price_range", ")", "FROM", "HOTELS", "WHERE", "star_rating_code", "=", "``", "5", "''", "AND", "pets_allowed_yn", "=", "1" ]
[ "select", "avg", "(", "price_range", ")", "from", "hotels", "where", "star_rating_code", "=", "value", "and", "pets_allowed_yn", "=", "value" ]
[ "Show", "the", "average", "price", "range", "of", "hotels", "that", "have", "5", "star", "ratings", "and", "allow", "pets", "." ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
What is the average price range of five star hotels that allow pets?
SELECT avg(price_range) FROM HOTELS WHERE star_rating_code = "5" AND pets_allowed_yn = 1
[ "SELECT", "avg", "(", "price_range", ")", "FROM", "HOTELS", "WHERE", "star_rating_code", "=", "``", "5", "''", "AND", "pets_allowed_yn", "=", "1" ]
[ "select", "avg", "(", "price_range", ")", "from", "hotels", "where", "star_rating_code", "=", "value", "and", "pets_allowed_yn", "=", "value" ]
[ "What", "is", "the", "average", "price", "range", "of", "five", "star", "hotels", "that", "allow", "pets", "?" ]
cre_Theme_park
[ "CREATE TABLE Ref_Hotel_Star_Ratings (\nstar_rating_code CHAR(15) NOT NULL,\nstar_rating_description VARCHAR(80),\nPRIMARY KEY (star_rating_code),\nUNIQUE (star_rating_code)\n);", "CREATE TABLE Locations (\nLocation_ID INTEGER NOT NULL,\nLocation_Name VARCHAR(255),\nAddress VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Location_ID)\n);", "CREATE TABLE Ref_Attraction_Types (\nAttraction_Type_Code CHAR(15) NOT NULL,\nAttraction_Type_Description VARCHAR(255),\nPRIMARY KEY (Attraction_Type_Code),\nUNIQUE (Attraction_Type_Code)\n);", "CREATE TABLE Visitors (\nTourist_ID INTEGER NOT NULL,\nTourist_Details VARCHAR(255),\nPRIMARY KEY (Tourist_ID),\nUNIQUE (Tourist_ID)\n);", "CREATE TABLE Features (\nFeature_ID INTEGER NOT NULL,\nFeature_Details VARCHAR(255),\nPRIMARY KEY (Feature_ID)\n);", "CREATE TABLE Hotels (\nhotel_id INTEGER NOT NULL,\nstar_rating_code CHAR(15) NOT NULL,\npets_allowed_yn CHAR(1),\nprice_range real,\nother_hotel_details VARCHAR(255),\nPRIMARY KEY (hotel_id),\nFOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings (star_rating_code)\n);", "CREATE TABLE Tourist_Attractions (\nTourist_Attraction_ID INTEGER NOT NULL,\nAttraction_Type_Code CHAR(15) NOT NULL,\nLocation_ID INTEGER NOT NULL,\nHow_to_Get_There VARCHAR(255),\nName VARCHAR(255),\nDescription VARCHAR(255),\nOpening_Hours VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Tourist_Attraction_ID),\nFOREIGN KEY (Location_ID) REFERENCES Locations (Location_ID),\nFOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types (Attraction_Type_Code)\n);", "CREATE TABLE Street_Markets (\nMarket_ID INTEGER NOT NULL,\nMarket_Details VARCHAR(255),\nPRIMARY KEY (Market_ID),\nFOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Shops (\nShop_ID INTEGER NOT NULL,\nShop_Details VARCHAR(255),\nPRIMARY KEY (Shop_ID),\nFOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Museums (\nMuseum_ID INTEGER NOT NULL,\nMuseum_Details VARCHAR(255),\nPRIMARY KEY (Museum_ID),\nFOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Royal_Family (\nRoyal_Family_ID INTEGER NOT NULL,\nRoyal_Family_Details VARCHAR(255),\nPRIMARY KEY (Royal_Family_ID),\nFOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Theme_Parks (\nTheme_Park_ID INTEGER NOT NULL,\nTheme_Park_Details VARCHAR(255),\nPRIMARY KEY (Theme_Park_ID),\nFOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Visits (\nVisit_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nTourist_ID INTEGER NOT NULL,\nVisit_Date DATETIME NOT NULL,\nVisit_Details VARCHAR(40) NOT NULL,\nPRIMARY KEY (Visit_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Tourist_ID) REFERENCES Visitors (Tourist_ID)\n);", "CREATE TABLE Photos (\nPhoto_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(255),\nDescription VARCHAR(255),\nFilename VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Photo_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Staff (\nStaff_ID INTEGER NOT NULL,\nTourist_Attraction_ID INTEGER NOT NULL,\nName VARCHAR(40),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Staff_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID)\n);", "CREATE TABLE Tourist_Attraction_Features (\nTourist_Attraction_ID INTEGER NOT NULL,\nFeature_ID INTEGER NOT NULL,\nPRIMARY KEY (Tourist_Attraction_ID, Feature_ID),\nFOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions (Tourist_Attraction_ID),\nFOREIGN KEY (Feature_ID) REFERENCES Features (Feature_ID)\n);" ]
What is the address of the location "UK Gallery"?
SELECT Address FROM LOCATIONS WHERE Location_Name = "UK Gallery"
[ "SELECT", "Address", "FROM", "LOCATIONS", "WHERE", "Location_Name", "=", "``", "UK", "Gallery", "''" ]
[ "select", "address", "from", "locations", "where", "location_name", "=", "value" ]
[ "What", "is", "the", "address", "of", "the", "location", "``", "UK", "Gallery", "''", "?" ]